USB: serial: constify static arrays
authorJohan Hovold <johan@kernel.org>
Tue, 18 Apr 2017 12:42:28 +0000 (14:42 +0200)
committerJohan Hovold <johan@kernel.org>
Wed, 19 Apr 2017 07:45:43 +0000 (09:45 +0200)
Declare three immutable static driver arrays as const.

Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/io_edgeport.c
drivers/usb/serial/mos7720.c
drivers/usb/serial/usb_debug.c

index e5d6265eac6e12eac3c84b3c3c69432bc8e351f5..bdf8bd814a9aaf89d646545cac01da659ab475b6 100644 (file)
@@ -2839,9 +2839,9 @@ static int edge_startup(struct usb_serial *serial)
        bool interrupt_in_found;
        bool bulk_in_found;
        bool bulk_out_found;
-       static __u32 descriptor[3] = {  EDGE_COMPATIBILITY_MASK0,
-                                       EDGE_COMPATIBILITY_MASK1,
-                                       EDGE_COMPATIBILITY_MASK2 };
+       static const __u32 descriptor[3] = {    EDGE_COMPATIBILITY_MASK0,
+                                               EDGE_COMPATIBILITY_MASK1,
+                                               EDGE_COMPATIBILITY_MASK2 };
 
        dev = serial->dev;
 
index c3a314d5bdc64b65a42aff9b98f6f45868ba5123..a453965f9e9a3153ffcbb28d4a6257a4db094cd3 100644 (file)
@@ -1408,7 +1408,7 @@ struct divisor_table_entry {
 /* Define table of divisors for moschip 7720 hardware     *
  * These assume a 3.6864MHz crystal, the standard /16, and *
  * MCR.7 = 0.                                             */
-static struct divisor_table_entry divisor_table[] = {
+static const struct divisor_table_entry divisor_table[] = {
        {   50,         2304},
        {   110,        1047},  /* 2094.545455 => 230450   => .0217 % over */
        {   134,        857},   /* 1713.011152 => 230398.5 => .00065% under */
index ca2fa5bbe17e1a9406079a89571e8dd31a083c9a..d210eff4cd33af1d33b735043f47fe971246ecf6 100644 (file)
@@ -17,7 +17,7 @@
 
 #define USB_DEBUG_MAX_PACKET_SIZE      8
 #define USB_DEBUG_BRK_SIZE             8
-static char USB_DEBUG_BRK[USB_DEBUG_BRK_SIZE] = {
+static const char USB_DEBUG_BRK[USB_DEBUG_BRK_SIZE] = {
        0x00,
        0xff,
        0x01,