diff mbox

netdevice: Kill 'feature' test macros.

Message ID 20110712.105005.34046159802896038.davem@davemloft.net
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

David Miller July 12, 2011, 5:50 p.m. UTC
Almost all of these have long outstayed their welcome.

And for every one of these macros, there are 10 features for which we
didn't get macros added.

Let's just delete them all, and get out of habit of doing things this
way.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 include/linux/netdevice.h |   12 ------------
 1 files changed, 0 insertions(+), 12 deletions(-)

Comments

stephen hemminger July 12, 2011, 6:10 p.m. UTC | #1
On Tue, 12 Jul 2011 10:50:05 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:

> 
> Almost all of these have long outstayed their welcome.
> 
> And for every one of these macros, there are 10 features for which we
> didn't get macros added.
> 
> Let's just delete them all, and get out of habit of doing things this
> way.
> 
> Signed-off-by: David S. Miller <davem@davemloft.net>

Acked-by: Stephen Hemminger <shemminger@vyatta.com>

This is sure to break out of tree drivers...
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arnd Bergmann July 12, 2011, 7:06 p.m. UTC | #2
On Tuesday 12 July 2011 20:10:33 Stephen Hemminger wrote:
> On Tue, 12 Jul 2011 10:50:05 -0700 (PDT)
> David Miller <davem@davemloft.net> wrote:
> 
> > 
> > Almost all of these have long outstayed their welcome.
> > 
> > And for every one of these macros, there are 10 features for which we
> > didn't get macros added.
> > 
> > Let's just delete them all, and get out of habit of doing things this
> > way.
> > 
> > Signed-off-by: David S. Miller <davem@davemloft.net>
> 
> Acked-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> This is sure to break out of tree drivers...

I guess that's a good thing, but it also breaks these:

drivers/staging/wlags49_h2/wl_internal.h:#ifdef HAVE_NETDEV_PRIV
drivers/net/cxgb4vf/cxgb4vf_main.c:#ifdef HAVE_NET_DEVICE_OPS
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:#ifdef HAVE_NET_DEVICE_OPS
net/batman-adv/soft-interface.c:#ifdef HAVE_NET_DEVICE_OPS

Acked-by: Arnd Bergmann <arnd@arndb.de>

if the above are taken care of.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Randy.Dunlap July 12, 2011, 7:09 p.m. UTC | #3
On Tue, 12 Jul 2011 21:06:21 +0200 Arnd Bergmann wrote:

> On Tuesday 12 July 2011 20:10:33 Stephen Hemminger wrote:
> > On Tue, 12 Jul 2011 10:50:05 -0700 (PDT)
> > David Miller <davem@davemloft.net> wrote:
> > 
> > > 
> > > Almost all of these have long outstayed their welcome.
> > > 
> > > And for every one of these macros, there are 10 features for which we
> > > didn't get macros added.
> > > 
> > > Let's just delete them all, and get out of habit of doing things this
> > > way.
> > > 
> > > Signed-off-by: David S. Miller <davem@davemloft.net>
> > 
> > Acked-by: Stephen Hemminger <shemminger@vyatta.com>
> > 
> > This is sure to break out of tree drivers...
> 
> I guess that's a good thing, but it also breaks these:
> 
> drivers/staging/wlags49_h2/wl_internal.h:#ifdef HAVE_NETDEV_PRIV
> drivers/net/cxgb4vf/cxgb4vf_main.c:#ifdef HAVE_NET_DEVICE_OPS
> drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:#ifdef HAVE_NET_DEVICE_OPS
> net/batman-adv/soft-interface.c:#ifdef HAVE_NET_DEVICE_OPS

Really?  I thought it would only break:

#if UNKNOWN_SYMBOL
but not
#ifdef UNKNOWN_SYMBOL


> Acked-by: Arnd Bergmann <arnd@arndb.de>
> 
> if the above are taken care of.


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arnd Bergmann July 12, 2011, 7:11 p.m. UTC | #4
On Tuesday 12 July 2011 21:09:23 Randy Dunlap wrote:
> > 
> > I guess that's a good thing, but it also breaks these:
> > 
> > drivers/staging/wlags49_h2/wl_internal.h:#ifdef HAVE_NETDEV_PRIV
> > drivers/net/cxgb4vf/cxgb4vf_main.c:#ifdef HAVE_NET_DEVICE_OPS
> > drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:#ifdef HAVE_NET_DEVICE_OPS
> > net/batman-adv/soft-interface.c:#ifdef HAVE_NET_DEVICE_OPS
> 
> Really?  I thought it would only break:
> 
> #if UNKNOWN_SYMBOL
> but not
> #ifdef UNKNOWN_SYMBOL

