lkml.org 
[lkml]   [2008]   [Jan]   [28]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 28 Jan 2008 01:02:03 -0600
FromJoel Schopp <>
SubjectRe: [PATCH v2 8/9] bfs: remove multiple assignments
>>> -    inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC;
>>> +    inode->i_mtime = CURRENT_TIME_SEC;
>>> +    inode->i_atime = CURRENT_TIME_SEC;
>>> +    inode->i_ctime = CURRENT_TIME_SEC;
>> multiple assignments like "x = y = z = value;" can potentially
>> (depending on the compiler and arch) be faster than "x = value; y =
>> value; z=value;"
>>
>> I am surprized that this script complains about them as it is a
>> perfectly valid thing to do in C.
> 
> I think it seems wise to ask the maintainers of checkpatch.pl to
> comment on that. I'm Cc:ing them now.
> 

There are plenty of things that are valid to do in C that don't make for 
maintainable code.  These scripts are designed to make your code easier for 
real people to review and maintain.

As for if this can be faster we don't deal in the realm of "can".  Please 
show a concrete example of gcc making Linux kernel code faster with 
multiple assignments per line.  If you can do that I'm willing to change my 
mind and I'll lead the charge for mutliple assignments per line.




\
 
 \ /
  Last update: 2008-01-28 07:05    [from the cache]
©2003-2008