PPP, PPPoE: remove casts from unsigned (strlen return value) to signed

Those casts do not serve any purpose and can be safely removed.
This commit is contained in:
Sylvain Rochet 2020-10-16 17:17:40 +02:00
parent c385f31076
commit 678a7a4044

View File

@ -753,20 +753,20 @@ pppoe_send_padi(struct pppoe_softc *sc)
{ {
struct pbuf *pb; struct pbuf *pb;
u8_t *p; u8_t *p;
int len; size_t len;
#if PPPOE_SCNAME_SUPPORT #if PPPOE_SCNAME_SUPPORT
int l1 = 0, l2 = 0; /* XXX: gcc */ size_t l1 = 0, l2 = 0; /* XXX: gcc */
#endif /* PPPOE_SCNAME_SUPPORT */ #endif /* PPPOE_SCNAME_SUPPORT */
/* calculate length of frame (excluding ethernet header + pppoe header) */ /* calculate length of frame (excluding ethernet header + pppoe header) */
len = 2 + 2 + 2 + 2 + sizeof sc; /* service name tag is required, host unique is send too */ len = 2 + 2 + 2 + 2 + sizeof sc; /* service name tag is required, host unique is send too */
#if PPPOE_SCNAME_SUPPORT #if PPPOE_SCNAME_SUPPORT
if (sc->sc_service_name != NULL) { if (sc->sc_service_name != NULL) {
l1 = (int)strlen(sc->sc_service_name); l1 = strlen(sc->sc_service_name);
len += l1; len += l1;
} }
if (sc->sc_concentrator_name != NULL) { if (sc->sc_concentrator_name != NULL) {
l2 = (int)strlen(sc->sc_concentrator_name); l2 = strlen(sc->sc_concentrator_name);
len += 2 + 2 + l2; len += 2 + 2 + l2;
} }
#endif /* PPPOE_SCNAME_SUPPORT */ #endif /* PPPOE_SCNAME_SUPPORT */