On Dec 2, 2007 3:48 PM, <[EMAIL PROTECTED]> wrote:
> Log Message Added support for OpenCores Keyboard Controller
you going to take care of pushing to the input guys / LKML ? a
general look over and it looks pretty good :)
> Added: trunk/drivers/input/keyboard/opencores-kbd.c (0 => 3970)
> +static int __devinit opencores_kbd_probe(struct platform_device *pdev)
> +{
> + struct input_dev *input;
> + struct opencores_kbd *opencores_kbd;
> + int i, error;
> +
> + opencores_kbd = kzalloc(sizeof(struct opencores_kbd), GFP_KERNEL);
sizeof(*opencores_kbd) tends to be more bitrot proof
> + opencores_kbd->keycode = kmalloc(128 * sizeof(unsigned short),
> GFP_KERNEL);
where's that 128 come from ? if it's a magic # of sorts, probably
better to have it be a local #define ...
also, sizeof(*opencores_kbd->keycode) here as well ...
> + for (i = 0; i < 128; i++) opencores_kbd->keycode[i] = i;
does it need to be done early ? if things fail to initialize
properly, the keycode array wont get used, so it can nicely be merged
with the later loop:
> + for (i = 0; i < input->keycodemax; i++)
> + __set_bit(opencores_kbd->keycode[i] & KEY_MAX, input->keybit);
-mike
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits