Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752377AbdLGV6I (ORCPT ); Thu, 7 Dec 2017 16:58:08 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:40513 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750993AbdLGV6H (ORCPT ); Thu, 7 Dec 2017 16:58:07 -0500 Date: Thu, 7 Dec 2017 22:57:50 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Bartosz Golaszewski Cc: Sven Van Asbroeck , Rob Herring , Mark Rutland , Wolfram Sang , nsekhar@ti.com, Sakari Ailus , David Lechner , Javier Martinez Canillas , Divagar Mohandass , devicetree@vger.kernel.org, Linux Kernel Mailing List , linux-i2c Subject: Re: [PATCH v5 1/2] at24: support eeproms that do not auto-rollover reads. Message-ID: <20171207215750.jzx6mqftx4poeep7@pengutronix.de> References: <1512657378-5221-1-git-send-email-svendev@arcx.com> <1512657378-5221-2-git-send-email-svendev@arcx.com> <20171207190230.ttq5xthgsuuy4swn@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1129 Lines: 38 On Thu, Dec 07, 2017 at 10:33:51PM +0100, Bartosz Golaszewski wrote: > 2017-12-07 20:02 GMT+01:00 Uwe Kleine-K?nig : > > Hello, > > > > On Thu, Dec 07, 2017 at 05:26:50PM +0100, Bartosz Golaszewski wrote: > >> > + if (at24->chip.flags & AT24_FLAG_NO_RDROL) { > >> > + bits = (at24->chip.flags & AT24_FLAG_ADDR16) ? 16 : 8; > >> > >> There's no need for braces around the ternary operator's condition. > > > > Even if not required, I'd keep them for clearity. > > > > I don't want to start bikeshedding, so I'll take it as it is, but I > prefer to avoid braces wherever it's not necessary. For me the reasoning is: Most people (me included) don't know off-hand if the semantic of a & b ? c : d is (a & b) ? c : d or a & (b ? c : d) In some situations (e.g. a & b == c) gcc even warns when you don't add syntactically needless parentheses. The case under discussion isn't such an example though. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |