Re: [PATCH] locks: remove trailing semicolon in macro definition

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

 



On 11/29/20 9:47 AM, Tom Rix wrote:
> 
> On 11/27/20 11:53 AM, Matthew Wilcox wrote:
>> On Fri, Nov 27, 2020 at 11:07:07AM -0800, trix@xxxxxxxxxx wrote:
>>> +++ b/fs/fcntl.c
>>> @@ -526,7 +526,7 @@ SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
>>>  	(dst)->l_whence = (src)->l_whence;	\
>>>  	(dst)->l_start = (src)->l_start;	\
>>>  	(dst)->l_len = (src)->l_len;		\
>>> -	(dst)->l_pid = (src)->l_pid;
>>> +	(dst)->l_pid = (src)->l_pid
>> This should be wrapped in a do { } while (0).
>>
>> Look, this warning is clearly great at finding smelly code, but the
>> fixes being generated to shut up the warning are low quality.
>>
> Multiline macros not following the do {} while (0) pattern are likely a larger problem.
> 
> I'll take a look.


Could it become a static inline function instead?
or that might expand its scope too much?

-- 
~Randy




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux