Re: [PATCH 05/15] staging: rtl8723bs: put parentheses on macros with complex values in include/drv_types.h

From: Fabio Aiuto
Date: Fri Mar 26 2021 - 11:13:37 EST


On Fri, Mar 26, 2021 at 05:22:57PM +0300, Dan Carpenter wrote:
> On Fri, Mar 26, 2021 at 10:09:12AM +0100, Fabio Aiuto wrote:
> > fix the following checkpatch warning:
> >
> > ERROR: Macros with complex values should be enclosed in parentheses
> > 279: FILE: drivers/staging/rtl8723bs/include/drv_types.h:279:
> > +#define KEY_ARG(x) ((u8 *)(x))[0], ((u8 *)(x))[1],
> > ((u8 *)(x))[2], ((u8 *)(x))[3], ((u8 *)(x))[4], ((u8 *)(x))[5], \
> >
> > Signed-off-by: Fabio Aiuto <fabioaiuto83@xxxxxxxxx>
> > ---
> > drivers/staging/rtl8723bs/include/drv_types.h | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8723bs/include/drv_types.h b/drivers/staging/rtl8723bs/include/drv_types.h
> > index 1658450b386e..ead4cb9c1e5a 100644
> > --- a/drivers/staging/rtl8723bs/include/drv_types.h
> > +++ b/drivers/staging/rtl8723bs/include/drv_types.h
> > @@ -276,9 +276,9 @@ struct cam_entry_cache {
> > };
> >
> > #define KEY_FMT "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
> > -#define KEY_ARG(x) ((u8 *)(x))[0], ((u8 *)(x))[1], ((u8 *)(x))[2], ((u8 *)(x))[3], ((u8 *)(x))[4], ((u8 *)(x))[5], \
> > +#define KEY_ARG(x) (((u8 *)(x))[0], ((u8 *)(x))[1], ((u8 *)(x))[2], ((u8 *)(x))[3], ((u8 *)(x))[4], ((u8 *)(x))[5], \
> > ((u8 *)(x))[6], ((u8 *)(x))[7], ((u8 *)(x))[8], ((u8 *)(x))[9], ((u8 *)(x))[10], ((u8 *)(x))[11], \
> > - ((u8 *)(x))[12], ((u8 *)(x))[13], ((u8 *)(x))[14], ((u8 *)(x))[15]
> > + ((u8 *)(x))[12], ((u8 *)(x))[13], ((u8 *)(x))[14], ((u8 *)(x))[15])
>
> KEY_ARG() isn't used anywhere that I can see. Just delete it.
>
> Please take your time when you re-write this series and think about each
> change clearly and fix the underlying badness instead of just making
> checkpatch happy. I would really just throw out the patchset and start
> over from scratch.
>
> regards,
> dan carpenter
>

Hi Dan,

KEY_FMT is unused as well. I'm rewriting the whole series, will send
v2.

thank you,

fabio