From: Pavel Roskin Date: Wed, 29 Jun 2011 20:47:15 +0000 (-0400) Subject: Signed-off-by: Pavel Roskin X-Git-Tag: compat-2011-09-28~26 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=2204419d9ce529b16f22207810065e78b53b029e;p=~emulex%2Ftmp%2Fcompat%2F.git Signed-off-by: Pavel Roskin Debian backports netdev_name as a function. As we cannot test if a function is present, use an equivalent macro. Reported by Sivaraman V and Alex --- diff --git a/include/linux/compat-2.6.34.h b/include/linux/compat-2.6.34.h index 9743d6c..bada700 100644 --- a/include/linux/compat-2.6.34.h +++ b/include/linux/compat-2.6.34.h @@ -20,12 +20,11 @@ /* netdev_printk helpers, similar to dev_printk */ -static inline const char *netdev_name(const struct net_device *dev) -{ - if (dev->reg_state != NETREG_REGISTERED) - return "(unregistered net_device)"; - return dev->name; -} +#ifndef netdev_name +#define netdev_name(__dev) \ + ((__dev->reg_state != NETREG_REGISTERED) ? \ + "(unregistered net_device)" : __dev->name) +#endif #define netdev_printk(level, netdev, format, args...) \ dev_printk(level, (netdev)->dev.parent, \