]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
USB: serial: upd78f0730: make constants static
authorMaksim Salau <maksim.salau@gmail.com>
Mon, 24 Apr 2017 09:59:53 +0000 (12:59 +0300)
committerJohan Hovold <johan@kernel.org>
Thu, 1 Jun 2017 09:07:50 +0000 (11:07 +0200)
Some local constants don't change from call to call and are good
candidates to become static. This will prevent copying of these
constants to stack during runtime.

Signed-off-by: Maksim Salau <maksim.salau@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/upd78f0730.c

index a028dd2310c97da2e9e75456fd4909abad9200ad..6819a3486e5da3da9ae4737b4e41bcd02203f6ac 100644 (file)
@@ -288,7 +288,7 @@ static void upd78f0730_dtr_rts(struct usb_serial_port *port, int on)
 static speed_t upd78f0730_get_baud_rate(struct tty_struct *tty)
 {
        const speed_t baud_rate = tty_get_baud_rate(tty);
-       const speed_t supported[] = {
+       static const speed_t supported[] = {
                0, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 153600
        };
        int i;
@@ -384,7 +384,7 @@ static void upd78f0730_set_termios(struct tty_struct *tty,
 
 static int upd78f0730_open(struct tty_struct *tty, struct usb_serial_port *port)
 {
-       struct upd78f0730_open_close request = {
+       static const struct upd78f0730_open_close request = {
                .opcode = UPD78F0730_CMD_OPEN_CLOSE,
                .state = UPD78F0730_PORT_OPEN
        };
@@ -402,7 +402,7 @@ static int upd78f0730_open(struct tty_struct *tty, struct usb_serial_port *port)
 
 static void upd78f0730_close(struct usb_serial_port *port)
 {
-       struct upd78f0730_open_close request = {
+       static const struct upd78f0730_open_close request = {
                .opcode = UPD78F0730_CMD_OPEN_CLOSE,
                .state = UPD78F0730_PORT_CLOSE
        };