From f7a5b71dba24e99c230c9d0ded8e4f5e961b741b Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Fri, 20 Mar 2015 20:11:59 +0100 Subject: [PATCH] nd6: fixed compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nd6.c: In function ‘nd6_send_rs’: nd6.c:997:52: warning: suggest parentheses around ‘+’ inside ‘<<’ [-Wparentheses] p = pbuf_alloc(PBUF_IP, sizeof(struct rs_header) + lladdr_opt_len << 3, PBUF_RAM); ^ nd6.c:998:58: warning: suggest parentheses around ‘+’ inside ‘<<’ [-Wparentheses] if ((p == NULL) || (p->len < (sizeof(struct rs_header) + lladdr_opt_len << 3))) { --- src/core/ipv6/nd6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/ipv6/nd6.c b/src/core/ipv6/nd6.c index 01a3e557..8d699253 100644 --- a/src/core/ipv6/nd6.c +++ b/src/core/ipv6/nd6.c @@ -994,8 +994,8 @@ nd6_send_rs(struct netif * netif) if (src_addr != IP6_ADDR_ANY) { lladdr_opt_len = ((netif->hwaddr_len + 2) >> 3) + (((netif->hwaddr_len + 2) & 0x07) ? 1 : 0); } - p = pbuf_alloc(PBUF_IP, sizeof(struct rs_header) + lladdr_opt_len << 3, PBUF_RAM); - if ((p == NULL) || (p->len < (sizeof(struct rs_header) + lladdr_opt_len << 3))) { + p = pbuf_alloc(PBUF_IP, sizeof(struct rs_header) + (lladdr_opt_len << 3), PBUF_RAM); + if ((p == NULL) || (p->len < (sizeof(struct rs_header) + (lladdr_opt_len << 3)))) { /* We couldn't allocate a suitable pbuf for the ns. drop it. */ if (p != NULL) { pbuf_free(p);