From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCAFBCCA47C for ; Wed, 6 Jul 2022 23:57:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234606AbiGFX5D (ORCPT ); Wed, 6 Jul 2022 19:57:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230386AbiGFX5B (ORCPT ); Wed, 6 Jul 2022 19:57:01 -0400 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51BA72D1C8 for ; Wed, 6 Jul 2022 16:57:00 -0700 (PDT) Received: by mail-pf1-x449.google.com with SMTP id d7-20020a056a0010c700b0052894ee16d8so2457611pfu.6 for ; Wed, 06 Jul 2022 16:57:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=k9hDQgqSg1c2GNzkRo9fr1J72XmUY4xT6POWi8tSVkY=; b=b+veUf+iMso1W0ftcosbsD8+NgfUr189mS3pBVAnhKIcsdjKd5MsOnAeYW2GWJktDA G8ia/rJSdXr7xfLbaGbUbUdfCLJ0ntBVijcDrT3CQbF5tkoUMYs6+B2A/JhKMH+d0XTq ORmyIyn2MtusUg/rSGYPZmRPd7Pk1z2iVveXM6yq0ItEU4IDD9wqrflC9jXoHkBVRvzM flgOFk0xah1QthCRP4KCx+DXAhj8hdueOKG6jffabcZwDAfsk08IhZVNpm1LouULdMN5 b/XVTfXHm3+LJS4tgIfp1FxM0m1t3zW/LIJhBvUi3ew3e7k/9dRl6380lkdDEBMq4bwm BKFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=k9hDQgqSg1c2GNzkRo9fr1J72XmUY4xT6POWi8tSVkY=; b=UGG+rNQh2Jd04O2HOk9aDAd2nIm+L6NAxydBTPVZp6khm6aSVncYrRmoK4FniXpFQS dKvDjpWkMn/zZY5tZOv7Ka/kFBBFhntTYgq2cn568xO/adtp84E/opsxH2ASBfnaXcDH 88fuqCsNIu4W2vrGnUexqGHfSGiip/7bS1kzDVzg63jzQJMlZvL44obj4NcJaiJI0eRX vSJqQjzWXckqiataesP/jI86TPvsdybgAtHnE4lK3VO9jT0LTPzvP0BMrgVN8fSIF8MK YMJbRn0+3ppTB3P6rtYG8OdGeUfVsbcQ73KGIyW5iQwQUFaZTqu8e0inhnc3MGMXKV21 frzw== X-Gm-Message-State: AJIora9HhzB3Ty3Wa3HBUrVKMjhTPg1917ngdXikijMFAYLtbSyXCitl iBDyrDg49uPBQVofPBkc5A8DENNOplhsqG0aBw== X-Google-Smtp-Source: AGRyM1vIo1TA1ajKwpu+A4H7vkncJ06KptHjEuCXN0h6KsKXFUR1Mnw+ULsk3fWD1HDKgEsrB91/09YqM3y/Wxf+Tw== X-Received: from justinstitt.mtv.corp.google.com ([2620:15c:211:202:aab2:e000:4b5a:a767]) (user=justinstitt job=sendgmr) by 2002:a17:902:d544:b0:16b:d981:5c2e with SMTP id z4-20020a170902d54400b0016bd9815c2emr23605823plf.22.1657151819813; Wed, 06 Jul 2022 16:56:59 -0700 (PDT) Date: Wed, 6 Jul 2022 16:56:48 -0700 Message-Id: <20220706235648.594609-1-justinstitt@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.37.0.rc0.161.g10f37bed90-goog Subject: [PATCH] net: rxrpc: fix clang -Wformat warning From: Justin Stitt To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: David Howells , Marc Dionne , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-afs@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Justin Stitt Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building with Clang we encounter this warning: | net/rxrpc/rxkad.c:434:33: error: format specifies type 'unsigned short' | but the argument has type 'u32' (aka 'unsigned int') [-Werror,-Wformat] | _leave(" = %d [set %hx]", ret, y); y is a u32 but the format specifier is `%hx`. Going from unsigned int to short int results in a loss of data. This is surely not intended behavior. If it is intended, the warning should be suppressed through other means. This patch should get us closer to the goal of enabling the -Wformat flag for Clang builds. Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Justin Stitt --- net/rxrpc/rxkad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index 08aab5c01437..aa180464ec37 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c @@ -431,7 +431,7 @@ static int rxkad_secure_packet(struct rxrpc_call *call, break; } - _leave(" = %d [set %hx]", ret, y); + _leave(" = %d [set %u]", ret, y); return ret; } -- 2.37.0.rc0.161.g10f37bed90-goog