Re: [PATCH 2/2] staging :keucr:scsiglue.c : fixed a macros should not be colon terminated issue

From: Joe Perches
Date: Tue Mar 04 2014 - 20:44:14 EST


On Tue, 2014-03-04 at 17:10 -0800, Greg KH wrote:
> On Sun, Mar 02, 2014 at 06:21:16PM +0530, Keerthimai Janarthanan wrote:
> > fixed a coding style issue.
[]
> > diff --git a/drivers/staging/keucr/scsiglue.c b/drivers/staging/keucr/scsiglue.c
[]
> > @@ -277,7 +277,7 @@ static int show_info(struct seq_file *m, struct Scsi_Host *host)
> > do { \
> > if (us->fflags & value) \
> > SPRINTF(" " #name); \
> > - } while (0);
> > + } while (0)
>
> You just broke the build.
>
> Please ALWAYS test your patches, don't break someone else's build with
> broken patches...
>
> Please be more careful.

Thanks Greg.

Keerthimai, a possibly "better" fix would be to add a
do { ... } while (0) guard and semicolons to the relatively
ugly US_DO_ALL_FLAGS macro and US_FLAG uses in
include/linux/usb_usual.h

include/linux/usb_usual.h:#define US_DO_ALL_FLAGS \
include/linux/usb_usual.h- US_FLAG(SINGLE_LUN, 0x00000001) \
include/linux/usb_usual.h- /* allow access to only LUN 0 */ \
include/linux/usb_usual.h- US_FLAG(NEED_OVERRIDE, 0x00000002) \
include/linux/usb_usual.h- /* unusual_devs entry is necessary */ \
...

and then add a semicolon to the uses of US_DO_ALL_FLAGS
and then remove a semicolon as above.

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