netdev
[Top] [All Lists]

[PATCH] replace sppp_of macro with inline

To: Jeff Garzik <jgarzik@xxxxxxxxx>
Subject: [PATCH] replace sppp_of macro with inline
From: Stephen Hemminger <shemminger@xxxxxxxx>
Date: Tue, 16 Sep 2003 16:55:37 -0700
Cc: netdev@xxxxxxxxxxx
Organization: Open Source Development Lab
Sender: netdev-bounce@xxxxxxxxxxx
Replace macro with inline and get some type checking.

diff -Nru a/include/net/syncppp.h b/include/net/syncppp.h
--- a/include/net/syncppp.h     Tue Sep 16 16:54:39 2003
+++ b/include/net/syncppp.h     Tue Sep 16 16:54:39 2003
@@ -57,8 +57,11 @@
        struct sppp sppp;       /* Synchronous PPP */
 };
 
-#define sppp_of(dev)   \
-           (&((struct ppp_device *)(*(unsigned long *)((dev)->priv)))->sppp)
+static inline struct sppp *sppp_of(struct net_device *dev) 
+{
+       struct ppp_device *ppp = dev->priv;
+       return &ppp->sppp;
+}
 
 #define PP_KEEPALIVE    0x01    /* use keepalive protocol */
 #define PP_CISCO        0x02    /* use Cisco protocol instead of PPP */

<Prev in Thread] Current Thread [Next in Thread>