Messages in this thread | | | Date | Thu, 25 May 2006 03:50:09 +0200 (CEST) | From | Roman Zippel <> | Subject | Re: [PATCH 07/11] restore amikbd compatibility with 2.4 |
| |
Hi,
On Wed, 24 May 2006, Andrew Morton wrote:
> zippel@linux-m68k.org 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.
Yes, although it should only be 1KB.
> But wouldn't it be simpler to make this code operate on key_maps[i] directly?
No, the remapping would overwrite data which still needs to be read.
bye, Roman - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |