From: Stephen Hemminger <shemminger@osdl.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@oss.sgi.com
Subject: [PATCH] replace sppp_of macro with inline
Date: Tue, 16 Sep 2003 16:55:37 -0700 [thread overview]
Message-ID: <20030916165537.310229e6.shemminger@osdl.org> (raw)
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 */
next reply other threads:[~2003-09-16 23:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-16 23:55 Stephen Hemminger [this message]
2003-09-20 17:57 ` [PATCH] replace sppp_of macro with inline Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030916165537.310229e6.shemminger@osdl.org \
--to=shemminger@osdl.org \
--cc=jgarzik@pobox.com \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).