From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933548AbdKCOL0 (ORCPT ); Fri, 3 Nov 2017 10:11:26 -0400 Received: from smtprelay0114.hostedemail.com ([216.40.44.114]:39124 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751676AbdKCOLZ (ORCPT ); Fri, 3 Nov 2017 10:11:25 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:968:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1381:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3871:3872:4321:4605:5007:6117:6119:7903:10004:10400:10848:11026:11232:11658:11914:12043:12048:12296:12438:12740:12760:12895:13069:13160:13229:13311:13357:13439:14096:14097:14181:14659:14721:21080:21433:21627:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: form56_2938e3c647e1a X-Filterd-Recvd-Size: 2844 Message-ID: <1509718281.15520.11.camel@perches.com> Subject: Re: [PATCH net-next 4/5] net: dsa: lan9303: Remove unnecessary parentheses From: Joe Perches To: Egil Hjelmeland , andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 03 Nov 2017 07:11:21 -0700 In-Reply-To: <20171103105553.16859-5-privat@egil-hjelmeland.no> References: <20171103105553.16859-1-privat@egil-hjelmeland.no> <20171103105553.16859-5-privat@egil-hjelmeland.no> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2017-11-03 at 11:55 +0100, Egil Hjelmeland wrote: > Remove scripts/checkpatch.pl CHECKs by remove unnecessary parentheses [] > diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c [] > @@ -483,7 +483,7 @@ static int lan9303_detect_phy_setup(struct lan9303 *chip) > return reg; > } > > - if ((reg != 0) && (reg != 0xffff)) > + if (reg != 0 && reg != 0xffff) > chip->phy_addr_sel_strap = 1; > else > chip->phy_addr_sel_strap = 0; phy_addr_sel_strap is currently bool. If this is to be changed, it should be set true or false. My preference would be: chip->phy_addr_sel_strap = (reg != 0 && reg != 0xffff); But perhaps its bool type should be converted to int as this phy_addr_sel_strap is used as int several times. $ git grep phy_addr_sel_strap drivers/net/dsa/lan9303-core.c: /* depending on the 'phy_addr_sel_strap' setting, the three phys are drivers/net/dsa/lan9303-core.c: * 'phy_addr_sel_strap' setting directly, so we need a test, which drivers/net/dsa/lan9303-core.c: * Special reg 18 of phy 3 reads as 0x0000, if 'phy_addr_sel_strap' is 0 drivers/net/dsa/lan9303-core.c: * 0x0000, which means 'phy_addr_sel_strap' is 1 and the IDs are 1-2-3. drivers/net/dsa/lan9303-core.c: chip->phy_addr_sel_strap = 1; drivers/net/dsa/lan9303-core.c: chip->phy_addr_sel_strap = 0; drivers/net/dsa/lan9303-core.c: chip->phy_addr_sel_strap ? "1-2-3" : "0-1-2"); drivers/net/dsa/lan9303-core.c: int phy_base = chip->phy_addr_sel_strap; drivers/net/dsa/lan9303-core.c: int phy_base = chip->phy_addr_sel_strap; drivers/net/dsa/lan9303-core.c: if (port == chip->phy_addr_sel_strap) { drivers/net/dsa/lan9303-core.c: lan9303_phy_write(ds, chip->phy_addr_sel_strap + port, drivers/net/dsa/lan9303-core.c: chip->ds->phys_mii_mask = chip->phy_addr_sel_strap ? 0xe : 0x7; include/linux/dsa/lan9303.h: bool phy_addr_sel_strap;