Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754921AbdGVXRx convert rfc822-to-8bit (ORCPT ); Sat, 22 Jul 2017 19:17:53 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:32162 "EHLO lhrrgout.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751614AbdGVXRv (ORCPT ); Sat, 22 Jul 2017 19:17:51 -0400 From: Salil Mehta To: Andrew Lunn CC: "davem@davemloft.net" , "Zhuangyuzeng (Yisen)" , huangdaode , "lipeng (Y)" , "mehta.salil.lnk@gmail.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Linuxarm Subject: RE: [PATCH V3 net-next 1/8] net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC Thread-Topic: [PATCH V3 net-next 1/8] net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC Thread-Index: AQHS5461s+/MimzCYUeFu4O0uMj4xqIpNNYAgDd8uJA= Date: Sat, 22 Jul 2017 23:17:13 +0000 Message-ID: References: <20170617172431.177044-1-salil.mehta@huawei.com> <20170617172431.177044-2-salil.mehta@huawei.com> <20170617175418.GB1974@lunn.ch> In-Reply-To: <20170617175418.GB1974@lunn.ch> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.47.95.3] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.5973DD1D.0085,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=169.254.1.170, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 28387c9803e46e0440c7ef6f8b86306c Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1708 Lines: 60 Hi Andrew > -----Original Message----- > From: Andrew Lunn [mailto:andrew@lunn.ch] > Sent: Saturday, June 17, 2017 6:54 PM > To: Salil Mehta > Cc: davem@davemloft.net; Zhuangyuzeng (Yisen); huangdaode; lipeng (Y); > mehta.salil.lnk@gmail.com; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org; Linuxarm > Subject: Re: [PATCH V3 net-next 1/8] net: hns3: Add support of HNS3 > Ethernet Driver for hip08 SoC > > > +static int hns3_nic_net_up(struct net_device *ndev) > > +{ > > + struct hns3_nic_priv *priv = netdev_priv(ndev); > > + struct hnae3_handle *h = priv->ae_handle; > > + int i, j; > > + int ret; > > + > > + ret = hns3_nic_init_irq(priv); > > + if (ret != 0) { > > if (ret) > > No need to compare with zero. Sure, changed in V4 patch. Thanks Salil > > > + netdev_err(ndev, "hns init irq failed! ret=%d\n", ret); > > + return ret; > > > +static int hns3_nic_net_open(struct net_device *ndev) > > +{ > > + struct hns3_nic_priv *priv = netdev_priv(ndev); > > + struct hnae3_handle *h = priv->ae_handle; > > + int ret; > > + > > + netif_carrier_off(ndev); > > + > > + ret = netif_set_real_num_tx_queues(ndev, h->kinfo.num_tqps); > > + if (ret < 0) { > > + netdev_err(ndev, "netif_set_real_num_tx_queues fail, > ret=%d!\n", > > + ret); > > + return ret; > > + } > > In general, functions return 0 for success, and something else for an > error. So there is no need to do a comparison. Please remove all > comparisons, unless it is really needed. It also makes the code look > consistent. At the moment you sometime have < 0, sometime !=0, and > sometimes no comparison at all. Acknowledged, scanned and have changed in V4 patch. Please have a look. Thanks Salil > > Andrew