From patchwork Thu Apr 21 16:36:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 565276 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 384BBC433F5 for ; Thu, 21 Apr 2022 16:40:04 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D519F168F; Thu, 21 Apr 2022 18:39:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D519F168F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1650559201; bh=orBYkA+uyhkXLmYGjVPDgxx/6cnxOb0jXMaxOJi1Rg8=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=RzQFD3V485j7fZKm2TmUptvu+Wt8awa1fr9ZUDr/4FFZzmw08ovUfO06x1PA374J5 2w3V+Vzg7UunSPfgUQEFvv/g4VtOmQGeXktGaGTQ8/Ueu8v0FJ+Bl8pyaLM6RODwwf bqHoFJTU1VrJaPGGkEqN/dt/wkqXVvPg6om+as2Y= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id EFFDDF804C1; Thu, 21 Apr 2022 18:38:43 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 03BFDF804DA; Thu, 21 Apr 2022 18:38:42 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2C156F80125 for ; Thu, 21 Apr 2022 18:38:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2C156F80125 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="oDGgNyQV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650559117; x=1682095117; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=orBYkA+uyhkXLmYGjVPDgxx/6cnxOb0jXMaxOJi1Rg8=; b=oDGgNyQVISA2+zO7pWwcwIOnJLSS2yq/aJG6WhKpZky3+Mv0x1Boy3Mr YOp/FOkKDFbf66u30V3ny8gzGceDW5tBglFL9/7eCkTQ4+9PNpzi+NnIw aFgJ9edVfif+Cx9KoTaIBCBUKxh6HPXKFhxqfI2KTF6d0qV0gMHrmja9G ttjtmQ5OqcRLiysCPPlX+nH5PoBct9NqmYmcSj1YT4eEHiX2du0o6/J6N 5gNWobCISajy3F5WEaNMOhL1gQQrbiZtCP6MeumPiJko8NzpBmBuZaW2U qIgPxC73Y75UqtvYcpvuxR+T7mjh6WahVNohumHwaL0d6co5bZoq9LPlp Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10324"; a="324858019" X-IronPort-AV: E=Sophos;i="5.90,279,1643702400"; d="scan'208";a="324858019" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2022 09:36:54 -0700 X-IronPort-AV: E=Sophos;i="5.90,279,1643702400"; d="scan'208";a="658604506" Received: from qingsu-mobl.amr.corp.intel.com (HELO pbossart-mobl3.amr.corp.intel.com) ([10.212.148.250]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2022 09:36:53 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH] ASoC: Intel: sof_ssp_amp: remove 'set-but-not-used' warning Date: Thu, 21 Apr 2022 11:36:45 -0500 Message-Id: <20220421163645.319686-1-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Cc: kernel test robot , tiwai@suse.de, Ranjani Sridharan , Pierre-Louis Bossart , broonie@kernel.org, =?utf-8?q?P=C3=A9ter_Ujfalusi?= X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Clang warning: >> sound/soc/intel/boards/sof_ssp_amp.c:97:6: warning: variable 'i' set but not used [-Wunused-but-set-variable] int i = 0; ^ The device counter is not used when the quirk is not set, which static analysis cannot know. Move its initialization before the loop to remove this warning. Reported-by: kernel test robot Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi --- sound/soc/intel/boards/sof_ssp_amp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/sof_ssp_amp.c b/sound/soc/intel/boards/sof_ssp_amp.c index 02a27aaed92fb..8f5b9ebbe8287 100644 --- a/sound/soc/intel/boards/sof_ssp_amp.c +++ b/sound/soc/intel/boards/sof_ssp_amp.c @@ -94,7 +94,7 @@ static int sof_card_late_probe(struct snd_soc_card *card) char jack_name[NAME_SIZE]; struct sof_hdmi_pcm *pcm; int err; - int i = 0; + int i; if (!(sof_ssp_amp_quirk & SOF_HDMI_PLAYBACK_PRESENT)) return 0; @@ -113,6 +113,7 @@ static int sof_card_late_probe(struct snd_soc_card *card) return hda_dsp_hdmi_build_controls(card, component); } + i = 0; list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { component = pcm->codec_dai->component; snprintf(jack_name, sizeof(jack_name),