linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] compat: use macro for netdev_name() to support Debian kernel 2.6.32-5
@ 2011-06-29 20:47 Pavel Roskin
  2011-06-30 20:11 ` Luis R. Rodriguez
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Roskin @ 2011-06-29 20:47 UTC (permalink / raw)
  To: Luis R. Rodriguez, linux-wireless

Signed-off-by: Pavel Roskin <proski@gnu.org>

Debian backports netdev_name as a function.  As we cannot test if a
function is present, use an equivalent macro.

Reported by Sivaraman V <krusna@gmail.com> and Alex <alex9434@gmail.com>
---
 include/linux/compat-2.6.34.h |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

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,			\

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] compat: use macro for netdev_name() to support Debian kernel 2.6.32-5
  2011-06-29 20:47 [PATCH] compat: use macro for netdev_name() to support Debian kernel 2.6.32-5 Pavel Roskin
@ 2011-06-30 20:11 ` Luis R. Rodriguez
  0 siblings, 0 replies; 2+ messages in thread
From: Luis R. Rodriguez @ 2011-06-30 20:11 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: linux-wireless

On Wed, Jun 29, 2011 at 3:47 PM, Pavel Roskin <proski@gnu.org> wrote:
> Signed-off-by: Pavel Roskin <proski@gnu.org>
>
> Debian backports netdev_name as a function.  As we cannot test if a
> function is present, use an equivalent macro.
>
> Reported by Sivaraman V <krusna@gmail.com> and Alex <alex9434@gmail.com>

Thanks applied and pushed.

 LUis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-30 20:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-29 20:47 [PATCH] compat: use macro for netdev_name() to support Debian kernel 2.6.32-5 Pavel Roskin
2011-06-30 20:11 ` Luis R. Rodriguez

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).