From 03f888c968541ea3002007b43c0366a3baafbabe Mon Sep 17 00:00:00 2001 From: fbernon Date: Sun, 16 Mar 2008 08:53:58 +0000 Subject: [PATCH] ppp: minor changes: fix some 'is unused' warning when debug is off. --- src/netif/ppp/auth.c | 26 ++++++++++++++++++++++++++ src/netif/ppp/chap.c | 6 ++++++ src/netif/ppp/fsm.c | 10 ++++++++++ src/netif/ppp/pap.c | 4 ++++ src/netif/ppp/ppp.c | 3 +++ src/netif/ppp/ppp.h | 2 +- src/netif/ppp/ppp_oe.c | 2 ++ 7 files changed, 52 insertions(+), 1 deletion(-) diff --git a/src/netif/ppp/auth.c b/src/netif/ppp/auth.c index a55e0f1d..4c0ee6a8 100644 --- a/src/netif/ppp/auth.c +++ b/src/netif/ppp/auth.c @@ -178,6 +178,8 @@ static int passwd_from_file; void link_required(int unit) { + LWIP_UNUSED_ARG(unit); + AUTHDEBUG((LOG_INFO, "link_required: %d\n", unit)); } @@ -322,6 +324,8 @@ link_established(int unit) void auth_peer_fail(int unit, u16_t protocol) { + LWIP_UNUSED_ARG(protocol); + AUTHDEBUG((LOG_INFO, "auth_peer_fail: %d proto=%X\n", unit, protocol)); /* * Authentication failure: take the link down @@ -378,6 +382,8 @@ auth_withpeer_fail(int unit, u16_t protocol) { int errCode = PPPERR_AUTHFAIL; + LWIP_UNUSED_ARG(protocol); + AUTHDEBUG((LOG_INFO, "auth_withpeer_fail: %d proto=%X\n", unit, protocol)); if (passwd_from_file) { BZERO(ppp_settings.passwd, MAXSECRETLEN); @@ -437,6 +443,9 @@ auth_withpeer_success(int unit, u16_t protocol) void np_up(int unit, u16_t proto) { + LWIP_UNUSED_ARG(unit); + LWIP_UNUSED_ARG(proto); + AUTHDEBUG((LOG_INFO, "np_up: %d proto=%X\n", unit, proto)); if (num_np_up == 0) { AUTHDEBUG((LOG_INFO, "np_up: maxconnect=%d idle_time_limit=%d\n",ppp_settings.maxconnect,ppp_settings.idle_time_limit)); @@ -464,6 +473,9 @@ np_up(int unit, u16_t proto) void np_down(int unit, u16_t proto) { + LWIP_UNUSED_ARG(unit); + LWIP_UNUSED_ARG(proto); + AUTHDEBUG((LOG_INFO, "np_down: %d proto=%X\n", unit, proto)); if (--num_np_up == 0 && ppp_settings.idle_time_limit > 0) { UNTIMEOUT(check_idle, NULL); @@ -476,6 +488,9 @@ np_down(int unit, u16_t proto) void np_finished(int unit, u16_t proto) { + LWIP_UNUSED_ARG(unit); + LWIP_UNUSED_ARG(proto); + AUTHDEBUG((LOG_INFO, "np_finished: %d proto=%X\n", unit, proto)); if (--num_np_open <= 0) { /* no further use for the link: shut up shop. */ @@ -526,6 +541,12 @@ int check_passwd( int unit, char *auser, int userlen, char *apasswd, int passwdlen, char **msg, int *msglen) { #if 1 + LWIP_UNUSED_ARG(unit); + LWIP_UNUSED_ARG(auser); + LWIP_UNUSED_ARG(userlen); + LWIP_UNUSED_ARG(apasswd); + LWIP_UNUSED_ARG(passwdlen); + LWIP_UNUSED_ARG(msglen); *msg = (char *) 0; return UPAP_AUTHACK; /* XXX Assume all entries OK. */ #else @@ -621,6 +642,10 @@ int get_secret( int unit, char *client, char *server, char *secret, int *secret_ int len; struct wordlist *addrs; + LWIP_UNUSED_ARG(unit); + LWIP_UNUSED_ARG(server); + LWIP_UNUSED_ARG(save_addrs); + addrs = NULL; if(!client || !client[0] || strcmp(client, ppp_settings.user)) { @@ -846,6 +871,7 @@ null_login(int unit) static int get_pap_passwd(int unit, char *user, char *passwd) { + LWIP_UNUSED_ARG(unit); /* normally we would reject PAP if no password is provided, but this causes problems with some providers (like CHT in Taiwan) who incorrectly request PAP and expect a bogus/empty password, so diff --git a/src/netif/ppp/chap.c b/src/netif/ppp/chap.c index d1b474fd..6d9c3c3c 100644 --- a/src/netif/ppp/chap.c +++ b/src/netif/ppp/chap.c @@ -638,6 +638,9 @@ ChapReceiveResponse(chap_state *cstate, u_char *inp, int id, int len) static void ChapReceiveSuccess(chap_state *cstate, u_char *inp, u_char id, int len) { + LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(inp); + CHAPDEBUG((LOG_INFO, "ChapReceiveSuccess: Rcvd id %d.\n", id)); if (cstate->clientstate == CHAPCS_OPEN) { @@ -672,6 +675,9 @@ ChapReceiveSuccess(chap_state *cstate, u_char *inp, u_char id, int len) static void ChapReceiveFailure(chap_state *cstate, u_char *inp, u_char id, int len) { + LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(inp); + CHAPDEBUG((LOG_INFO, "ChapReceiveFailure: Rcvd id %d.\n", id)); if (cstate->clientstate != CHAPCS_RESPONSE) { diff --git a/src/netif/ppp/fsm.c b/src/netif/ppp/fsm.c index 3db0b8ed..c073f1e3 100644 --- a/src/netif/ppp/fsm.c +++ b/src/netif/ppp/fsm.c @@ -148,6 +148,8 @@ fsm_lowerup(fsm *f) { int oldState = f->state; + LWIP_UNUSED_ARG(oldState); + switch( f->state ) { case LS_INITIAL: f->state = LS_CLOSED; @@ -183,6 +185,8 @@ fsm_lowerdown(fsm *f) { int oldState = f->state; + LWIP_UNUSED_ARG(oldState); + switch( f->state ) { case LS_CLOSED: f->state = LS_INITIAL; @@ -233,6 +237,8 @@ fsm_open(fsm *f) { int oldState = f->state; + LWIP_UNUSED_ARG(oldState); + switch( f->state ) { case LS_INITIAL: f->state = LS_STARTING; @@ -279,6 +285,8 @@ fsm_close(fsm *f, char *reason) { int oldState = f->state; + LWIP_UNUSED_ARG(oldState); + f->term_reason = reason; f->term_reason_len = (reason == NULL? 0: strlen(reason)); switch( f->state ) { @@ -747,6 +755,8 @@ fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len) static void fsm_rtermreq(fsm *f, int id, u_char *p, int len) { + LWIP_UNUSED_ARG(p); + FSMDEBUG((LOG_INFO, "fsm_rtermreq(%s): Rcvd id %d state=%d (%s)\n", PROTO_NAME(f), id, f->state, ppperr_strerr[f->state])); diff --git a/src/netif/ppp/pap.c b/src/netif/ppp/pap.c index 1b858c0b..b38abd1d 100644 --- a/src/netif/ppp/pap.c +++ b/src/netif/ppp/pap.c @@ -466,6 +466,8 @@ upap_rauthack(upap_state *u, u_char *inp, int id, int len) u_char msglen; char *msg; + LWIP_UNUSED_ARG(id); + UPAPDEBUG((LOG_INFO, "pap_rauthack: Rcvd id %d s=%d\n", id, u->us_clientstate)); if (u->us_clientstate != UPAPCS_AUTHREQ) { /* XXX */ @@ -503,6 +505,8 @@ upap_rauthnak(upap_state *u, u_char *inp, int id, int len) u_char msglen; char *msg; + LWIP_UNUSED_ARG(id); + UPAPDEBUG((LOG_INFO, "pap_rauthnak: Rcvd id %d s=%d\n", id, u->us_clientstate)); if (u->us_clientstate != UPAPCS_AUTHREQ) { /* XXX */ diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index b84ccbfa..a3817dad 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -590,6 +590,9 @@ int pppOverEthernetOpen(struct netif *ethif, const char *service_name, const cha PPPControl *pc; int pd; + LWIP_UNUSED_ARG(service_name); + LWIP_UNUSED_ARG(concentrator_name); + /* Find a free PPP session descriptor. Critical region? */ for (pd = 0; pd < NUM_PPP && pppControl[pd].openFlag != 0; pd++); if (pd >= NUM_PPP) { diff --git a/src/netif/ppp/ppp.h b/src/netif/ppp/ppp.h index 4db0f360..d5caa0a7 100644 --- a/src/netif/ppp/ppp.h +++ b/src/netif/ppp/ppp.h @@ -187,7 +187,7 @@ enum NPmode { } #define PUTSHORT(s, cp) { \ *(cp)++ = (u_char) ((s) >> 8); \ - *(cp)++ = (u_char) (s); \ + *(cp)++ = (u_char) (s & 0xff); \ } #define GETLONG(l, cp) { \ diff --git a/src/netif/ppp/ppp_oe.c b/src/netif/ppp/ppp_oe.c index 790a96e6..c34c529b 100644 --- a/src/netif/ppp/ppp_oe.c +++ b/src/netif/ppp/ppp_oe.c @@ -1201,6 +1201,8 @@ pppoe_ifattach_hook(void *arg, struct pbuf **mp, struct netif *ifp, int dir) static void pppoe_clear_softc(struct pppoe_softc *sc, const char *message) { + LWIP_UNUSED_ARG(message); + /* stop timer */ tcpip_untimeout(pppoe_timeout, sc); PPPDEBUG((LOG_DEBUG, "pppoe: %c%c%"U16_F": session 0x%x terminated, %s\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, sc->sc_session, message));