Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752866AbbDARLr (ORCPT ); Wed, 1 Apr 2015 13:11:47 -0400 Received: from smtprelay0042.hostedemail.com ([216.40.44.42]:53455 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752667AbbDARLo (ORCPT ); Wed, 1 Apr 2015 13:11:44 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:966:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2194:2196:2199:2200:2393:2559:2562:2828:2919:3138:3139:3140:3141:3142:3352:3622:3865:3866:3868:3871:3874:4321:4385:5007:6120:6261:7901:9108:10004:10400:10848:11026:11232:11657:11658:11914:12043:12296:12517:12519:12740:13019:13069:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: land67_2be41861ff933 X-Filterd-Recvd-Size: 2095 Message-ID: <1427908299.31790.51.camel@perches.com> Subject: Re: [PATCH RFC 06/10] dpaa_eth: add ethtool functionality From: Joe Perches To: madalin.bucur@freescale.com Cc: netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Date: Wed, 01 Apr 2015 10:11:39 -0700 In-Reply-To: <1427905196-27778-5-git-send-email-madalin.bucur@freescale.com> References: <1427905196-27778-1-git-send-email-madalin.bucur@freescale.com> <1427905196-27778-2-git-send-email-madalin.bucur@freescale.com> <1427905196-27778-3-git-send-email-madalin.bucur@freescale.com> <1427905196-27778-4-git-send-email-madalin.bucur@freescale.com> <1427905196-27778-5-git-send-email-madalin.bucur@freescale.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1192 Lines: 36 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/