The point is that the drivers expect the symbol to be defined, e.g.

#ifdef HAVE_NETDEV_PRIV
#define wl_priv(dev) ((struct wl_private *) netdev_priv(dev))
#else
extern inline struct wl_private *wl_priv(struct net_device *dev)
{
    return dev->priv;
}
#endif

With current Linux versions, the first one is correct, the second one
is wrong, and removing the symbol changes which one is used.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller July 12, 2011, 7:18 p.m. UTC | #5
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 12 Jul 2011 21:06:21 +0200

> On Tuesday 12 July 2011 20:10:33 Stephen Hemminger wrote:
>> On Tue, 12 Jul 2011 10:50:05 -0700 (PDT)
>> David Miller <davem@davemloft.net> wrote:
>> 
>> > 
>> > Almost all of these have long outstayed their welcome.
>> > 
>> > And for every one of these macros, there are 10 features for which we
>> > didn't get macros added.
>> > 
>> > Let's just delete them all, and get out of habit of doing things this
>> > way.
>> > 
>> > Signed-off-by: David S. Miller <davem@davemloft.net>
>> 
>> Acked-by: Stephen Hemminger <shemminger@vyatta.com>
>> 
>> This is sure to break out of tree drivers...
> 
> I guess that's a good thing, but it also breaks these:
> 
> drivers/staging/wlags49_h2/wl_internal.h:#ifdef HAVE_NETDEV_PRIV
> drivers/net/cxgb4vf/cxgb4vf_main.c:#ifdef HAVE_NET_DEVICE_OPS
> drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:#ifdef HAVE_NET_DEVICE_OPS
> net/batman-adv/soft-interface.c:#ifdef HAVE_NET_DEVICE_OPS
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> 
> if the above are taken care of.

Thanks for catching this Arnd.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 011eb89..30f17e4 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -60,11 +60,6 @@  struct wireless_dev;
 #define SET_ETHTOOL_OPS(netdev,ops) \
 	( (netdev)->ethtool_ops = (ops) )
 
-#define HAVE_ALLOC_NETDEV		/* feature macro: alloc_xxxdev
-					   functions are available. */
-#define HAVE_FREE_NETDEV		/* free_netdev() */
-#define HAVE_NETDEV_PRIV		/* netdev_priv() */
-
 /* hardware address assignment types */
 #define NET_ADDR_PERM		0	/* address is permanent (default) */
 #define NET_ADDR_RANDOM		1	/* address is generated randomly */
@@ -313,7 +308,6 @@  struct header_ops {
 			   const void *saddr, unsigned len);
 	int	(*parse)(const struct sk_buff *skb, unsigned char *haddr);
 	int	(*rebuild)(struct sk_buff *skb);
-#define HAVE_HEADER_CACHE
 	int	(*cache)(const struct neighbour *neigh, struct hh_cache *hh);
 	void	(*cache_update)(struct hh_cache *hh,
 				const struct net_device *dev,
@@ -887,7 +881,6 @@  struct netdev_tc_txq {
  *	Must return >0 or -errno if it changed dev->features itself.
  *
  */
-#define HAVE_NET_DEVICE_OPS
 struct net_device_ops {
 	int			(*ndo_init)(struct net_device *dev);
 	void			(*ndo_uninit)(struct net_device *dev);
@@ -1781,8 +1774,6 @@  static inline void input_queue_tail_incr_save(struct softnet_data *sd,
 
 DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);
 
-#define HAVE_NETIF_QUEUE
-
 extern void __netif_schedule(struct Qdisc *q);
 
 static inline void netif_schedule_queue(struct netdev_queue *txq)
@@ -2058,10 +2049,8 @@  extern void dev_kfree_skb_irq(struct sk_buff *skb);
  */
 extern void dev_kfree_skb_any(struct sk_buff *skb);
 
-#define HAVE_NETIF_RX 1
 extern int		netif_rx(struct sk_buff *skb);
 extern int		netif_rx_ni(struct sk_buff *skb);
-#define HAVE_NETIF_RECEIVE_SKB 1
 extern int		netif_receive_skb(struct sk_buff *skb);
 extern gro_result_t	dev_gro_receive(struct napi_struct *napi,
 					struct sk_buff *skb);
@@ -2241,7 +2230,6 @@  extern void netif_device_attach(struct net_device *dev);
 /*
  * Network interface message level settings
  */
-#define HAVE_NETIF_MSG 1
 
 enum {
 	NETIF_MSG_DRV		= 0x0001,