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 9C70DCCA481 for ; Sat, 16 Jul 2022 01:40:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231530AbiGPBkp convert rfc822-to-8bit (ORCPT ); Fri, 15 Jul 2022 21:40:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbiGPBkn (ORCPT ); Fri, 15 Jul 2022 21:40:43 -0400 Received: from relay3.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8257691CC4 for ; Fri, 15 Jul 2022 18:40:42 -0700 (PDT) Received: from omf07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 46EA234AD8; Sat, 16 Jul 2022 01:40:40 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf07.hostedemail.com (Postfix) with ESMTPA id EC0D22002F; Sat, 16 Jul 2022 01:40:36 +0000 (UTC) Message-ID: Subject: Re: [PATCH] mediatek: mt7601u: fix clang -Wformat warning From: Joe Perches To: Justin Stitt Cc: Jakub Kicinski , 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 Date: Fri, 15 Jul 2022 18:40:36 -0700 In-Reply-To: References: <20220711212932.1501592-1-justinstitt@google.com> <84e873c27f2426ce003e650004fe856bf72c634b.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.1-0ubuntu1 MIME-Version: 1.0 X-Stat-Signature: 9arxp8zrxrtfhr9woubqw46ao9rxwyoi X-Rspamd-Server: rspamout08 X-Rspamd-Queue-Id: EC0D22002F X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX188ldYAO7JJ3DMtC38rgMW1rKWpcluwGBk= X-HE-Tag: 1657935636-65764 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2022-07-15 at 17:08 -0700, Justin Stitt wrote: > On Thu, Jul 14, 2022 at 11:33 PM Joe Perches wrote: > > > > On Mon, 2022-07-11 at 14:29 -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); [] > > I suggest s/%hh/%/ for all the uses here, not just this one. > > I also contemplated this change but I think it might be a bit out of > scope for https://github.com/ClangBuiltLinux/linux/issues/378 -- What > do you think? It would not be out of scope. > It could be argued that every single instance of %hh[dux] should be > replaced with %[dux]. All the vsprintf ones, but not the scanf ones.