netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Yuval Shaia <yuval.shaia@oracle.com>,
	Leon Romanovsky <leon@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Xin Long <lucien.xin@gmail.com>,
	Alexander Aring <alex.aring@gmail.com>,
	Ying Xue <ying.xue@windriver.com>,
	Sven Eckelmann <sven@narfation.org>,
	Fernando Gont <fgont@si6networks.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next 11/11] ipv6: fix type mismatch warning
Date: Mon, 26 Oct 2020 22:29:58 +0100	[thread overview]
Message-ID: <20201026213040.3889546-11-arnd@kernel.org> (raw)
In-Reply-To: <20201026213040.3889546-1-arnd@kernel.org>

From: Arnd Bergmann <arnd@arndb.de>

Building with 'make W=2' shows a warning for every time this header
gets included because of a pointer type mismatch:

net/addrconf.h:163:32: warning: passing 'unsigned char *' to parameter of type 'const char *' converts between pointers to integer
types with different sign [-Wpointer-sign]
        addrconf_addr_eui48_base(eui, dev->dev_addr);

Change the type to unsigned according to the input argument.

Fixes: 4d6f28591fe4 ("{net,IB}/{rxe,usnic}: Utilize generic mac to eui32 function")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/net/addrconf.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 18f783dcd55f..074ce761e482 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -127,7 +127,8 @@ int addrconf_prefix_rcv_add_addr(struct net *net, struct net_device *dev,
 				 u32 addr_flags, bool sllao, bool tokenized,
 				 __u32 valid_lft, u32 prefered_lft);
 
-static inline void addrconf_addr_eui48_base(u8 *eui, const char *const addr)
+static inline void addrconf_addr_eui48_base(u8 *eui,
+					    const unsigned char *const addr)
 {
 	memcpy(eui, addr, 3);
 	eui[3] = 0xFF;
@@ -135,7 +136,7 @@ static inline void addrconf_addr_eui48_base(u8 *eui, const char *const addr)
 	memcpy(eui + 5, addr + 3, 3);
 }
 
-static inline void addrconf_addr_eui48(u8 *eui, const char *const addr)
+static inline void addrconf_addr_eui48(u8 *eui, const unsigned char *const addr)
 {
 	addrconf_addr_eui48_base(eui, addr);
 	eui[0] ^= 2;
-- 
2.27.0


  parent reply	other threads:[~2020-10-26 21:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 21:29 [PATCH net-next 01/11] atm: horizon: shut up clang null pointer arithmetic warning Arnd Bergmann
2020-10-26 21:29 ` [PATCH net-next 02/11] net: hostap: fix function cast warning Arnd Bergmann
2020-11-07 11:37   ` Kalle Valo
2020-10-26 21:29 ` [PATCH net-next 04/11] wimax: fix duplicate initializer warning Arnd Bergmann
2020-10-27  7:22   ` Johannes Berg
2020-10-27 11:51     ` Arnd Bergmann
2020-10-27 14:51       ` Perez-Gonzalez, Inaky
2020-10-26 21:29 ` [PATCH net-next 05/11] wimax/i2400m/control: fix enum warning Arnd Bergmann
2020-10-26 21:29 ` [PATCH net-next 06/11] rtlwifi: fix -Wpointer-sign warning Arnd Bergmann
2020-10-27  1:29   ` Pkshih
2020-10-26 21:29 ` [PATCH net-next 07/11] rtw88: remove extraneous 'const' qualifier Arnd Bergmann
2020-10-27  1:49   ` Nathan Chancellor
2020-10-26 21:29 ` [PATCH net-next 08/11] ath9k: work around false-positive gcc warning Arnd Bergmann
2020-11-02 16:26   ` Kalle Valo
2020-11-02 17:59     ` Johannes Berg
2020-11-02 22:29       ` Arnd Bergmann
2020-11-07 11:18       ` Kalle Valo
2020-11-07 11:36         ` Arnd Bergmann
2020-11-10 18:13   ` Kalle Valo
2020-10-26 21:29 ` [PATCH net-next 09/11] ath6kl: fix enum-conversion warning Arnd Bergmann
2020-10-27  6:15   ` Kalle Valo
2020-11-07  8:08   ` Kalle Valo
2020-10-26 21:29 ` [PATCH net-next 10/11] ch_ktls: " Arnd Bergmann
2020-10-26 21:42   ` Andrew Lunn
2020-10-26 21:29 ` Arnd Bergmann [this message]
2020-10-27  3:55 ` [PATCH net-next 01/11] atm: horizon: shut up clang null pointer arithmetic warning Xie He
2020-10-27  4:02   ` Xie He
2020-10-27 13:23     ` Arnd Bergmann
2020-10-27 21:46       ` Xie He
2020-10-28  0:42 ` Jakub Kicinski
2020-10-28  8:35   ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201026213040.3889546-11-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=alex.aring@gmail.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=fgont@si6networks.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=sven@narfation.org \
    --cc=xiyou.wangcong@gmail.com \
    --cc=ying.xue@windriver.com \
    --cc=yuval.shaia@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).