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

Input: sidewinder - make array seq static const, makes object smaller

Don't populate the array seq on the stack but instead make it
static const. Makes the object code smaller by 30 bytes.

Before:
text data bss dec hex filename
22284 3184 0 25468 637c drivers/input/joystick/sidewinder.o

After:
text data bss dec hex filename
22158 3280 0 25438 635e drivers/input/joystick/sidewinder.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Colin Ian King and committed by
Dmitry Torokhov
410f25de 4370b231

+1 -1
+1 -1
drivers/input/joystick/sidewinder.c
··· 223 223 224 224 static void sw_init_digital(struct gameport *gameport) 225 225 { 226 - int seq[] = { 140, 140+725, 140+300, 0 }; 226 + static const int seq[] = { 140, 140+725, 140+300, 0 }; 227 227 unsigned long flags; 228 228 int i, t; 229 229