Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753119AbbDCIyl (ORCPT ); Fri, 3 Apr 2015 04:54:41 -0400 Received: from mail-bl2on0126.outbound.protection.outlook.com ([65.55.169.126]:7982 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752353AbbDCIyj convert rfc822-to-8bit (ORCPT ); Fri, 3 Apr 2015 04:54:39 -0400 From: Madalin-Cristian Bucur To: Joe Perches CC: "netdev@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH RFC 06/10] dpaa_eth: add ethtool functionality Thread-Topic: Re: [PATCH RFC 06/10] dpaa_eth: add ethtool functionality Thread-Index: AdBt686dIcJArdUuRE+Fzvs82981vg== Date: Fri, 3 Apr 2015 08:54:36 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.88.166.1] authentication-results: perches.com; dkim=none (message not signed) header.d=none; x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB547; x-forefront-antispam-report: BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(43544003)(13464003)(377424004)(51704005)(24454002)(19580395003)(19580405001)(74316001)(54356999)(40100003)(2656002)(99286002)(46102003)(87936001)(77096005)(92566002)(102836002)(86362001)(2900100001)(77156002)(62966003)(76576001)(33656002)(50986999)(110136001)(66066001)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR03MB547;H:BL2PR03MB545.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5002010)(5005006);SRVR:BL2PR03MB547;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB547; x-forefront-prvs: 05352A48BE Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Apr 2015 08:54:36.7747 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB547 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1444 Lines: 45 > -----Original Message----- > From: Joe Perches [mailto:joe@perches.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 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/