Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3369201pxf; Mon, 22 Mar 2021 05:01:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznS4hZ8eDNmKLhdrAkrMg3E7r24eNgP76z9NPPqchhM8CwJyPy4X0Zxr8iIeindxkU7cdd X-Received: by 2002:a17:906:358c:: with SMTP id o12mr19245228ejb.156.1616414466755; Mon, 22 Mar 2021 05:01:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616414466; cv=none; d=google.com; s=arc-20160816; b=Xpd8dAouztYApyLCPw3TQ4lgD1XQZdTs9nURCogCl7+VvNTqKxMCAC4/V8rDQ5KiBQ kYOB1YfKNdZ3iRPeMhXfTfy98CZr5sMJnpVZbd0xsDvJ3o2v2g14U5G+WBFSIdq0y3gn m8Gsyw1JEX7Y8LMqmVqa8yg3TGSPUmBzcl2Z6/fIJQpHpS9AuWBGd7q4SLsFQE3XIFmr mGeeuHZ2tXKrl0ePjIZJxtsjwM82jTqjjf3TJHEZyNtEtFCCt2vUPoL9imwxvtVmHOxE MfA7V+XuDDhKdjYMRz2eiyD7DrF2dRlh97JOVgDxPuNBWkk4VtgTPRkZIUh81oZU5lfR N9Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=O4NuxnsuDOaSu5xWju2J9OXq0YagHwawI2knejq7Xlg=; b=xxheOwK4rUz2T1cwhLwrBu+NaP47eyHtk4nR85325JH7vHB+Q+pf2ZBpdq2/rfBfWL nEpPFdP5EvBzf4oFc1WVr6+4GrtjWUJfMYU5EH3sbunnpgQFBJA8CIjCEioDFnPEQgJZ fcI08L54lL4+Ldo1H0dVAHC/n/BQDoy3+sOf0Ibwnz8Xz9z4IFNkuPNUoGStMz4fiikQ NMXwmTr2iAk0Z05MKgKUJ/H93C4+JWel6N3VpHrMuKfTSDY6KF3AOpkYArhzKsZS1dzx M1NyJM6TIFyUJPqnPC9juFuBeOsGYgzsI+YtHIRUUtoUCclKv02X9wtHOo1XEIHT7zqo EIEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q3EO4JwM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nd10si11499214ejc.600.2021.03.22.05.00.44; Mon, 22 Mar 2021 05:01:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q3EO4JwM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230319AbhCVL5d (ORCPT + 99 others); Mon, 22 Mar 2021 07:57:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:45968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230293AbhCVL5H (ORCPT ); Mon, 22 Mar 2021 07:57:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D6B3161994; Mon, 22 Mar 2021 11:57:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616414226; bh=fi5OxG2FihnWpnafMgRyJTvjUbox1QRr98ztmyJO8DI=; h=From:To:Cc:Subject:Date:From; b=Q3EO4JwMI6jYU8ZjOOMD9sDgeizAirLCyFjMfcd1r0bh0KeTW9yOVQhrA4Ajr6e/Z FyFg8YJJqLhzPTFnokP1ll+/ysqUeTg7vrO2DlZobzKsk5s4DruolS0kJMZOAgQmKH Z/tVyexXjfD+y4iO8T5aKucUin8pbLPuFLhPeYB5y3L09KG5cSphJsPYH3/D3HaGrp pAAE2Gg0s/oUlAKJLgiPy+p5wLSwvsAHfQsdXoXVluXBuKR+6D8CCYPIis4eiDNZc2 aF8s5VyNg6Iic+XpdESIkH0dOwkV4CsSGIFgvKvjisuzQbMiZv4jYtmS3X8aLLQC5w r7rjp0ZztvsIQ== From: Arnd Bergmann To: netdev@vger.kernel.org, Steffen Klassert , Herbert Xu , "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Zhang Changzhong , Sabrina Dubroca , Willem de Bruijn , Jiapeng Chong , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH net-next] ipv6: fix clang Wformat warning Date: Mon, 22 Mar 2021 12:56:49 +0100 Message-Id: <20210322115701.4035289-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann When building with 'make W=1', clang warns about a mismatched format string: net/ipv6/ah6.c:710:4: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat] aalg_desc->uinfo.auth.icv_fullbits/8); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/printk.h:375:34: note: expanded from macro 'pr_info' printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) ~~~ ^~~~~~~~~~~ net/ipv6/esp6.c:1153:5: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat] aalg_desc->uinfo.auth.icv_fullbits / 8); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/printk.h:375:34: note: expanded from macro 'pr_info' printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) ~~~ ^~~~~~~~~~~ Here, the result of dividing a 16-bit number by a 32-bit number produces a 32-bit result, which is printed as a 16-bit integer. Change the %hu format to the normal %u, which has the same effect but avoids the warning. Signed-off-by: Arnd Bergmann --- net/ipv6/ah6.c | 2 +- net/ipv6/esp6.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c index 440080da805b..01c638f5d8b8 100644 --- a/net/ipv6/ah6.c +++ b/net/ipv6/ah6.c @@ -705,7 +705,7 @@ static int ah6_init_state(struct xfrm_state *x) if (aalg_desc->uinfo.auth.icv_fullbits/8 != crypto_ahash_digestsize(ahash)) { - pr_info("AH: %s digestsize %u != %hu\n", + pr_info("AH: %s digestsize %u != %u\n", x->aalg->alg_name, crypto_ahash_digestsize(ahash), aalg_desc->uinfo.auth.icv_fullbits/8); goto error; diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index 153ad103ba74..831a588b04a2 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c @@ -1147,7 +1147,7 @@ static int esp_init_authenc(struct xfrm_state *x) err = -EINVAL; if (aalg_desc->uinfo.auth.icv_fullbits / 8 != crypto_aead_authsize(aead)) { - pr_info("ESP: %s digestsize %u != %hu\n", + pr_info("ESP: %s digestsize %u != %u\n", x->aalg->alg_name, crypto_aead_authsize(aead), aalg_desc->uinfo.auth.icv_fullbits / 8); -- 2.29.2