Re: [PATCH 07/11] restore amikbd compatibility with 2.4

From: Andrew Morton
Date: Wed May 24 2006 - 21:36:27 EST


zippel@xxxxxxxxxxxxxx wrote:
>
> + 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));
> + for (j = 0; j < 0x78; j++) {
> + if (!amikbd_keycode[j])
> + continue;
> + temp_map[j] = key_maps[i][amikbd_keycode[j]];
> + }
> + for (j = 0; j < NR_KEYS; j++) {
> + if (!temp_map[j])
> + temp_map[j] = 0xf200;
> + }
> + memcpy(key_maps[i], temp_map, sizeof(temp_map));
> + }

I assume temp_map[] is static to avoid using too much stack.

But wouldn't it be simpler to make this code operate on key_maps[i] directly?


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/