> -----Original Message----- > From: netdev-ow...@vger.kernel.org <netdev-ow...@vger.kernel.org> On > Behalf Of Benjamin Poirier > Sent: Monday, June 24, 2019 1:22 PM > To: David Miller <da...@davemloft.net> > Cc: Manish Chopra <mani...@marvell.com>; GR-Linux-NIC-Dev <GR-Linux- > nic-...@marvell.com>; netdev@vger.kernel.org > Subject: Re: [PATCH net-next 10/16] qlge: Factor out duplicated expression > > On 2019/06/23 10:59, David Miller wrote: > > From: Benjamin Poirier <bpoir...@suse.com> > > Date: Mon, 17 Jun 2019 16:48:52 +0900 > > > > > Signed-off-by: Benjamin Poirier <bpoir...@suse.com> > > > --- > > > drivers/net/ethernet/qlogic/qlge/qlge.h | 6 ++++++ > > > drivers/net/ethernet/qlogic/qlge/qlge_main.c | 18 > > > ++++++------------ > > > 2 files changed, 12 insertions(+), 12 deletions(-) > > > > > > diff --git a/drivers/net/ethernet/qlogic/qlge/qlge.h > > > b/drivers/net/ethernet/qlogic/qlge/qlge.h > > > index 5a4b2520cd2a..0bb7ccdca6a7 100644 > > > --- a/drivers/net/ethernet/qlogic/qlge/qlge.h > > > +++ b/drivers/net/ethernet/qlogic/qlge/qlge.h > > > @@ -77,6 +77,12 @@ > > > #define LSD(x) ((u32)((u64)(x))) > > > #define MSD(x) ((u32)((((u64)(x)) >> 32))) > > > > > > +#define QLGE_FIT16(value) \ > > > +({ \ > > > + typeof(value) _value = value; \ > > > + (_value) == 65536 ? 0 : (u16)(_value); \ > > > +}) > > > + > > > > "(u16) 65536" is zero and the range of these values is 0 -- 65536. > > > > This whole expression is way overdone. > > Indeed, I missed that a simple cast is enough :/ > > What I inferred from the presence of that expression though is that in the > places where it is used, the device interprets a value of 0 as 65536. Manish, > can you confirm that? As David points out, the expression is useless. A > comment might not be however.
Yes, I think it could be simplified to simple cast just.