[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1445295842.7588.26.camel@LTIRV-MCHAN1.corp.ad.broadcom.com>
Date: Mon, 19 Oct 2015 16:04:02 -0700
From: Michael Chan <mchan@...adcom.com>
To: Stephen Hemminger <stephen@...workplumber.org>
CC: <davem@...emloft.net>, <prashant@...adcom.com>,
<eddie.wai@...adcom.com>, <huangjw@...adcom.com>,
<netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v3] bnxt_en: New Broadcom ethernet driver.
On Sun, 2015-10-18 at 22:19 -0700, Stephen Hemminger wrote:
> On Sat, 17 Oct 2015 00:21:44 -0400
> Michael Chan <mchan@...adcom.com> wrote:
>
> > +static bool bnxt_vf_pciid(int idx)
> > +{
> > + if (idx == BCM57304_VF || idx == BCM57404_VF)
> > + return true;
> > + return false;
> > +}
> > +
>
> I prefer just returning result of logical operation
> rather than adding unnecessary if statement.
> And never use (signed) int when unsigned is the real
> data type. Also avoid any unnecessary expansion of 16 bit
> value.
>
> static bool bnxt_vf_pciid(u16 idx)
> {
> return (idx == BCM57304_VF || idx == BCM57404_VF);
> }
idx is actually type enum. Other points well taken.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists