From: Joel Schopp Subject: Re: [PATCH v2 8/9] bfs: remove multiple assignments Date: Mon, 28 Jan 2008 01:02:03 -0600 Message-ID: <479D7DEB.7070806@austin.ibm.com> References: <1201296027-6900-1-git-send-email-dmitri.vorobiev@gmail.com> <1201296027-6900-9-git-send-email-dmitri.vorobiev@gmail.com> <479BC6E5.5000409@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Tigran Aivazian , trivial@kernel.org, linux-fsdevel@vger.kernel.org, apw@shadowen.org, rdunlap@xenotime.net, Linux-kernel To: Dmitri Vorobiev Return-path: Received: from e33.co.us.ibm.com ([32.97.110.151]:43543 "EHLO e33.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750802AbYA1HBr (ORCPT ); Mon, 28 Jan 2008 02:01:47 -0500 In-Reply-To: <479BC6E5.5000409@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: >>> - 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.