Commit 70f5897b authored by Stephen Hemminger's avatar Stephen Hemminger

[PATCH] replace sppp_of macro with inline

Replace macro with inline and get some type checking.
parent e1153a5b
...@@ -57,8 +57,11 @@ struct ppp_device ...@@ -57,8 +57,11 @@ struct ppp_device
struct sppp sppp; /* Synchronous PPP */ struct sppp sppp; /* Synchronous PPP */
}; };
#define sppp_of(dev) \ static inline struct sppp *sppp_of(struct net_device *dev)
(&((struct ppp_device *)(*(unsigned long *)((dev)->priv)))->sppp) {
struct ppp_device *ppp = dev->priv;
return &ppp->sppp;
}
#define PP_KEEPALIVE 0x01 /* use keepalive protocol */ #define PP_KEEPALIVE 0x01 /* use keepalive protocol */
#define PP_CISCO 0x02 /* use Cisco protocol instead of PPP */ #define PP_CISCO 0x02 /* use Cisco protocol instead of PPP */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment