RE: [PATCH] gdth update

From: Leubner, Achim
Date: Wed Sep 29 2004 - 07:19:15 EST


> On Tue, 2004-09-28 at 13:12, Linux Kernel Mailing List wrote:
> > * IO-mapping with virt_to_bus(), gdth_readb(), gdth_writeb(), ...
> > - * register_reboot_notifier() to get a notify on shutdown used
> > + * register_reboot_notifier() to get a notify on shutown used
>
> why this change ?
>
OK, my fault.

> > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
> > +static irqreturn_t gdth_interrupt(int irq, void *dev_id, struct
pt_regs *regs);
> > #else
> > -static void gdth_interrupt(int irq,struct pt_regs *regs);
> > +static void gdth_interrupt(int irq, void *dev_id, struct pt_regs
*regs);
> > #endif
>
> this really is the wrong way to do such irq prototype compatibility in
> drivers. *really*
>
So please tell me what the right way should be. It works without any
problem.

> > +static struct file_operations gdth_fops = {
> > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
> > + .ioctl = gdth_ioctl,
> > + .open = gdth_open,
> > + .release = gdth_close,
> > +#else
> > + ioctl:gdth_ioctl,
> > + open:gdth_open,
> > + release:gdth_close,
> > +#endif
>
> C99 initializers work in all kernel versions since it's a property of
> the C compiler not of the kernel. I wonder why you are putting this
> ifdef here....
>
Agree. If the initializers works also fine with compiler versions in
older distributions with the 2.4.x and 2.2.x kernels, the ifdef is
really useless.

> the rest of your ifdefs are generally quite fishy too
unfortionately...
>
Could you please explain it exactly? I really want to learn what the
problems are to correct it in the next version.

-
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/