From patchwork Mon Oct 26 21:29:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 1388124 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=GxqbmCRI; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CKp505BZtz9sTq for ; Tue, 27 Oct 2020 08:34:28 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389518AbgJZVe0 (ORCPT ); Mon, 26 Oct 2020 17:34:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:45104 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389407AbgJZVeZ (ORCPT ); Mon, 26 Oct 2020 17:34:25 -0400 Received: from localhost.localdomain (unknown [192.30.34.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ABA92207C4; Mon, 26 Oct 2020 21:34:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603748065; bh=nxOKKlKqMU4NDYkRtekhmwGMQw4/QJdTu+0OdBe0WDA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GxqbmCRIF+lLlTKSGb59T+3H/HmmR5SxAgB4Zivqnprwxke/yqr6jU5OpwPiPTpyE AVjYwd32xXkfHh3tLYnKMcvGEDQ8yVnoxKNQL041KXg1Zk51BpD0cJaUQ1RDr143Vu t3BIaPRSPSg/BvFGHAYwnJ5MABs99c9msl/xBrag= From: Arnd Bergmann To: "David S. Miller" , Jakub Kicinski , Yuval Shaia , Leon Romanovsky Cc: Arnd Bergmann , Xin Long , Alexander Aring , Ying Xue , Sven Eckelmann , Fernando Gont , Cong Wang , 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 Message-Id: <20201026213040.3889546-11-arnd@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201026213040.3889546-1-arnd@kernel.org> References: <20201026213040.3889546-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Arnd Bergmann 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 --- 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;