compat: use macro for netdev_name() to support Debian kernel 2.6.32-5
PATCH 1/1 compat: use macro for netdev_name() to support Debian kernel 2.6.32-5
Signed-off-by Pavel Roskin <[email protected]>
Debian backports netdev_name as a function. As we cannot test if a function is present, use an equivalent macro.
Reported by Sivaraman V <[email protected]> and Alex <[email protected]>
--- include/linux/compat-2.6.34.h | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-)
include/linux/compat-2.6.34.h +5 -6
@@ -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, \
Luis R. Rodriguez
AppliedQuoted 6 lines · Pavel Roskin
Signed-off-by Pavel Roskin <[email protected]>Debian backports
netdev_nameas a function. As we cannot test if a function is present, use an equivalent macro.Reported by Sivaraman V <[email protected]> and Alex <[email protected]>
Thanks applied and pushed.
LUis