Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3756047imw; Mon, 11 Jul 2022 15:23:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1urSk0i66qoXsnn8mmeHw1KZLH1Ei2V98jFbYYdCvrQFPqxnQKeCq5Tph4+2A+b0dafUwov X-Received: by 2002:a17:90a:1782:b0:1ef:cc5c:411a with SMTP id q2-20020a17090a178200b001efcc5c411amr623412pja.147.1657578230250; Mon, 11 Jul 2022 15:23:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657578230; cv=none; d=google.com; s=arc-20160816; b=P4WZa+MWYIcCDQ65cj3CLl1TQp4H0kztcWnEC9A2+oW3//EK+GH3lYLizjQeD32Va4 ZZQcJoWCwwAI+DJhcqMZ6F32jlKahWMDxm4Tmyx37B04Kt/dLnKOmZlGavAADy1Px5SO 6+e+G58QYZBVG+KB85Z6v1MSt13lbrz4TEsiz4HWKKpl1pYfkMvDNM7aDKXLRejDKKcZ b/zRDjQn8apJuEA5FAx0yJZjiYUPlgHUpZRbX4q6TmhtBOtl7ky4Y+N/S8w7TOEnS+Lu QFDAMo1gfCr/QLd6LWVw4My+cgWntScgM72CFgHBuzs2UTnrHHK2agu0l0V7pWkgQ7Yk /baA== 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:subject:cc:to:from:date :dkim-signature; bh=FgTwvTq1JSrz7mNIp0oVdLzTuHaPTbJ115CWdvj3IsY=; b=cHby7pZHs+o4wdy+J7zcEuiGIcAjZgvkiQgA90YsHyq6ysPPFXXGoJ5CZ9QJHDB5Z5 lrUzRhHonqIcvqDpPEobr4IUdA+cRBh+MmPQ3ebr2Nbzwi7bMw+mYWTh0k8l7cIXvh3O UUZtWAqnJms1yfxLfUxBEZsIny/mQsooxHvu0W+UyONXqaUIbHOUyMXkhvwkTtDcdKBo C0d+itrvNEMXkRsVCvDTNy3rGSxKU774paUZBnkCfMBReuWF6aI0b6nMH0PgU8KBFsDR s8/hIloXdxh4jz0R5sdFLmeJLxtix6v5iUcs8Q2UD9NZT0EZsx2GC5MsRkz7StSnDpCD hPMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=dGF+JIvh; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lx7-20020a17090b4b0700b001f04a144f4csi3093995pjb.179.2022.07.11.15.23.38; Mon, 11 Jul 2022 15:23:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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 (test mode) header.i=@wp.pl header.s=1024a header.b=dGF+JIvh; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230286AbiGKWXP (ORCPT + 64 others); Mon, 11 Jul 2022 18:23:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbiGKWXO (ORCPT ); Mon, 11 Jul 2022 18:23:14 -0400 X-Greylist: delayed 397 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 11 Jul 2022 15:23:11 PDT Received: from mx3.wp.pl (mx3.wp.pl [212.77.101.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCF2D1BE96 for ; Mon, 11 Jul 2022 15:23:11 -0700 (PDT) Received: (wp-smtpd smtp.wp.pl 39402 invoked from network); 12 Jul 2022 00:16:29 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1657577790; bh=FgTwvTq1JSrz7mNIp0oVdLzTuHaPTbJ115CWdvj3IsY=; h=From:To:Cc:Subject; b=dGF+JIvhtiNwRtOLhAFoU3bdxIOTiLFqUQqRJ0hYY9kTH2XXPLelltdRlzWJh77Gw g0yfU8HALnN7CZ05qIMYHo+BahPsPC3/dRrjUjAAT1x0JJ2pcphq2zLY4+RcY9fBhA xxdN+wh4Ifh0/3RF7rWZd2iR5iq/kpSCYRAAzxiU= Received: from unknown (HELO kicinski-fedora-PC1C0HJN) (kubakici@wp.pl@[163.114.132.128]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 12 Jul 2022 00:16:29 +0200 Date: Mon, 11 Jul 2022 15:16:11 -0700 From: Jakub Kicinski To: Justin Stitt Cc: Kalle Valo , "David S . Miller" , Eric Dumazet , Paolo Abeni , Matthias Brugger , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] mediatek: mt7601u: fix clang -Wformat warning Message-ID: <20220711151611.573190f5@kicinski-fedora-PC1C0HJN> In-Reply-To: <20220711212932.1501592-1-justinstitt@google.com> References: <20220711212932.1501592-1-justinstitt@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-WP-MailID: 2595572855169aaa33be638c199b8625 X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 000000A [wVN0] X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, 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-wireless@vger.kernel.org On Mon, 11 Jul 2022 14:29:32 -0700 Justin Stitt wrote: > When building with Clang we encounter this warning: > | drivers/net/wireless/mediatek/mt7601u/debugfs.c:92:6: error: format > | specifies type 'unsigned char' but the argument has type 'int' > | [-Werror,-Wformat] dev->ee->reg.start + dev->ee->reg.num - 1); > > The format specifier used is `%hhu` which describes a u8. Both > `dev->ee->reg.start` and `.num` are u8 as well. However, the expression > as a whole is promoted to an int as you cannot get smaller-than-int from > addition. Therefore, to fix the warning, use the promoted-to-type's > format specifier -- in this case `%d`. Acked-by: Jakub Kicinski