Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp22551131rwd; Fri, 30 Jun 2023 09:20:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlH/F28/J7kv52HCJcwHfHy17B5PZDzNNFTQLG5XHBSHJGDrO+pb/JCOgPte/mgf27Zlqf5O X-Received: by 2002:a17:902:760b:b0:1b8:5a32:2345 with SMTP id k11-20020a170902760b00b001b85a322345mr1830749pll.22.1688142040195; Fri, 30 Jun 2023 09:20:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688142040; cv=none; d=google.com; s=arc-20160816; b=LGoV7Yj4fJZ+3TaMPOXERI6SXNV76vNTaC/Urz7Oftkhzb5XiGUdXZ5nmSdTUAH2ZM RoyJxKiGPC/TWuiGzX/IGJHxefj2RCLLvbk1Jxz/xDvdnIvD1LSgcVAW/AyHybWicDDv GSQSzbe+CluGODzOkW9WkBHhJnlbMI5Vkz9RE2CeF4jCk3GoN4h50YUaPpthuVYN7o3p J2ChjRTk4sRqiz0ZyPfeTAqYJAbqTkBC1lPozoGdfLIabBIXBoBXNwj8M/whLai1BRn6 6hd8uMYFvbIm2HvaQHedE3/ZhE17+SDBuzKJrLgRbfz8NJQ6UodcrhHmJDxYnh47GmMD Yk7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0DMEMD+FRdiKrQhubmQMR3XDEEGwHamL8uC4bEKNV/o=; fh=aRyha2gMDyDdPG1KHh+pACT6I/OEqvjlA3E+oHS+EPE=; b=HYrYO9sIHPPBdBd16juZgdKHl0tl50oPLTToBiC9fhayAOfkNrrHPetrVVFahqwCiU exMWgmHQjine6JCnumVgTfrFfGbA88kmUj9uFBhRcynIG9hY1CgClkfTT4VKD1QMv8xb B5Q4BW6Tjn5AGt04gUyr3sH8Uj62Lf8Sh60/mu9eZuhMC/wgxJ7MK7F6GjE/gZ3zauM3 ZyTD+WkR8EjtYB3TYXZi4ejB6fajs4Vc6XeWrQNS6b4dlLnqCST/kbzYseCAUJXDklTA IuiHe+1Q41tJ2B+qXDLx2s5batjhpVHPVsjOQ4NX6kE8RKQbRtal3xSzZWZEKivlDmy7 VwaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nEOT2RDr; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m10-20020a170902bb8a00b001b04c325d66si12289482pls.565.2023.06.30.09.20.26; Fri, 30 Jun 2023 09:20:40 -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=@kernel.org header.s=k20201202 header.b=nEOT2RDr; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230235AbjF3Pyf (ORCPT + 99 others); Fri, 30 Jun 2023 11:54:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232975AbjF3Pyb (ORCPT ); Fri, 30 Jun 2023 11:54:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC1AA3C06; Fri, 30 Jun 2023 08:54:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 60BD16178A; Fri, 30 Jun 2023 15:54:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54E29C433C0; Fri, 30 Jun 2023 15:54:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688140469; bh=3UxnCn0uKRWtw0gFGbXkslK1m3C/e7mRctYkrXYRER8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nEOT2RDrMyVotMws4YABB+hxaLTELOoPVGVFqSiq41H6IesDtPs9UZC4zDuYg0Up2 Zg8PXkbR9PFVqlQFtCJfssEp4HZn+zk7axTiOO9n3ygma+ddLKYrTgl/25YkAiE5/f 0h/0KkksDmvOVZnVhbwvXuJMA5L9GwEppi025BMB5dDcsEgFeQc/OMgw3ZuKgtFwPm udXrOkNqKPkjxumsMI0uKSXPPULvFjUQjqT16FeMgxCpqV9b0OV9OldFpZP2ghh6NC cwK6+LM3KIomgurPZMzIBYcJTYao2gw57JCI6PJB4LAmyLFvzVlsbi/8PXlmZBU1xC z473u/Jpk3YXQ== Date: Fri, 30 Jun 2023 08:54:27 -0700 From: Nathan Chancellor To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Hans Verkuil , Nick Desaulniers , Tom Rix , Zhou jie , llvm@lists.linux.dev Subject: Re: [PATCH] media: wl128x: fix a clang warning Message-ID: <20230630155427.GA2889176@dev-arch.thelio-3990X> References: <6badd27ebfa718d5737f517f18b29a3e0f6e43f8.1687981726.git.mchehab@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6badd27ebfa718d5737f517f18b29a3e0f6e43f8.1687981726.git.mchehab@kernel.org> X-Spam-Status: No, score=-7.1 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,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 On Wed, Jun 28, 2023 at 09:48:53PM +0200, Mauro Carvalho Chehab wrote: > Clang-16 produces this warning, which is fatal with CONFIG_WERROR: > > ../drivers/media/radio/wl128x/fmdrv_common.c:1237:19: error: variable 'cmd_cnt' set but not used [-Werror,-Wunused-but-set-variable] > int ret, fw_len, cmd_cnt; > ^ > 1 error generated. > > What happens is that cmd_cnt tracks the amount of firmware data packets > were transfered, which is printed only when debug is used. Alternatively, fmdbg() could be defined with no_printk(), so that the variable appears used in all configurations, but this does not seem unreasonable either. > Switch to use the firmware count, as the message is all about reporting > a partial firmware transfer. > > Signed-off-by: Mauro Carvalho Chehab > --- > drivers/media/radio/wl128x/fmdrv_common.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/media/radio/wl128x/fmdrv_common.c b/drivers/media/radio/wl128x/fmdrv_common.c > index cbd49dff6d74..b31b7ed60bbe 100644 > --- a/drivers/media/radio/wl128x/fmdrv_common.c > +++ b/drivers/media/radio/wl128x/fmdrv_common.c > @@ -1234,9 +1234,8 @@ static int fm_download_firmware(struct fmdev *fmdev, const u8 *fw_name) > struct bts_action *action; > struct bts_action_delay *delay; > u8 *fw_data; > - int ret, fw_len, cmd_cnt; > + int ret, fw_len; > > - cmd_cnt = 0; > set_bit(FM_FW_DW_INPROGRESS, &fmdev->flag); > > ret = request_firmware(&fw_entry, fw_name, > @@ -1272,7 +1271,6 @@ static int fm_download_firmware(struct fmdev *fmdev, const u8 *fw_name) > if (ret) > goto rel_fw; > > - cmd_cnt++; > break; > > case ACTION_DELAY: /* Delay */ > @@ -1284,7 +1282,7 @@ static int fm_download_firmware(struct fmdev *fmdev, const u8 *fw_name) > fw_data += (sizeof(struct bts_action) + (action->size)); > fw_len -= (sizeof(struct bts_action) + (action->size)); > } > - fmdbg("Firmware commands(%d) loaded to chip\n", cmd_cnt); > + fmdbg("Transfered only %d of %d bytes of the firmware to chip\n", fw_entry->size - fw_len, fw_entry->size); > rel_fw: > release_firmware(fw_entry); > clear_bit(FM_FW_DW_INPROGRESS, &fmdev->flag); > -- > 2.41.0 >