From patchwork Wed Apr 14 10:17:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steffen Klassert X-Patchwork-Id: 421086 Delivered-To: patch@linaro.org Received: by 2002:a02:c4d2:0:0:0:0:0 with SMTP id h18csp3415533jaj; Wed, 14 Apr 2021 03:17:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw12mJZlLI5JW2YaWuJe7C3PPkLd4KcHKx1ebUQ+agWRJy/r7ZB9doOgGJ9uIwXhbkWtkuj X-Received: by 2002:a17:906:d8a9:: with SMTP id qc9mr16524194ejb.37.1618395434828; Wed, 14 Apr 2021 03:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618395434; cv=none; d=google.com; s=arc-20160816; b=sv0FXJyYlmIpDLbyrEA64ga2CjXfmf5TFvlEJShzyFi4KsePj3ySuQfwDnK7a4adns q1MZN+UmhJVQB+h+MCFbPtw5VjrvY7YGhbDB61g1RX7wmvdx6Z5jWzPu7FXVVM7S6lsq XhUNzlR5BodS0qZpyPwWCxp+4XudqzJzclN2oeSTn4s8k/awl44sQc8Oxy6ZyY8xL3en V+ingYw9r7cqM1PGScS1JY/+ZTYLn+VyitWkEnaNmXU/if0t1PJ6ME6F9UNlj361u/oH 07VH0TSscgwWVmjaqEiUXzfRvbJRBRpctzED3EHS3yReHhisEyWAtKb3RaGhFtJpOtv6 MpnA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/Te0Hbwb5RtAottW56HrXltc26+lPkKo9NhIY3h38Uw=; b=k6uV4FZhWowIiDI9jduorwDmmqm3lRoS1bKxEbx/M8DbCvVN2YcLSvJMwLMyL3XJii zpsU8DZIt7DkdI0kevk9sSOpOIjtVoWwdqjK125nJA2iLbKeUBLN1o30htENipR1LEpt 6xlfJXmAcTkLzkv6v6Q3Bk6qKr8OGHMX4GllphevQjqOUH7t7uYafqi/UWjp810jHhbF hkWp/m8A1XIvf4BbTiSDLCYUuzxasmvimT7/tY1eCtpHFJ6XUvf4NPlqkgkdg2ZscKOd fTJKZ2oeldGUuBurFSXFVKMIYTF2j+Z8NXX/k+8uCmsyaOCjCQLMFfYqKKa2kmMHkfOY 9+Xw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p1si12708102edm.205.2021.04.14.03.17.14; Wed, 14 Apr 2021 03:17:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233559AbhDNKRe (ORCPT + 8 others); Wed, 14 Apr 2021 06:17:34 -0400 Received: from mailout1.secunet.com ([62.96.220.44]:33382 "EHLO mailout1.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233391AbhDNKR1 (ORCPT ); Wed, 14 Apr 2021 06:17:27 -0400 Received: from cas-essen-01.secunet.de (unknown [10.53.40.201]) by mailout1.secunet.com (Postfix) with ESMTP id A8F0F800058; Wed, 14 Apr 2021 12:17:04 +0200 (CEST) Received: from mbx-essen-01.secunet.de (10.53.40.197) by cas-essen-01.secunet.de (10.53.40.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 14 Apr 2021 12:17:04 +0200 Received: from gauss2.secunet.de (10.182.7.193) by mbx-essen-01.secunet.de (10.53.40.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 14 Apr 2021 12:17:03 +0200 Received: by gauss2.secunet.de (Postfix, from userid 1000) id 999C831803D4; Wed, 14 Apr 2021 12:17:03 +0200 (CEST) From: Steffen Klassert To: David Miller , Jakub Kicinski CC: Herbert Xu , Steffen Klassert , Subject: [PATCH 3/3] ipv6: fix clang Wformat warning Date: Wed, 14 Apr 2021 12:17:01 +0200 Message-ID: <20210414101701.324777-4-steffen.klassert@secunet.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210414101701.324777-1-steffen.klassert@secunet.com> References: <20210414101701.324777-1-steffen.klassert@secunet.com> MIME-Version: 1.0 X-ClientProxiedBy: cas-essen-02.secunet.de (10.53.40.202) To mbx-essen-01.secunet.de (10.53.40.197) X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 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 Signed-off-by: Steffen Klassert --- net/ipv6/ah6.c | 2 +- net/ipv6/esp6.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.25.1 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);