mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <yujie.liu@intel.com>
To: "Christian König" <christian.koenig@amd.com>
Cc: <llvm@lists.linux.dev>, <kbuild-all@lists.01.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [drm-misc:for-linux-next 2/3] drivers/dma-buf/st-dma-fence-unwrap.c:148:4: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
Date: Mon, 28 Mar 2022 12:59:46 +0800	[thread overview]
Message-ID: <0daa1ccb-3ca1-480b-9965-62f62342f901@intel.com> (raw)
In-Reply-To: <202203270435.TtRcG3Pv-lkp@intel.com>

tree:   git://anongit.freedesktop.org/drm/drm-misc for-linux-next
head:   519f490db07e1a539490612f376487f61e48e39c
commit: 64a8f92fd783e750cdb81af75942dcd53bbf61bd [2/3] dma-buf: add dma_fence_unwrap v2
config: riscv-randconfig-c006-20220324 (https://download.01.org/0day-ci/archive/20220327/202203270435.TtRcG3Pv-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0f6d9501cf49ce02937099350d08f20c4af86f3d)
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
         # install riscv cross compiling tool for clang build
         # apt-get install binutils-riscv64-linux-gnu
         git remote add drm-misc git://anongit.freedesktop.org/drm/drm-misc
         git fetch --no-tags drm-misc for-linux-next
         git checkout 64a8f92fd783e750cdb81af75942dcd53bbf61bd
         # save the config file to linux build tree
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer

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


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

 >> drivers/dma-buf/st-dma-fence-unwrap.c:148:4: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                            err = -EINVAL;
                            ^     ~~~~~~~

vim +/err +148 drivers/dma-buf/st-dma-fence-unwrap.c

64a8f92fd783e75 Christian König 2022-03-11  120
64a8f92fd783e75 Christian König 2022-03-11  121  static int unwrap_array(void *arg)
64a8f92fd783e75 Christian König 2022-03-11  122  {
64a8f92fd783e75 Christian König 2022-03-11  123  	struct dma_fence *fence, *f1, *f2, *array;
64a8f92fd783e75 Christian König 2022-03-11  124  	struct dma_fence_unwrap iter;
64a8f92fd783e75 Christian König 2022-03-11  125  	int err = 0;
64a8f92fd783e75 Christian König 2022-03-11  126
64a8f92fd783e75 Christian König 2022-03-11  127  	f1 = mock_fence();
64a8f92fd783e75 Christian König 2022-03-11  128  	if (!f1)
64a8f92fd783e75 Christian König 2022-03-11  129  		return -ENOMEM;
64a8f92fd783e75 Christian König 2022-03-11  130
64a8f92fd783e75 Christian König 2022-03-11  131  	f2 = mock_fence();
64a8f92fd783e75 Christian König 2022-03-11  132  	if (!f2) {
64a8f92fd783e75 Christian König 2022-03-11  133  		dma_fence_put(f1);
64a8f92fd783e75 Christian König 2022-03-11  134  		return -ENOMEM;
64a8f92fd783e75 Christian König 2022-03-11  135  	}
64a8f92fd783e75 Christian König 2022-03-11  136
64a8f92fd783e75 Christian König 2022-03-11  137  	array = mock_array(2, f1, f2);
64a8f92fd783e75 Christian König 2022-03-11  138  	if (!array)
64a8f92fd783e75 Christian König 2022-03-11  139  		return -ENOMEM;
64a8f92fd783e75 Christian König 2022-03-11  140
64a8f92fd783e75 Christian König 2022-03-11  141  	dma_fence_unwrap_for_each(fence, &iter, array) {
64a8f92fd783e75 Christian König 2022-03-11  142  		if (fence == f1) {
64a8f92fd783e75 Christian König 2022-03-11  143  			f1 = NULL;
64a8f92fd783e75 Christian König 2022-03-11  144  		} else if (fence == f2) {
64a8f92fd783e75 Christian König 2022-03-11  145  			f2 = NULL;
64a8f92fd783e75 Christian König 2022-03-11  146  		} else {
64a8f92fd783e75 Christian König 2022-03-11  147  			pr_err("Unexpected fence!\n");
64a8f92fd783e75 Christian König 2022-03-11 @148  			err = -EINVAL;
64a8f92fd783e75 Christian König 2022-03-11  149  		}
64a8f92fd783e75 Christian König 2022-03-11  150  	}
64a8f92fd783e75 Christian König 2022-03-11  151
64a8f92fd783e75 Christian König 2022-03-11  152  	if (f1 || f2) {
64a8f92fd783e75 Christian König 2022-03-11  153  		pr_err("Not all fences seen!\n");
64a8f92fd783e75 Christian König 2022-03-11 @154  		err = -EINVAL;
64a8f92fd783e75 Christian König 2022-03-11  155  	}
64a8f92fd783e75 Christian König 2022-03-11  156
64a8f92fd783e75 Christian König 2022-03-11  157  	dma_fence_signal(f1);
64a8f92fd783e75 Christian König 2022-03-11  158  	dma_fence_signal(f2);
64a8f92fd783e75 Christian König 2022-03-11  159  	dma_fence_put(array);
64a8f92fd783e75 Christian König 2022-03-11  160  	return 0;
64a8f92fd783e75 Christian König 2022-03-11  161  }
64a8f92fd783e75 Christian König 2022-03-11  162

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

           reply	other threads:[~2022-03-28  5:00 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <202203270435.TtRcG3Pv-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=0daa1ccb-3ca1-480b-9965-62f62342f901@intel.com \
    --to=yujie.liu@intel.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel.vetter@ffwll.ch \
    --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

all inboxes | Powered by JetHome®