[<prev] [next>] [day] [month] [year] [list]
Message-ID: <BL2PR03MB54597F6E69800CDAE4D31D0E6F10@BL2PR03MB545.namprd03.prod.outlook.com>
Date: Fri, 3 Apr 2015 08:54:36 +0000
From: Madalin-Cristian Bucur <madalin.bucur@...escale.com>
To: Joe Perches <joe@...ches.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RFC 06/10] dpaa_eth: add ethtool functionality
> -----Original Message-----
> From: Joe Perches [mailto:joe@...ches.com]
> On Wed, 2015-04-01 at 19:19 +0300, Madalin Bucur wrote:
> > Add support for basic ethtool operations.
>
> > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
> b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
> []
> > +static int __cold dpa_get_settings(struct net_device *net_dev,
> > + struct ethtool_cmd *et_cmd)
> > +{
> > + int _errno;
>
> Using a variable name of _errno is misleading at best,
> (btw: the only return value for phy_ethtool_gset is 0)
I'll rename all miss-used occurrences of _errno.
> > +static void __cold dpa_get_drvinfo(struct net_device *net_dev,
> > + struct ethtool_drvinfo *drvinfo)
> > +{
> > + int _errno;
> > +
> > + strncpy(drvinfo->driver, KBUILD_MODNAME,
> > + sizeof(drvinfo->driver) - 1)[sizeof(drvinfo->driver) - 1] = 0;
>
> That's a really odd and unusual construct
> more commonly written as strlcpy
I will change this.
> > + _errno = snprintf(drvinfo->version, sizeof(drvinfo->version),
>
> Using errno here is especially misleading as that's
> not the return value of an snprintf
I will take care of this one too.
Thank you,
Madalin
--
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