From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933161AbXDFVul (ORCPT ); Fri, 6 Apr 2007 17:50:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933165AbXDFVuk (ORCPT ); Fri, 6 Apr 2007 17:50:40 -0400 Received: from threatwall.zlynx.org ([199.45.143.218]:33427 "EHLO zlynx.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933161AbXDFVuj (ORCPT ); Fri, 6 Apr 2007 17:50:39 -0400 Subject: Re: coding style for long conditions From: Zan Lynx To: Roland Dreier Cc: David Brownell , Stefan Richter , Jan Engelhardt , Randy Dunlap , Tony Lindgren , linux-kernel@vger.kernel.org In-Reply-To: References: <11757099691323-git-send-email-tony@atomide.com> <200704061029.55710.david-b@pacbell.net> <46169968.2050006@s5r6.in-berlin.de> <200704061405.50169.david-b@pacbell.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-H+bQrWz4h4BnrWPT2j1g" Date: Fri, 06 Apr 2007 21:50:23 +0000 Message-Id: <1175896223.6644.26.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.10.0 X-Envelope-From: zlynx@acm.org Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org --=-H+bQrWz4h4BnrWPT2j1g Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, 2007-04-06 at 14:38 -0700, Roland Dreier wrote: [snip] > If you have a git tree handy, you can do "git show 68380b58" and see > that Linus himself wrote: >=20 > if (get_wq_data(work) =3D=3D cwq > && work_pending(work) > && !list_empty(&work->entry)) { >=20 > I have to admit that I would have put the &&s at the ends of the > previous lines rather than where Linus put them, but... egads! Linus > put spaces before the &&s to line them up nicely! My favorite form uses only tabs and would make that look like: if( get_wq_data(work) =3D=3D cwq && work_pending(work) && !list_empty(&work->entry) ) { ... ... } Putting the && at the front would be OK with me too, it does make them more obvious and easier to find. I don't find too many people who like my style but that's OK. I think it makes everything a lot easier to read and everything lines up with 8-space tabs or 2 or 3 space tabs. Plus, reformatting other people's code gives me a good chance to read it as I go. :-) --=20 Zan Lynx --=-H+bQrWz4h4BnrWPT2j1g Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (GNU/Linux) iD8DBQBGFsCfG8fHaOLTWwgRAs3pAJ0X6pL6XG/GVYYUMWtDL+O7iV/w3wCePeVY isxzRI287/n6ON8Z94OlKg8= =B70v -----END PGP SIGNATURE----- --=-H+bQrWz4h4BnrWPT2j1g--