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 17:39:19 +0300 Message-ID: <479C9797.6090300@gmail.com> References: <1201296027-6900-1-git-send-email-dmitri.vorobiev@gmail.com> <1201296027-6900-9-git-send-email-dmitri.vorobiev@gmail.com> <20080127140814.GA1916@does.not.exist> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Tigran Aivazian , linux-fsdevel@vger.kernel.org To: Adrian Bunk Return-path: Received: from fg-out-1718.google.com ([72.14.220.158]:62075 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753573AbYA0Oj2 (ORCPT ); Sun, 27 Jan 2008 09:39:28 -0500 Received: by fg-out-1718.google.com with SMTP id e21so1345748fga.17 for ; Sun, 27 Jan 2008 06:39:26 -0800 (PST) In-Reply-To: <20080127140814.GA1916@does.not.exist> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Adrian Bunk =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > On Sat, Jan 26, 2008 at 06:35:41PM +0000, Tigran Aivazian wrote: >> On Sat, 26 Jan 2008, Dmitri Vorobiev wrote: >>> - inode->i_mtime =3D inode->i_atime =3D inode->i_ctime =3D CURRENT_= TIME_SEC; >>> + inode->i_mtime =3D CURRENT_TIME_SEC; >>> + inode->i_atime =3D CURRENT_TIME_SEC; >>> + inode->i_ctime =3D CURRENT_TIME_SEC; >> multiple assignments like "x =3D y =3D z =3D value;" can potentially= (depending=20 >> on the compiler and arch) be faster than "x =3D value; y =3D value; = z=3Dvalue;" >=20 > Only depending on the compiler, and recent gcc versions are quite goo= d=20 > at optimizing code. >=20 >> I am surprized that this script complains about them as it is a perf= ectly=20 >> valid thing to do in C. >=20 > Checkpatch warns about the something already documented in=20 > Documentation/CodingStyle: >=20 > <-- snip --> >=20 > Don't put multiple assignments on a single line either. Kernel codin= g style > is super simple. Avoid tricky expressions. >=20 > <-- snip --> >=20 > Nobody claims it wasn't perfectly valid C code, the point is that=20 > multiple assignments on a single line are harder to read. Thanks for your explanation. So, it was just a matter of readability, not language lawyering. In fact, this is how I interpreted that complai= nt from the checkpatch.pl script. Dmitri - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html