From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitri Vorobiev Subject: Re: [PATCH v2 8/9] bfs: remove multiple assignments Date: Sun, 27 Jan 2008 00:32:51 +0300 Message-ID: <479BA703.8080405@gmail.com> References: <1201296027-6900-1-git-send-email-dmitri.vorobiev@gmail.com> <1201296027-6900-9-git-send-email-dmitri.vorobiev@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: trivial@kernel.org, linux-fsdevel@vger.kernel.org To: Tigran Aivazian Return-path: Received: from fg-out-1718.google.com ([72.14.220.152]:63904 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753753AbYAZVdA (ORCPT ); Sat, 26 Jan 2008 16:33:00 -0500 Received: by fg-out-1718.google.com with SMTP id e21so1130157fga.17 for ; Sat, 26 Jan 2008 13:32:58 -0800 (PST) In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Tigran Aivazian wrote: > On Sat, 26 Jan 2008, Dmitri Vorobiev wrote: >> - 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. > Thanks for your comment. My goal was to make the driver "checkpatch.pl-clean", and that was the only reason for this change. I just assumed that what the script, which is recommended for use to check the kernel coding style, insists upon, gives an idea of what "the right way" is. >>From the viewpoint of code clarity, it seems to be a matter of personal opinion whether multiple assignments should be preferred over giving a separate line to each variable. I personally prefer separated assignments, but in this particular case I would never touch these lines had the script not complained about it. > But this is not a "big deal", so I don't mind. > OK. Let's wait for Adrian to pick up these patches and push these into his tree. Thanks, Dmitri