From patchwork Mon Mar 22 11:56:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 406107 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3499811jai; Mon, 22 Mar 2021 04:58:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNdNV8E8FSydlIS21nJSjrGMCZ4oeh9iq1nhPULBBhrKn84ZAKasEAFQGkNDgL2R7dk0O/ X-Received: by 2002:a17:906:4a50:: with SMTP id a16mr19218435ejv.256.1616414284441; Mon, 22 Mar 2021 04:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616414284; cv=none; d=google.com; s=arc-20160816; b=ujxgb64NNDHlmM8JpKsOaZepipYUo6Eo9jBxEayyjrhaWxPJRKbFzLxa2jFPvdazDJ 3I4YrK3ZAmGGQVbpgBQnimVYy8rsWtb4QyJ2jwtktEZeMBV8swT7VyRuZ+0pS6DNUR7J ZbLt26Xnlm7Nko/x5mWFckwYQgtZVRwcrT0kJtYgkZjw6IPrXbp8YKSH3hWQ445iX0jo 9eaOtwNK1czSAkGg0ExYB8zxE5YNGb1rmy/BoApd3c+gkyGeXGqK8ME6rfAddKBCBFjO B7InKVkFtdDaTGqHHLWQv6MK6q1zltrDdEFXG8nsXu4i77419ZaY+qsz1yc8ta51XR/Z 7HPQ== 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=OsoIEwttCROWV23VElxlDkBxb0MfbFjC8E0u09m0lrwUiJJ3sXs/W8yizPGVfSmSRN 4Q7ub/4wlU1h2U7FgRtI8f4ZRrjHUMfiuB0SEVq8rLgN3g7M2JXmCnUR1wXXm1WBafu5 7beX0EGRzm2DYG350bPqkHrVzZGZyTv0kzndTVOrBKLujIVGlQgSK7qYSycxv9hHxcAn qyz0eoZsVCPzybTYBeualP+qHLzYiZ+u/j3SEdhsrMyzs/qCoTgC9YhVi8nITtasQi4B 95aIaXZS6eHygyZ+Wjws4S0szk7AYwEo6o2XKVBoOKqbusLyTkvYq6U18+YpkVOoe0kr eWSQ== 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 netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 hy25si10500496ejc.333.2021.03.22.04.58.04; Mon, 22 Mar 2021 04:58:04 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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 netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S229590AbhCVL5f (ORCPT + 8 others); Mon, 22 Mar 2021 07:57:35 -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 Precedence: bulk List-ID: X-Mailing-List: netdev@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(-) -- 2.29.2 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);