Re: [PATCH] drivers/block/floppy.c: stylistic cleanups

From: Joe Perches
Date: Tue Dec 01 2009 - 12:46:32 EST


On Tue, 2009-12-01 at 18:36 +0100, Marcin Slusarz wrote:
> On Mon, Nov 30, 2009 at 08:13:40PM -0800, Joe Perches wrote:
> > +#define CALL(x) do { if ((x) == -EINTR) return -EINTR; } while (0)
> > +#define ECALL(x) do { if ((ret = (x))) return ret; } while (0)
> > +#define _WAIT(x, i) CALL(ret = wait_til_done((x), i))
> > +#define WAIT(x) _WAIT((x), interruptible)
> > +#define IWAIT(x) _WAIT((x), 1)
>
> why not remove these macros too? (probably in a seperate patch)
> macros which hide "return" are very annoying...

Hence the "still ugly". I agree these aren't good.

> > +#define LOCK_FDC(drive, interruptible) \
> > + if (lock_fdc(drive, interruptible)) \
> > + return -EINTR;
>
> another annoying macro

True.

> > + if (UNIT(current_drive) < 0) {
> > + reset_fdc();
> > + return;
> > + }
> > }
>
> unneeded return

> > * installing the new fdutils package */
> > - if (cmd == CDROMEJECT || /* CD-ROM eject */
> > - cmd == 0x6470 /* SunOS floppy eject */ ) {
> > + if (cmd == CDROMEJECT || cmd == 0x6470) {
>
> please add descriptive constant

Patches are apparently welcomed by Stephen.
Don't wait for me, I'll catch up.

cheers, Joe

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