Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp289161imw; Fri, 8 Jul 2022 03:04:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s4qhVyqGfcxDy5lY4tmdXJ/nZPa9ti71uItInKa9W60aK9tazHmJIYl59H3btHBhcnHt9h X-Received: by 2002:a17:902:988b:b0:16b:fae3:fcd5 with SMTP id s11-20020a170902988b00b0016bfae3fcd5mr2849675plp.109.1657274650222; Fri, 08 Jul 2022 03:04:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657274650; cv=none; d=google.com; s=arc-20160816; b=gIL9nTYLypTbdufa7nS/w4LmNtu13VZfOLWXQizD3vBjq0WgbFgRG6rY6CR/xEbgny vSrUpAWmWhFwZYj8ONCpHwnyT5fnuX/5jeALMS6+HgtHhoP998lDSJGIch068UpKFZa3 7ZaFjreT80JAIh/ziK9Y9blr1GOTn5+QF3SJ5/Rk9WeG1iLGf4A5Y9kaLCnolMEaoPTj jbnmjiegL0OMW0/kWXcjd8ued5Nx/CTiQz4+c7IoEdPKtZQcmCaL7H2muwvY1u2MLvX0 /iKCk44RSmpx1UoYkV4RtDV87PZtRLfZUkuEKx8qotxCNm+k9NdmcHnkHYMlplt9lpLs xioQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=4UPveqJBbaI6azQGRwsMHikunCUeOc3vlQ7vCa3TUTU=; b=tKuzJO0hrs4vvBaIkdeWpXRtmbMu+FQ0Vjya4Ye3Mvfu+aJxLlM9MyCkXLRoCkRYMr z4PmIBjUruvPPlgld6l7+1KNdm9UoOCrrgg34DVgtv7XTGwfMEwwZ6/JsudaQkHAV1oP n+Y4bsVaf7do5fYJpNLY+eIQk3IA0rNP/CHQY2IY6fwIQDE2u9Kb5/ENSc5va0SLXbl0 HXiz6l4MmzfPaFo+rYbBfZAIFcqUxhf65vInTKGH4R8vq5LN98tdg/DIJAwqLvE94Sf/ pPsDMH8s1MQ2fWwdgqZGE9yZZYGPTGNAHUWPj9gD3rwrTZG7r9iQc12tOcXMMBLzMc/s hoCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KojcNzGJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lw7-20020a17090b180700b001e6820f720esi2509658pjb.125.2022.07.08.03.03.43; Fri, 08 Jul 2022 03:04:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KojcNzGJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237291AbiGHJjN (ORCPT + 99 others); Fri, 8 Jul 2022 05:39:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237138AbiGHJjL (ORCPT ); Fri, 8 Jul 2022 05:39:11 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 08A3465D68 for ; Fri, 8 Jul 2022 02:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657273150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4UPveqJBbaI6azQGRwsMHikunCUeOc3vlQ7vCa3TUTU=; b=KojcNzGJbSTNUjqNBj/dIjWkM3fkEfLy5q1lVE/BFwknXQNNAnxYCN4rsvpl/shu0BIXVa TpfVjRSI2J3SVqtwihQKPDWxOMJtdkrMXxpdcgEg4O2ViFHm36EY/jhOSQFr2yL4SVTj8l fBVzsPlg8syo4LdBSASudYWuRU+NDg0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-17-TcUMHTKGPkWRjjBANTXw8A-1; Fri, 08 Jul 2022 05:39:07 -0400 X-MC-Unique: TcUMHTKGPkWRjjBANTXw8A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7F0428041BE; Fri, 8 Jul 2022 09:39:06 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id D8A5B1121314; Fri, 8 Jul 2022 09:39:04 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20220707182052.769989-1-justinstitt@google.com> References: <20220707182052.769989-1-justinstitt@google.com> <20220706235648.594609-1-justinstitt@google.com> To: Justin Stitt Cc: dhowells@redhat.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, marc.dionne@auristor.com, nathan@kernel.org, ndesaulniers@google.com, netdev@vger.kernel.org, pabeni@redhat.com, trix@redhat.com Subject: Re: [PATCH v2] net: rxrpc: fix clang -Wformat warning MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1840088.1657273144.1@warthog.procyon.org.uk> Date: Fri, 08 Jul 2022 10:39:04 +0100 Message-ID: <1840089.1657273144@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Justin Stitt wrote: > 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. Yeah, y is reduced to a 16-bit number so that it can be used in the protocol, but the type is still 32-bit because that's needed for the calculation. An alternative would be to print sp->hdr.cksum since that's the value that will appear on the wire, but I've no objection to this change either. > 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 Acked-by: David Howells