linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Ben Greear" <greearb@candelatech.com>,
	"Bjørn Mork" <bjorn@mork.no>,
	linux-wireless@vger.kernel.org,
	"Ben Hutchings" <bhutchings@solarflare.com>
Subject: Re: [PATCH repost] net,wireless: check against default_ethtool_ops
Date: Mon, 7 Jan 2013 12:57:18 +0100	[thread overview]
Message-ID: <20130107115718.GC1587@minipsycho.orion> (raw)
In-Reply-To: <20130107112012.GE6931@redhat.com>

Mon, Jan 07, 2013 at 12:20:12PM CET, sgruszka@redhat.com wrote:
>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?

Someone would possibly like to do:

dev->netdev_ops = &default_ethtool_ops

in drivers for example...

+ I just do not think that exporting structs is the correct way in order
to do anything.

>
>Stanislaw

  reply	other threads:[~2013-01-07 11:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07  9:55 [PATCH repost] net,wireless: check against default_ethtool_ops Stanislaw Gruszka
2013-01-07 10:23 ` Jiri Pirko
2013-01-07 10:44   ` Stanislaw Gruszka
2013-01-07 11:11     ` Jiri Pirko
2013-01-07 11:20       ` Stanislaw Gruszka
2013-01-07 11:57         ` Jiri Pirko [this message]
2013-01-07 17:20 ` Michał Mirosław

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130107115718.GC1587@minipsycho.orion \
    --to=jiri@resnulli.us \
    --cc=bhutchings@solarflare.com \
    --cc=bjorn@mork.no \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=greearb@candelatech.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sgruszka@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).