From: Jeff Garzik <jgarzik@pobox.com>
To: Matthew Wilcox <willy@debian.org>
Cc: netdev@oss.sgi.com
Subject: Re: [PATCH] ethtool_ops rev 4
Date: Sat, 02 Aug 2003 23:14:26 -0400 [thread overview]
Message-ID: <3F2C7E12.8070904@pobox.com> (raw)
In-Reply-To: <20030803002744.GF22222@parcelfarce.linux.theplanet.co.uk>
Matthew Wilcox wrote:
> On Sat, Aug 02, 2003 at 06:34:46PM -0400, Jeff Garzik wrote:
>
>>>diff -u include/linux/netdevice.h include/linux/netdevice.h
>>>--- include/linux/netdevice.h 31 Jul 2003 13:06:23 -0000
>>>+++ include/linux/netdevice.h 2 Aug 2003 18:37:16 -0000
>>>@@ -477,6 +477,10 @@
>>> */
>>>#define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev))
>>>
>>>+static inline void set_ethtool_ops(struct net_device *dev, struct
>>>ethtool_ops *
>>>ops)
>>>+{
>>>+ dev->ethtool_ops = ops;
>>>+}
>>
>>
>>It needs to be a macro for maximum flexibility.
>
>
> Nothing stops it being implemented as a macro in kcompat. Having it as
> an inline function gives it argument typechecking which always gives me
> the warm fuzzies.
No, it _needs_ to be a macro for maximum flexibility.
Most importantly, kcompat code may use '#ifndef SET_ETHTOOL_OPS' as a
trigger, to signal that compat code is needed. No need for drivers to
create tons of kernel-version-code ifdefs, just to test for when
ethtool_ops appeared in 2.6, for when it starts appearing in 2.4 vendor
backports, and (possibly) 2.4 itself. Also, doing it at the cpp level
allows compat code to #undef it, if it _really_ knows what its doing,
and the situation calls for it.
>>Also, no need to convert in-kernel drivers over to using it... Let
>>driver authors use it or not as they choose.
>
>
> I took "Like pci_set_drvdata" as the most important part of your
> argument... having everyone use it is no bad thing.
Certainly. I have no real preferences either way, just noting that
in-kernel drivers don't _need_ to use this macro.
Jeff
next prev parent reply other threads:[~2003-08-03 3:14 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-01 15:02 [PATCH] ethtool_ops rev 4 Matthew Wilcox
2003-08-01 15:40 ` Jeff Garzik
2003-08-01 15:46 ` Matthew Wilcox
2003-08-01 16:25 ` Jeff Garzik
2003-08-01 20:20 ` David S. Miller
2003-08-01 22:26 ` Jeff Garzik
2003-08-01 22:32 ` David S. Miller
2003-08-01 23:01 ` Jeff Garzik
2003-08-01 23:01 ` David S. Miller
2003-08-01 23:17 ` Jeff Garzik
2003-08-01 23:19 ` David S. Miller
2003-08-01 23:42 ` Jeff Garzik
2003-08-01 23:43 ` David S. Miller
2003-08-01 22:35 ` Jeff Garzik
2003-08-01 22:34 ` David S. Miller
2003-08-01 23:09 ` Jeff Garzik
2003-08-01 23:08 ` David S. Miller
2003-08-01 23:35 ` Jeff Garzik
2003-08-01 23:34 ` David S. Miller
2003-08-02 22:21 ` Matthew Wilcox
2003-08-02 22:34 ` Jeff Garzik
2003-08-03 0:27 ` Matthew Wilcox
2003-08-03 3:14 ` Jeff Garzik [this message]
2003-08-03 14:56 ` Matthew Wilcox
2003-08-03 17:09 ` Jeff Garzik
2003-08-05 14:32 ` Matthew Wilcox
2003-08-03 0:28 ` David S. Miller
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=3F2C7E12.8070904@pobox.com \
--to=jgarzik@pobox.com \
--cc=netdev@oss.sgi.com \
--cc=willy@debian.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.