Skip to contentSkip to conversation

ppp: make channel_ops const

PATCH Applied Stephen Hemminger 2 participants 2 messages Aug 4, 2010 – Aug 5, 2010

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppp: make channel_ops const

The PPP channel ops structure should be const. Cleanup the declarations to use standard C99 format.

---
 drivers/char/pcmcia/ipwireless/network.c |    2 +-
 drivers/net/ppp_async.c                  |    6 +++---
 drivers/net/ppp_synctty.c                |    6 +++---
 drivers/net/pppoe.c                      |    4 ++--
 include/linux/ppp_channel.h              |    2 +-
 net/atm/pppoatm.c                        |    2 +-
 net/irda/irnet/irnet_ppp.c               |    2 +-
 net/l2tp/l2tp_ppp.c                      |    5 ++++-
 8 files changed, 16 insertions(+), 13 deletions(-)
drivers/char/pcmcia/ipwireless/network.c +1 -1
@@ -239,7 +239,7 @@ static int ipwireless_ppp_ioctl(struct p
 	return err;
 }
 
-static struct ppp_channel_ops ipwireless_ppp_channel_ops = {
+static const struct ppp_channel_ops ipwireless_ppp_channel_ops = {
 	.start_xmit = ipwireless_ppp_start_xmit,
 	.ioctl      = ipwireless_ppp_ioctl
 };
drivers/net/ppp_async.c +3 -3
@@ -108,9 +108,9 @@ static void ppp_async_process(unsigned l
 static void async_lcp_peek(struct asyncppp *ap, unsigned char *data,
 			   int len, int inbound);
 
-static struct ppp_channel_ops async_ops = {
-	ppp_async_send,
-	ppp_async_ioctl
+static const struct ppp_channel_ops async_ops = {
+	.start_xmit = ppp_async_send,
+	.ioctl      = ppp_async_ioctl,
 };
 
 /*
drivers/net/ppp_synctty.c +3 -3
@@ -97,9 +97,9 @@ static void ppp_sync_flush_output(struct
 static void ppp_sync_input(struct syncppp *ap, const unsigned char *buf,
 			   char *flags, int count);
 
-static struct ppp_channel_ops sync_ops = {
-	ppp_sync_send,
-	ppp_sync_ioctl
+static const struct ppp_channel_ops sync_ops = {
+	.start_xmit = ppp_sync_send,
+	.ioctl      = ppp_sync_ioctl,
 };
 
 /*
drivers/net/pppoe.c +2 -2
@@ -92,7 +92,7 @@
 static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb);
 
 static const struct proto_ops pppoe_ops;
-static struct ppp_channel_ops pppoe_chan_ops;
+static const struct ppp_channel_ops pppoe_chan_ops;
 
 /* per-net private data for this module */
 static int pppoe_net_id __read_mostly;
@@ -963,7 +963,7 @@ static int pppoe_xmit(struct ppp_channel
 	return __pppoe_xmit(sk, skb);
 }
 
-static struct ppp_channel_ops pppoe_chan_ops = {
+static const struct ppp_channel_ops pppoe_chan_ops = {
 	.start_xmit = pppoe_xmit,
 };
 
include/linux/ppp_channel.h +1 -1
@@ -36,7 +36,7 @@ struct ppp_channel_ops {
 
 struct ppp_channel {
 	void		*private;	/* channel private data */
-	struct ppp_channel_ops *ops;	/* operations for this channel */
+	const struct ppp_channel_ops *ops; /* operations for this channel */
 	int		mtu;		/* max transmit packet size */
 	int		hdrlen;		/* amount of headroom channel needs */
 	void		*ppp;		/* opaque to channel */
net/atm/pppoatm.c +1 -1
@@ -260,7 +260,7 @@ static int pppoatm_devppp_ioctl(struct p
 	return -ENOTTY;
 }
 
-static /*const*/ struct ppp_channel_ops pppoatm_ops = {
+static const struct ppp_channel_ops pppoatm_ops = {
 	.start_xmit = pppoatm_send,
 	.ioctl = pppoatm_devppp_ioctl,
 };
net/irda/irnet/irnet_ppp.c +1 -1
@@ -20,7 +20,7 @@
 /* Please put other headers in irnet.h - Thanks */
 
 /* Generic PPP callbacks (to call us) */
-static struct ppp_channel_ops irnet_ppp_ops = {
+static const struct ppp_channel_ops irnet_ppp_ops = {
 	.start_xmit = ppp_irnet_send,
 	.ioctl = ppp_irnet_ioctl
 };
net/l2tp/l2tp_ppp.c +4 -1
@@ -135,7 +135,10 @@ struct pppol2tp_session {
 
 static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb);
 
-static struct ppp_channel_ops pppol2tp_chan_ops = { pppol2tp_xmit , NULL };
+static const struct ppp_channel_ops pppol2tp_chan_ops = {
+	.start_xmit =  pppol2tp_xmit,
+};
+
 static const struct proto_ops pppol2tp_ops;
 
 /* Helpers to obtain tunnel/session contexts from sockets.