Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: serial: upd78f0730: make constants static

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>

authored by

Maksim Salau and committed by
Johan Hovold
4cd4475e 5ed02dbb

+3 -3
+3 -3
drivers/usb/serial/upd78f0730.c
··· 288 288 static speed_t upd78f0730_get_baud_rate(struct tty_struct *tty) 289 289 { 290 290 const speed_t baud_rate = tty_get_baud_rate(tty); 291 - const speed_t supported[] = { 291 + static const speed_t supported[] = { 292 292 0, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 153600 293 293 }; 294 294 int i; ··· 384 384 385 385 static int upd78f0730_open(struct tty_struct *tty, struct usb_serial_port *port) 386 386 { 387 - struct upd78f0730_open_close request = { 387 + static const struct upd78f0730_open_close request = { 388 388 .opcode = UPD78F0730_CMD_OPEN_CLOSE, 389 389 .state = UPD78F0730_PORT_OPEN 390 390 }; ··· 402 402 403 403 static void upd78f0730_close(struct usb_serial_port *port) 404 404 { 405 - struct upd78f0730_open_close request = { 405 + static const struct upd78f0730_open_close request = { 406 406 .opcode = UPD78F0730_CMD_OPEN_CLOSE, 407 407 .state = UPD78F0730_PORT_CLOSE 408 408 };