Skip to content

Commit

Permalink
USB: serial: constify static arrays
Browse files Browse the repository at this point in the history
Declare three immutable static driver arrays as const.

Signed-off-by: Johan Hovold <johan@kernel.org>
  • Loading branch information
Johan Hovold committed Apr 19, 2017
1 parent 185fcb3 commit 4f37fa5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions drivers/usb/serial/io_edgeport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/mos7720.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/usb_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4f37fa5

Please sign in to comment.