Re: [PATCH 3/3] MEMSTICK: Add driver for Ricoh R5C592 Card reader.

From: Maxim Levitsky
Date: Thu Aug 05 2010 - 21:27:39 EST


On Thu, 2010-08-05 at 18:14 -0700, Joe Perches wrote:
> On Thu, 2010-08-05 at 17:25 +0300, Maxim Levitsky wrote:
> > Signed-off-by: Maxim Levitsky <maximlevitsky@xxxxxxxxx>
>
> Trivial comments:
>
> > ---
> > MAINTAINERS | 6 +
> > +RICOH R5C592 MEMORYSTICK DRIVER
> > +M: Maxim Levitsky <maximlevitsky@xxxxxxxxx>
> > +S: Maintained
> > +F: drivers/memstick/host/r592.c
> > +F: drivers/memstick/host/r592.h
>
> Patterns in maintainers can use wildcards
Didn't know about that, thanks!
>
> F: drivers/memstick/host/r592*
>
> > --- /dev/null
> > +++ b/drivers/memstick/host/r592.c
> > @@ -0,0 +1,889 @@
> []
> > +static char *tpc_names[] = {
>
> const ?
Sure
>
> > + "MS_TPC_READ_MG_STATUS",
> > + "MS_TPC_READ_LONG_DATA",
>
> []
>
> > +#define dbg(format, ...) \
> > + if (debug) \
> > + printk(KERN_DEBUG DRV_NAME ": " format "\n", ## __VA_ARGS__)
> > +
> > +#define dbg_verbose(format, ...) \
> > + if (debug > 1) \
> > + printk(KERN_DEBUG DRV_NAME ": " format "\n", ## __VA_ARGS__)
> > +
> > +#define dbg_reg(format, ...) \
> > + if (debug > 2) \
> > + printk(KERN_DEBUG DRV_NAME ": " format "\n", ## __VA_ARGS__)
> > +
>
> These style macros should use do { if (test) print(); } while (9)
> so they could be used without problems in if/else blocks.
>
> Maybe it'd be better to have and use 1 macro with a level passed:
>
> #define dbg(level, format, ...) \
> do { \
> if (debug > level) \
> printk(KERN_DEBUG pr_fmt(format), ##__VA_ARGS__); \
> } while (0)
Thinking again about that, why not...



>
> > +#define message(format, ...) \
> > + printk(KERN_INFO DRV_NAME ": " format "\n", ## __VA_ARGS__)
>
> Why not just use pr_info?
Will look at that.

Best regards,
Maxim Levitsky



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