]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
arm: zynq: slcr: Fix array size
authorSoren Brinkmann <soren.brinkmann@xilinx.com>
Mon, 20 May 2013 16:27:15 +0000 (09:27 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 23 Aug 2013 12:51:35 +0000 (14:51 +0200)
An array holding status bits was defined too small. This is fixed by
removing the static array size with a compile time calculation.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/arm/mach-zynq/slcr.c

index 6a0640269f90fa241fe689a24d5bc19cf17a9777..3af4b86c7028a35c8e40c4d18e0a00fe5c766d82 100644 (file)
@@ -269,11 +269,6 @@ static const char * const mio_periph_name[] = {
        "uart1",
 };
 
-/* Each bit in this array is a flag that indicates whether a mio peripheral
- * is assigned. The order of bits in this array is same as the order of
- * peripheral names in the array mio_periph_name */
-static u32 periph_status[2] = {0, 0};
-
 /* Each element in the following array holds the active pinset of a MIO
  * peripheral. The order of peripherals in this array is same as the order of
  * peripheral names in the array mio_periph_name */
@@ -1177,6 +1172,13 @@ static const struct xslcr_mio mio_periphs[] = {
        },
 };
 
+/*
+ * Each bit in this array is a flag that indicates whether a mio peripheral
+ * is assigned. The order of bits in this array is same as the order of
+ * peripheral names in the array mio_periph_name
+ */
+static u32 periph_status[DIV_ROUND_UP(ARRAY_SIZE(mio_periphs), 32)];
+
 /* Peripherals that can be reset thru SLCR */
 static const char * const reset_periph_name[] = {
        "pss",