Skip to content

Commit

Permalink
Input: amikbd - allocate temporary keymap buffer on the stack
Browse files Browse the repository at this point in the history
Allocate the temporary buffer needed for initialization of the console
keyboard maps (512 bytes, as NR_KEYS = 256) on the stack instead of
statically, to reduce kernel size.

add/remove: 0/1 grow/shrink: 0/0 up/down: 0/-512 (-512)
function                                     old     new   delta
temp_map                                     512       -    -512

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Geert Uytterhoeven authored and Dmitry Torokhov committed Dec 3, 2014
1 parent 545e625 commit e147af4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/input/keyboard/amikbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,11 @@ static unsigned char amikbd_keycode[0x78] __initdata = {

static void __init amikbd_init_console_keymaps(void)
{
/* We can spare 512 bytes on stack for temp_map in init path. */
unsigned short temp_map[NR_KEYS];
int i, j;

for (i = 0; i < MAX_NR_KEYMAPS; i++) {
static u_short temp_map[NR_KEYS] __initdata;
if (!key_maps[i])
continue;
memset(temp_map, 0, sizeof(temp_map));
Expand Down

0 comments on commit e147af4

Please sign in to comment.