Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3246175imw; Mon, 18 Jul 2022 04:56:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vYEyu4NBEmgTVJisxJwPG9GXHRDxOjcOIpXtqNASQ3i62/VIcXT/skQlMHF6PukFxqs0CX X-Received: by 2002:a17:907:7b9c:b0:72b:5652:a14a with SMTP id ne28-20020a1709077b9c00b0072b5652a14amr25405381ejc.86.1658145368089; Mon, 18 Jul 2022 04:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658145368; cv=none; d=google.com; s=arc-20160816; b=RV1kxohns3FMuRtv156m2SY7yjQT/mDOlxMJeq+kEx3ZC104D7/2mxuKTcZKIiL6bs kD9Sto7Oy8YZcuIrMkdN1W3i7NRSMB1FhNCcMZkzTWVHo2hMLgjPBTI6ORlDDlV486jd RNLBCBITrEcth4m2y3ieDk8dCEmExgpW8XE5XV5zPAycFCD8xrpZNSffnPUMiT9iBBaE EZK/IPhSL14r/JRKMkKTZ9JeM0IOeZ7viabIcBWfILLbYKNe5DzMfiBnaYErzAo5vs4i seiMvlxa2fd8emToica2q0z5w1pfaXTg9A1Ifi9VyJsXEHYqL9jYnJGUqNQ6iiAZ8Yjg eXJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:message-id:user-agent:cc:to:references :in-reply-to:from:subject:content-transfer-encoding:mime-version :dkim-signature; bh=Ldq/cI/LyZOjep8ieSdgEh6sNmY/fkrJz4bkNlrNseI=; b=Ois34GdjDQUN/z4h5jD55wkar9cGYcFRY6z5HnuWlPdmiFscvQp0s1HfIHjfZkRNta apDC/XqGixUU3zhRChIkqQTCsDFOG6y6RM7raRKyVLjD12qmZXag5lRDRkabN4prVPFU VQggTw455jxIO2P6ZOnK5jicT2kanATSvh8LpYL8BvcLMiIkJbmb5Vol//PRVhBCRbgE hsCWUm+mwakhaby0QHC7Ul10bUd4X7iOuScFsxUnCB9tF9lzvxbJhBN8xm7jrmjmlczN dPMFLaEuvPF+cvMAmPZz4BW36empbDVAEArBkl7UdWjzg0Q0fH0y8Lpdn/h/N9T9Q5qd UWgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cg61rv7J; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 6-20020a508746000000b0043adeeba898si14383655edv.283.2022.07.18.04.55.51; Mon, 18 Jul 2022 04:56:08 -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 header.i=@kernel.org header.s=k20201202 header.b=cg61rv7J; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233614AbiGRLxS (ORCPT + 65 others); Mon, 18 Jul 2022 07:53:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232768AbiGRLxR (ORCPT ); Mon, 18 Jul 2022 07:53:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87D7022BC0; Mon, 18 Jul 2022 04:53:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2F221B810F4; Mon, 18 Jul 2022 11:53:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FC6EC341C0; Mon, 18 Jul 2022 11:53:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658145193; bh=Phc0x9SWsO+X5B2V1yFiu7oQp3xqcc3kPiUwuV37VD8=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=cg61rv7JyfsvKq+pksU/RtmLFEnKmV+HUjSL9k9VcgV9wPu8DQUbXhZkQJU10FWS+ DHEkassZJsixQy50n+gfle8U7saVv8HQScsSNr5+vm9k0ZeKGWAl7M9kTC7ohwYzkm bvHvJR7BJqDCBP5XcbCpRvrA6CEREA3o65Bz7qWBuZk9M4pAEXdf9TkTSD2h6/5ny7 b3pZFZWIrTBvAjr7+wPNYUxU9Y732kq52a9d6vZBv6mD16sjxRTIjsVNbzzfDOe5Dk LjjkrvngQqErw1skCAsTELnEKBC/La+bXexwO2kR3Q8Ki7aA2U/cfky/YWbq9OcUVP pOdWGOl45aigg== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: wifi: mt7601u: eeprom: fix clang -Wformat warning From: Kalle Valo In-Reply-To: <20220709001527.618593-1-justinstitt@google.com> References: <20220709001527.618593-1-justinstitt@google.com> To: Justin Stitt Cc: Jakub Kicinski , "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, Justin Stitt User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.7.3 Message-ID: <165814518849.17539.4270310820175063607.kvalo@kernel.org> Date: Mon, 18 Jul 2022 11:53:10 +0000 (UTC) X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Justin Stitt wrote: > When building with Clang we encounter the following warning: > | drivers/net/wireless/mediatek/mt7601u/eeprom.c:193:5: error: format > | specifies type 'char' but the argument has type 'int' [-Werror,-Wformat] > | chan_bounds[idx].start + chan_bounds[idx].num - 1); > > Variadic functions (printf-like) undergo default argument promotion. > Documentation/core-api/printk-formats.rst specifically recommends using > the promoted-to-type's format flag. > > Moreover, C11 6.3.1.1 states: > (https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf) `If an int > can represent all values of the original type ..., the value is > converted to an int; otherwise, it is converted to an unsigned int. > These are called the integer promotions.` > > With this information in hand, we really should stop using `%hh[dxu]` or > `%h[dxu]` as they usually prompt Clang -Wformat warnings as well as go > against documented standard recommendations. > > Link: https://github.com/ClangBuiltLinux/linux/issues/378 > Signed-off-by: Justin Stitt Patch applied to wireless-next.git, thanks. 07db88f11e63 wifi: mt7601u: eeprom: fix clang -Wformat warning -- https://patchwork.kernel.org/project/linux-wireless/patch/20220709001527.618593-1-justinstitt@google.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches