diff options
author | Changli Gao <xiaosuo@gmail.com> | 2011-01-06 08:37:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-10 19:13:33 -0500 |
commit | 96545aeb7b4457594d764af4d689a738e97f14b8 (patch) | |
tree | f916a4b5e95a336db645ab725a4301cc0d71001a /drivers/net/ppp_mppe.c | |
parent | d7b92affba524e0ca848a5ab60649fb91190d9b5 (diff) |
net: ppp: use {get,put}_unaligned_be{16,32}
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Reviewed-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ppp_mppe.c')
-rw-r--r-- | drivers/net/ppp_mppe.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/ppp_mppe.c b/drivers/net/ppp_mppe.c index 6d1a1b80cc3..9a1849a83e2 100644 --- a/drivers/net/ppp_mppe.c +++ b/drivers/net/ppp_mppe.c | |||
@@ -55,6 +55,7 @@ | |||
55 | #include <linux/ppp_defs.h> | 55 | #include <linux/ppp_defs.h> |
56 | #include <linux/ppp-comp.h> | 56 | #include <linux/ppp-comp.h> |
57 | #include <linux/scatterlist.h> | 57 | #include <linux/scatterlist.h> |
58 | #include <asm/unaligned.h> | ||
58 | 59 | ||
59 | #include "ppp_mppe.h" | 60 | #include "ppp_mppe.h" |
60 | 61 | ||
@@ -395,16 +396,14 @@ mppe_compress(void *arg, unsigned char *ibuf, unsigned char *obuf, | |||
395 | */ | 396 | */ |
396 | obuf[0] = PPP_ADDRESS(ibuf); | 397 | obuf[0] = PPP_ADDRESS(ibuf); |
397 | obuf[1] = PPP_CONTROL(ibuf); | 398 | obuf[1] = PPP_CONTROL(ibuf); |
398 | obuf[2] = PPP_COMP >> 8; /* isize + MPPE_OVHD + 1 */ | 399 | put_unaligned_be16(PPP_COMP, obuf + 2); |
399 | obuf[3] = PPP_COMP; /* isize + MPPE_OVHD + 2 */ | ||
400 | obuf += PPP_HDRLEN; | 400 | obuf += PPP_HDRLEN; |
401 | 401 | ||
402 | state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; | 402 | state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; |
403 | if (state->debug >= 7) | 403 | if (state->debug >= 7) |
404 | printk(KERN_DEBUG "mppe_compress[%d]: ccount %d\n", state->unit, | 404 | printk(KERN_DEBUG "mppe_compress[%d]: ccount %d\n", state->unit, |
405 | state->ccount); | 405 | state->ccount); |
406 | obuf[0] = state->ccount >> 8; | 406 | put_unaligned_be16(state->ccount, obuf); |
407 | obuf[1] = state->ccount & 0xff; | ||
408 | 407 | ||
409 | if (!state->stateful || /* stateless mode */ | 408 | if (!state->stateful || /* stateless mode */ |
410 | ((state->ccount & 0xff) == 0xff) || /* "flag" packet */ | 409 | ((state->ccount & 0xff) == 0xff) || /* "flag" packet */ |