Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3900260imm; Mon, 6 Aug 2018 12:36:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfcI1gA/4t7BnJzyElkWGYzmnx8YFfs3cQSP7nHSJsx9Pf6nmosszIS6YR6Epe+iwd/D8A2 X-Received: by 2002:a63:8042:: with SMTP id j63-v6mr15848175pgd.230.1533584173915; Mon, 06 Aug 2018 12:36:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533584173; cv=none; d=google.com; s=arc-20160816; b=S7JvNEgEPEuRRFYoGEdIambs195gJpZyj6Mbrw9L3GSIQZI993nbP7TIDm5eNuSG07 xOIZ6bjtC6UX1fmKjH2if5UMpuXJFpoD2O/8q9JUw7PCl19uOvkmaMYwhgWEfR9D4856 NvvYc8gfx2Pk4jpo9XFEd+xl3+l93dAJeQzVHOmbfX6IFbqYmIBeL0KO8hKGGA5eGB67 Zl4Me5aSr/cfAexNJd887AA4CSruQ7kDy/Uk3pMDKzCoj+EOg+7I11Wb3keTyBMiFr9v pC9nUxcLFtoh7CnB+p9/PAhZYdngX6rmFE8cHZUyh1QEAb5MsNmJALGTQczT3pQwGvn5 vTHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=4FnKrnGFr8YXn2LmZu2EbPrZUI0cnPKqhB/TJwcFXX0=; b=Xg7afd06pUkzgAwQnMDqB0WkXPtG5reR1wUenMbf3gVUP10fwDsaRvSED4UuevTvbj 824AhlOFtqHmnNsbfbe/ujtzANMn1bQ2ECwird+lXtKuV5puk18h0JHh1g0Ybaxk0n9g G7l7oGunPHVDW91bZd3t496mFsE4+W4Zz30LgsH2DZaWkokX8/Yvsxyuj0zFC9j62oiJ Ams/rIwr1FhR/gL8AaZFDO3sVF2bC96QuMgcGr38zIERQQ1FkhcJCyxs6/3uVVeduKzm 4u0dreKmiMMo213EKgx673gUa1sCYtg2sckR086ZF499D3QgwjwoQjdswwt/vZeytJQm /SDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b13-v6si13019651pgh.255.2018.08.06.12.35.59; Mon, 06 Aug 2018 12:36:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732698AbeHFUsc (ORCPT + 99 others); Mon, 6 Aug 2018 16:48:32 -0400 Received: from mga18.intel.com ([134.134.136.126]:58765 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730840AbeHFUsc (ORCPT ); Mon, 6 Aug 2018 16:48:32 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2018 11:38:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,452,1526367600"; d="scan'208";a="222386162" Received: from linux.intel.com ([10.54.29.200]) by orsmga004.jf.intel.com with ESMTP; 06 Aug 2018 11:37:55 -0700 Received: from txhoang-mobl.amr.corp.intel.com (unknown [10.254.17.180]) by linux.intel.com (Postfix) with ESMTP id 09A435801BD; Mon, 6 Aug 2018 11:37:53 -0700 (PDT) Subject: Re: [alsa-devel] [PATCH 9/9] ALSA: intel_hdmi: remove redundant variable cfg_val To: Takashi Iwai Cc: alsa-devel@alsa-project.org, Olivier Moysan , Alexandre Torgue , kernel-janitors@vger.kernel.org, Arnaud Pouliquen , Liam Girdwood , Mark Brown , Maxime Coquelin , Colin King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jaya Kumar References: <20180801104742.4328-1-colin.king@canonical.com> <20180801104742.4328-10-colin.king@canonical.com> From: Pierre-Louis Bossart Message-ID: Date: Mon, 6 Aug 2018 13:37:53 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/1/18 6:00 AM, Takashi Iwai wrote: > On Wed, 01 Aug 2018 12:47:42 +0200, > Colin King wrote: >> >> From: Colin Ian King >> >> Variable cfg_val is being assigned but is never used hence it is >> redundant and can be removed. >> >> Cleans up clang warning: >> warning: variable 'cfg_val' set but not used [-Wunused-but-set-variable] >> >> Signed-off-by: Colin Ian King >> --- >> sound/x86/intel_hdmi_audio.c | 2 -- >> 1 file changed, 2 deletions(-) >> >> diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c >> index edc9f5a34eff..fa7dca5a68c8 100644 >> --- a/sound/x86/intel_hdmi_audio.c >> +++ b/sound/x86/intel_hdmi_audio.c >> @@ -290,7 +290,6 @@ static void had_reset_audio(struct snd_intelhad *intelhaddata) >> static int had_prog_status_reg(struct snd_pcm_substream *substream, >> struct snd_intelhad *intelhaddata) >> { >> - union aud_cfg cfg_val = {.regval = 0}; >> union aud_ch_status_0 ch_stat0 = {.regval = 0}; >> union aud_ch_status_1 ch_stat1 = {.regval = 0}; >> >> @@ -298,7 +297,6 @@ static int had_prog_status_reg(struct snd_pcm_substream *substream, >> IEC958_AES0_NONAUDIO) >> 1; >> ch_stat0.regx.clk_acc = (intelhaddata->aes_bits & >> IEC958_AES3_CON_CLOCK) >> 4; >> - cfg_val.regx.val_bit = ch_stat0.regx.lpcm_id; > > Actually this made me wonder what is the definition of val_bit. > It seems always 1 in the current code after the commit 964ca8083c02. > Pierre? This val_bit is only there for debug/test, it should be set to one by default and has nothing to do with the lpcm_id. This variable was set even in patches before upstream submission and was never needed, I guess it must be a 9-yr old issue. Good catch! Acked-by: Pierre-Louis Bossart BTW looking at the structures in intel_hdmi_lpe_audio.h, the field format:3 in audio_ch_status_0 is misleading at best, it should be the emphasis if I look at the SPDIF/AES docs. It's not used but I'll have to relook at all this when I find some time... We should really set the registers to mirror what the aes_bits are, not just the non_audio and clock accuracy fields.