Re: + scripts-checkpatch-check-unused-parameters-for-function-like-macro.patch added to mm-nonmm-unstable branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> The patch titled
>>      Subject: scripts: checkpatch: check unused parameters for function-like macro
>> has been added to the -mm mm-nonmm-unstable branch.  Its filename is
>>      scripts-checkpatch-check-unused-parameters-for-function-like-macro.patch
> 
> Conceptually I don't disagree but I wonder what the false
> positive rate is.

Hi Joe,

If your concern is whether this script might produce inaccurate reports, I'm confident that
the false positive rate is 0%. Xining, please correct me if I'm mistaken.

Regarding the percentage of cases where a macro function might not utilize a parameter,
it varies depending on the specific scenario.

For the code below, if flush_dcache_page is implemented as a macro on those architecturs
which have not dcache and doesn't cast its parameter to void, it will trigger a build
warning.

 struct page *dst_page = sg_page(req->dst);

 for (i = 0; i < nr_pages; i++)
 	flush_dcache_page(dst_page + i);


If we perform the following action before invoking flush_dcache_page(),

 struct page *dst_page = sg_page(req->dst);

 xxx = dst_page;
 ...
  
 for (i = 0; i < nr_pages; i++)
 	flush_dcache_page(dst_page + i);
 	
 We won't have any issue.
 
The coding style modification operates on the assumption of the worst-case scenario.
 
Thanks
Barry





[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux