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: 288088 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD1D6C388F9 for ; Mon, 26 Oct 2020 21:34:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82553216FD for ; Mon, 26 Oct 2020 21:34:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603748068; bh=nxOKKlKqMU4NDYkRtekhmwGMQw4/QJdTu+0OdBe0WDA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cMjlIqWeHFfSoovs61NiKTQbBwu7h4UaQOhGkUXQwNbSub2HseCc7Sq+3HXAsOGyQ DcJjxhJ5iM2DKYE+X3Te8A564CF52C6Utjf8Q9q5qLVnvZneT6280edo0lqVwwOZYC 49uzhTP7KCauYel4x3IZYqzoqHJdecUDTE3qgMFI= 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;