lkml.org 
[lkml]   [2015]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH RFC 06/10] dpaa_eth: add ethtool functionality
From
Date
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)

> +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

> + _errno = snprintf(drvinfo->version, sizeof(drvinfo->version),

Using errno here is especially misleading as that's
not the return value of an snprintf





\
 
 \ /
  Last update: 2015-04-01 19:41    [W:0.187 / U:3.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site