lkml.org 
[lkml]   [2020]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] Staging: rtl8712: Addressed checkpatch.pl issues related to macro parameter wrapping in parentheses.
On Sun, 14 Jun 2020 at 15:05, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Sun, Jun 14, 2020 at 02:51:25PM +0100, Ricardo Ferreira wrote:
> > #define init_h2fwcmd_w_parm_no_rsp(pcmd, pparm, code) \
> > do {\
> > - INIT_LIST_HEAD(&pcmd->list);\
> > - pcmd->cmdcode = code;\
> > - pcmd->parmbuf = (u8 *)(pparm);\
> > - pcmd->cmdsz = sizeof(*pparm);\
> > - pcmd->rsp = NULL;\
> > - pcmd->rspsz = 0;\
> > + INIT_LIST_HEAD(&(pcmd)->list);\
> > + (pcmd)->cmdcode = code;\
> > + (pcmd)->parmbuf = (u8 *)((pparm));\
> > + (pcmd)->cmdsz = sizeof(*(pparm));\
> > + (pcmd)->rsp = NULL;\
> > + (pcmd)->rspsz = 0;\
> > } while (0)
>
> Does that change really make any sense? checkpatch is a nice hint,
> sometimes it is not correct...

(Replying again since I mistakenly sent my comments only to Greg...)

Yeah I was over-eager and applied some of checkpatche's patches
without thinking twice... I guess the parenthesis wrapping only makes
sense when you have an operator (either binary or unary). I've
rechecked each macro identified by checkpatch to see if there is a
need for parenthesis wrapping in their current usage.

Regards,
Ricardo Ferreira.

\
 
 \ /
  Last update: 2020-06-15 11:29    [W:6.983 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site