lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Mon,  4 Sep 2017 10:04:18 +0100
From:   Colin King <colin.king@...onical.com>
To:     Dmitry Torokhov <dmitry.torokhov@...il.com>,
        linux-input@...r.kernel.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] input: adi: make array seq static, reduces object code size

From: Colin Ian King <colin.king@...onical.com>

Don't populate the array seq on the stack, instead make it static.
Makes the object code smaller by over 170 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  13227	   3232	      0	  16459	   404b	drivers/input/joystick/adi.o

After:
   text	   data	    bss	    dec	    hex	filename
  12957	   3328	      0	  16285	   3f9d	drivers/input/joystick/adi.o

Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 drivers/input/joystick/adi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/joystick/adi.c b/drivers/input/joystick/adi.c
index d09cefa37931..15a71acb6997 100644
--- a/drivers/input/joystick/adi.c
+++ b/drivers/input/joystick/adi.c
@@ -313,7 +313,7 @@ static void adi_close(struct input_dev *dev)
 
 static void adi_init_digital(struct gameport *gameport)
 {
-	int seq[] = { 4, -2, -3, 10, -6, -11, -7, -9, 11, 0 };
+	static const int seq[] = { 4, -2, -3, 10, -6, -11, -7, -9, 11, 0 };
 	int i;
 
 	for (i = 0; seq[i]; i++) {
-- 
2.14.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