Re: [PATCH] Re: WAN: new PPP code for generic HDLC

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Krzysztof Halasa <khc@...>
Cc: Jeff Garzik <jeff@...>, Andrew Morton <akpm@...>, <linux-kernel@...>, <netdev@...>
Date: Wednesday, March 12, 2008 - 3:38 pm

On Mar 12 2008 19:30, Krzysztof Halasa wrote:

What if skb->data happens to be unaligned (can that even happen?)

BTW, here are some consts:


diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c
index b626aae..0e4cb1f 100644
--- a/drivers/net/wan/hdlc_ppp.c
+++ b/drivers/net/wan/hdlc_ppp.c
@@ -40,7 +40,7 @@ enum {CP_CONF_REQ = 1, CP_CONF_ACK, CP_CONF_NAK, CP_CONF_REJ, CP_TERM_REQ,
       CP_TERM_ACK, CP_CODE_REJ, LCP_PROTO_REJ, LCP_ECHO_REQ, LCP_ECHO_REPLY,
       LCP_DISC_REQ, CP_CODES};
 #if DEBUG_CP
-static const char *code_names[CP_CODES] = {"0", "ConfReq", "ConfAck",
+static const char *const code_names[] = {"0", "ConfReq", "ConfAck",
 					   "ConfNak", "ConfRej", "TermReq",
 					   "TermAck", "CodeRej", "ProtoRej",
 					   "EchoReq", "EchoReply", "Discard"};
@@ -90,10 +90,10 @@ enum {INV = 0x10, IRC = 0x20, ZRC = 0x40, SCR = 0x80, SCA = 0x100,
       SCN = 0x200, STR = 0x400, STA = 0x800, SCJ = 0x1000};
 
 #if DEBUG_STATE
-static const char *state_names[STATES] = {"Closed", "Stopped", "Stopping",
+static const char *const state_names[] = {"Closed", "Stopped", "Stopping",
 					  "ReqSent", "AckRecv", "AckSent",
 					  "Opened"};
-static const char *event_names[EVENTS] = {"Start", "Stop", "TO+", "TO-",
+static const char *const event_names[] = {"Start", "Stop", "TO+", "TO-",
 					  "RCR+", "RCR-", "RCA", "RCN",
 					  "RTR", "RTA", "RUC", "RXJ+", "RXJ-"};
 #endif
@@ -374,7 +374,7 @@ static void ppp_cp_event(struct net_device *dev, u16 pid, u16 event, u8 code,
 static void ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id,
 			    unsigned int len, u8 *data)
 {
-	static u8 valid_accm[6] = { LCP_OPTION_ACCM, 6, 0, 0, 0, 0 };
+	static const u8 valid_accm[] = { LCP_OPTION_ACCM, 6, 0, 0, 0, 0 };
 	u8 *opt, *out;
 	unsigned int nak_len = 0, rej_len = 0;
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Wed Mar 12, 2:21 pm)
[PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Fri Mar 14, 10:20 am)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Tue Mar 25, 10:39 am)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Fri Apr 11, 5:35 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Andrew Morton, (Sat Apr 12, 1:14 am)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Sat Apr 12, 4:10 am)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Jeff Garzik, (Sat Apr 12, 4:50 am)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Sat Apr 12, 3:25 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Sat Apr 12, 4:19 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Fri Apr 18, 11:58 am)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, David Miller, (Fri Apr 18, 6:32 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Mon Apr 21, 11:30 am)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, James Chapman, (Mon Apr 21, 3:31 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Tue Apr 22, 3:06 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Paul Fulghum, (Tue Apr 22, 5:46 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, David Miller, (Tue Apr 22, 6:02 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Paul Fulghum, (Tue Apr 22, 7:52 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Jeff Garzik, (Tue Apr 22, 4:50 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, James Chapman, (Tue Apr 22, 6:23 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, David Miller, (Tue Apr 22, 6:51 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, David Miller, (Tue Apr 22, 6:05 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Wed Apr 23, 1:02 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, David Miller, (Wed Apr 23, 6:49 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Wed Apr 23, 8:48 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, David Miller, (Wed Apr 23, 9:08 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Thu Apr 24, 9:12 am)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, David Miller, (Thu Apr 24, 9:30 am)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Thu Apr 24, 9:39 am)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, David Miller, (Thu Apr 24, 9:55 am)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Thu Apr 24, 4:46 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, David Miller, (Mon May 12, 6:32 am)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Wed May 14, 12:17 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Wed May 14, 8:45 am)
[PATCH] WAN: protect HDLC proto list while insmod/rmmod, Krzysztof Halasa, (Mon May 19, 1:00 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Fri Apr 25, 7:10 am)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Thu Apr 24, 4:50 pm)
RE: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Waskiewicz Jr, Peter P, (Mon Apr 14, 3:16 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, David Miller, (Mon Apr 14, 5:09 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Jeff Garzik, (Tue Mar 25, 10:55 am)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Tue Mar 25, 11:50 am)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Wed Mar 26, 7:05 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, David Miller, (Tue Mar 25, 7:14 pm)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Wed Mar 26, 11:01 am)
Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC, Jeff Garzik, (Sat Apr 12, 5:12 am)
[PATCH] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Wed Mar 12, 2:30 pm)
Re: [PATCH] Re: WAN: new PPP code for generic HDLC, Jan Engelhardt, (Wed Mar 12, 3:38 pm)
Re: [PATCH] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Wed Mar 12, 4:10 pm)
Re: [PATCH] Re: WAN: new PPP code for generic HDLC, Jan Engelhardt, (Wed Mar 12, 6:12 pm)
Re: [PATCH] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Fri Mar 14, 10:16 am)
Re: [PATCH] Re: WAN: new PPP code for generic HDLC, Stephen Hemminger, (Wed Mar 12, 2:52 pm)
Re: [PATCH] Re: WAN: new PPP code for generic HDLC, Krzysztof Halasa, (Wed Mar 12, 3:25 pm)