Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44680 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753788Ab3AGLjH (ORCPT ); Mon, 7 Jan 2013 06:39:07 -0500 Date: Mon, 7 Jan 2013 12:20:12 +0100 From: Stanislaw Gruszka To: Jiri Pirko Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Ben Greear , =?iso-8859-1?Q?Bj=F8rn?= Mork , linux-wireless@vger.kernel.org, Ben Hutchings Subject: Re: [PATCH repost] net,wireless: check against default_ethtool_ops Message-ID: <20130107112012.GE6931@redhat.com> (sfid-20130107_123913_529098_CC369385) References: <20130107095548.GA6931@redhat.com> <20130107102307.GA1587@minipsycho.orion> <20130107104413.GB6931@redhat.com> <20130107111108.GB1587@minipsycho.orion> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20130107111108.GB1587@minipsycho.orion> Sender: linux-wireless-owner@vger.kernel.org List-ID: On Mon, Jan 07, 2013 at 12:11:08PM +0100, Jiri Pirko wrote: > Mon, Jan 07, 2013 at 11:44:14AM CET, sgruszka@redhat.com wrote: > >On Mon, Jan 07, 2013 at 11:23:07AM +0100, Jiri Pirko wrote: > >> >-static const struct ethtool_ops default_ethtool_ops; > >> >+const struct ethtool_ops default_ethtool_ops; > >> >+EXPORT_SYMBOL_GPL(default_ethtool_ops); > >> > >> I think that default_ethtool_ops should stay static. Wouldn't it be > >> nicer to introduce a helper like: > >> > >> bool dev_has_default_ethtool_ops(struct net_device *dev) > >> { > >> return dev->ethtool_ops == &default_ethtool_ops; > >> } > > > >Then I still have to export this function. So with your approch, number > >of exported symbols will be the same, but there will be few more lines > >of code. > > I think it's always better to add few more lines in order to prevent possible > confusion which exporting default_ethtool_ops might introduce... What possible confusion it might cause? Stanislaw