Re: [patch 04/33] m68k: Atari keyboard and mouse support.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



What's the reason for splitting this up?  Things would be a quite a bit
simpler if all the code was directly in atakeyb.c.

> +/*
> + * linux/atari/atakeyb.c

This is a good reason why filename comments are a really bad idea :)

> +/* state: 0: off; >0: in progress; >1: 0xf1 received */
> +static volatile int ikbd_self_test;
> +/* timestamp when last received a char */
> +static volatile unsigned long self_test_last_rcv;

Please don't use volatile variable in kernel code.  While linux/m68k doesn't
support smp or preemptible kernels we should at least put in proper synchronization
at the API level.

> +/* bitmap of keys reported as broken */
> +static unsigned long broken_keys[128/(sizeof(unsigned long)*8)] = { 0, };

DECLARE_BITMAP()

> +typedef enum kb_state_t {
> +	KEYBOARD, AMOUSE, RMOUSE, JOYSTICK, CLOCK, RESYNC
> +} KB_STATE_T;
> +
> +#define	IS_SYNC_CODE(sc)	((sc) >= 0x04 && (sc) <= 0xfb)
> +
> +typedef struct keyboard_state {
> +	unsigned char buf[6];
> +	int len;
> +	KB_STATE_T state;
> +} KEYBOARD_STATE;

Please kill the typedefs and shouting names.

> +#ifdef __MODULE__
> +MODULE_PARM(mouse_threshold, "2i");
> +#endif

__MODULE__ is never true and even if it was a MODULE_PARM wouldn't compile.
use an unconditional module_param instead.

> --- linux-m68k-2.6.21.orig/include/linux/input.h
> +++ linux-m68k-2.6.21/include/linux/input.h
> @@ -676,6 +676,7 @@ struct input_absinfo {
>  #define BUS_I2C			0x18
>  #define BUS_HOST		0x19
>  #define BUS_GSC			0x1A
> +#define BUS_ATARI		0x1B

Is this really a separate bus?  Should't we have a BUS_ONBOARD or so instead?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux