public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <yujie.liu@intel.com>
To: Fangzhi Zuo <Jerry.Zuo@amd.com>
Cc: <llvm@lists.linux.dev>, <kbuild-all@lists.01.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	Alex Deucher <alexander.deucher@amd.com>,
	Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Subject: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_apg.c:124:2: warning: Value stored to 'speakers' is never read [clang-analyzer-deadcode.DeadStores]
Date: Tue, 7 Dec 2021 17:16:03 +0800	[thread overview]
Message-ID: <736272c1-4d41-55cd-b14d-c4820c5bcf8b@intel.com> (raw)
In-Reply-To: <202111300439.S9nMj4kS-lkp@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d58071a8a76d779eedab38033ae4c821c30295a5
commit: 61452908a79ec936660494fb4b9f2a35ee42e6e0 drm/amd/display: Add DP 2.0 Audio Package Generator
date:   3 months ago
config: x86_64-randconfig-c007-20211128 (https://download.01.org/0day-ci/archive/20211130/202111300439.S9nMj4kS-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5162b558d8c0b542e752b037e72a69d5fd51eb1e)
reproduce (this is a W=1 build):
         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
         chmod +x ~/bin/make.cross
         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=61452908a79ec936660494fb4b9f2a35ee42e6e0
         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
         git fetch --no-tags linus master
         git checkout 61452908a79ec936660494fb4b9f2a35ee42e6e0
         # save the config file to linux build tree
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)

 >> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_apg.c:124:2: warning: Value stored to 'speakers' is never read [clang-analyzer-deadcode.DeadStores]
            speakers = audio_info->flags.info.ALLSPEAKERS;
            ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 >> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_apg.c:125:2: warning: Value stored to 'channels' is never read [clang-analyzer-deadcode.DeadStores]
            channels = speakers_to_channels(audio_info->flags.speaker_flags).all;
            ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/speakers +124 drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_apg.c

61452908a79ec9 Fangzhi Zuo 2021-06-09  108
61452908a79ec9 Fangzhi Zuo 2021-06-09  109  static void apg31_se_audio_setup(
61452908a79ec9 Fangzhi Zuo 2021-06-09  110  	struct apg *apg,
61452908a79ec9 Fangzhi Zuo 2021-06-09  111  	unsigned int az_inst,
61452908a79ec9 Fangzhi Zuo 2021-06-09  112  	struct audio_info *audio_info)
61452908a79ec9 Fangzhi Zuo 2021-06-09  113  {
61452908a79ec9 Fangzhi Zuo 2021-06-09  114  	struct dcn31_apg *apg31 = DCN31_APG_FROM_APG(apg);
61452908a79ec9 Fangzhi Zuo 2021-06-09  115
61452908a79ec9 Fangzhi Zuo 2021-06-09  116  	uint32_t speakers = 0;
61452908a79ec9 Fangzhi Zuo 2021-06-09  117  	uint32_t channels = 0;
61452908a79ec9 Fangzhi Zuo 2021-06-09  118
61452908a79ec9 Fangzhi Zuo 2021-06-09  119  	ASSERT(audio_info);
61452908a79ec9 Fangzhi Zuo 2021-06-09  120  	/* This should not happen.it does so we don't get BSOD*/
61452908a79ec9 Fangzhi Zuo 2021-06-09  121  	if (audio_info == NULL)
61452908a79ec9 Fangzhi Zuo 2021-06-09  122  		return;
61452908a79ec9 Fangzhi Zuo 2021-06-09  123
61452908a79ec9 Fangzhi Zuo 2021-06-09 @124  	speakers = audio_info->flags.info.ALLSPEAKERS;
61452908a79ec9 Fangzhi Zuo 2021-06-09 @125  	channels = speakers_to_channels(audio_info->flags.speaker_flags).all;
61452908a79ec9 Fangzhi Zuo 2021-06-09  126
61452908a79ec9 Fangzhi Zuo 2021-06-09  127  	/* DisplayPort only allows for one audio stream with stream ID 0 */
61452908a79ec9 Fangzhi Zuo 2021-06-09  128  	REG_UPDATE(APG_CONTROL2, APG_DP_AUDIO_STREAM_ID, 0);
61452908a79ec9 Fangzhi Zuo 2021-06-09  129
61452908a79ec9 Fangzhi Zuo 2021-06-09  130  	/* When running in "pair mode", pairs of audio channels have their own enable
61452908a79ec9 Fangzhi Zuo 2021-06-09  131  	 * this is for really old audio drivers */
61452908a79ec9 Fangzhi Zuo 2021-06-09  132  	REG_UPDATE(APG_DBG_GEN_CONTROL, APG_DBG_AUDIO_CHANNEL_ENABLE, 0xF);
61452908a79ec9 Fangzhi Zuo 2021-06-09  133  	// REG_UPDATE(APG_DBG_GEN_CONTROL, APG_DBG_AUDIO_CHANNEL_ENABLE, channels);
61452908a79ec9 Fangzhi Zuo 2021-06-09  134
61452908a79ec9 Fangzhi Zuo 2021-06-09  135  	/* Disable forced mem power off */
61452908a79ec9 Fangzhi Zuo 2021-06-09  136  	REG_UPDATE(APG_MEM_PWR, APG_MEM_PWR_FORCE, 0);
61452908a79ec9 Fangzhi Zuo 2021-06-09  137
61452908a79ec9 Fangzhi Zuo 2021-06-09  138  	apg31_enable(apg);
61452908a79ec9 Fangzhi Zuo 2021-06-09  139  }
61452908a79ec9 Fangzhi Zuo 2021-06-09  140

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

           reply	other threads:[~2021-12-07  9:16 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <202111300439.S9nMj4kS-lkp@intel.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=736272c1-4d41-55cd-b14d-c4820c5bcf8b@intel.com \
    --to=yujie.liu@intel.com \
    --cc=Jerry.Zuo@amd.com \
    --cc=Nicholas.Kazlauskas@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox