From 2aabe161639c7e166bb40240f9cb207ff714146a Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Wed, 25 Feb 2015 22:04:58 +0100 Subject: [PATCH] PPP, PPPoS, removed ppp_accm_mask[], saved a few bytes of ROM This was a pretty naive way of doing a bitshift, code is smaller if we let the compiler decide. --- src/netif/ppp/pppos.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/netif/ppp/pppos.c b/src/netif/ppp/pppos.c index 50aed3b8..4b857b0f 100644 --- a/src/netif/ppp/pppos.c +++ b/src/netif/ppp/pppos.c @@ -97,8 +97,7 @@ static const struct link_callbacks pppos_callbacks = { /* PPP's Asynchronous-Control-Character-Map. The mask array is used * to select the specific bit for a character. */ -static const u_char ppp_accm_mask[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; -#define ESCAPE_P(accm, c) ((accm)[(c) >> 3] & ppp_accm_mask[c & 0x07]) +#define ESCAPE_P(accm, c) ((accm)[(c) >> 3] & 1 << (c & 0x07)) #if PPP_FCS_TABLE /*