Skip to content

Commit 4f1b461

Browse files
Colin Ian Kingdtor
authored andcommitted
Input: elantech - make arrays debounce_packet static, reduces object code size
Don't populate the arrays debounce_packet on the stack, instead make them static. Makes the object code smaller by over 870 bytes: Before: text data bss dec hex filename 30553 9152 0 39705 9b19 drivers/input/mouse/elantech.o After: text data bss dec hex filename 29521 9312 0 38833 97b1 drivers/input/mouse/elantech.o Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 023c437 commit 4f1b461

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/input/mouse/elantech.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,9 @@ static int elantech_debounce_check_v2(struct psmouse *psmouse)
700700
* When we encounter packet that matches this exactly, it means the
701701
* hardware is in debounce status. Just ignore the whole packet.
702702
*/
703-
const u8 debounce_packet[] = { 0x84, 0xff, 0xff, 0x02, 0xff, 0xff };
703+
static const u8 debounce_packet[] = {
704+
0x84, 0xff, 0xff, 0x02, 0xff, 0xff
705+
};
704706
unsigned char *packet = psmouse->packet;
705707

706708
return !memcmp(packet, debounce_packet, sizeof(debounce_packet));
@@ -741,7 +743,9 @@ static int elantech_packet_check_v2(struct psmouse *psmouse)
741743
static int elantech_packet_check_v3(struct psmouse *psmouse)
742744
{
743745
struct elantech_data *etd = psmouse->private;
744-
const u8 debounce_packet[] = { 0xc4, 0xff, 0xff, 0x02, 0xff, 0xff };
746+
static const u8 debounce_packet[] = {
747+
0xc4, 0xff, 0xff, 0x02, 0xff, 0xff
748+
};
745749
unsigned char *packet = psmouse->packet;
746750

747751
/*

0 commit comments

Comments
 (0)