All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: elver@google.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [melver:cap-analysis/dev 14/26] drivers/dma-buf/dma-fence-chain.c:65:21: sparse: sparse: incorrect type in assignment (different base types)
Date: Fri, 14 Feb 2025 00:32:34 +0800	[thread overview]
Message-ID: <202502140014.CYel5X8d-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/melver/linux.git cap-analysis/dev
head:   9c8d14ce8aff2d38bf494f5d5436a302e3236842
commit: f7039fb7b3a9459a6c5ed166c267bdf294492c1b [14/26] rcu: Support Clang's capability analysis
config: arc-randconfig-r112-20250213 (https://download.01.org/0day-ci/archive/20250214/202502140014.CYel5X8d-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20250214/202502140014.CYel5X8d-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502140014.CYel5X8d-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/dma-buf/dma-fence-chain.c:65:21: sparse: sparse: incorrect type in assignment (different base types) @@     expected struct dma_fence *tmp @@     got void @@
   drivers/dma-buf/dma-fence-chain.c:65:21: sparse:     expected struct dma_fence *tmp
   drivers/dma-buf/dma-fence-chain.c:65:21: sparse:     got void

vim +65 drivers/dma-buf/dma-fence-chain.c

7bf60c52e093d9 Christian König 2019-04-01  30  
7bf60c52e093d9 Christian König 2019-04-01  31  /**
7bf60c52e093d9 Christian König 2019-04-01  32   * dma_fence_chain_walk - chain walking function
7bf60c52e093d9 Christian König 2019-04-01  33   * @fence: current chain node
7bf60c52e093d9 Christian König 2019-04-01  34   *
7bf60c52e093d9 Christian König 2019-04-01  35   * Walk the chain to the next node. Returns the next fence or NULL if we are at
7bf60c52e093d9 Christian König 2019-04-01  36   * the end of the chain. Garbage collects chain nodes which are already
7bf60c52e093d9 Christian König 2019-04-01  37   * signaled.
7bf60c52e093d9 Christian König 2019-04-01  38   */
7bf60c52e093d9 Christian König 2019-04-01  39  struct dma_fence *dma_fence_chain_walk(struct dma_fence *fence)
7bf60c52e093d9 Christian König 2019-04-01  40  {
7bf60c52e093d9 Christian König 2019-04-01  41  	struct dma_fence_chain *chain, *prev_chain;
7bf60c52e093d9 Christian König 2019-04-01  42  	struct dma_fence *prev, *replacement, *tmp;
7bf60c52e093d9 Christian König 2019-04-01  43  
7bf60c52e093d9 Christian König 2019-04-01  44  	chain = to_dma_fence_chain(fence);
7bf60c52e093d9 Christian König 2019-04-01  45  	if (!chain) {
7bf60c52e093d9 Christian König 2019-04-01  46  		dma_fence_put(fence);
7bf60c52e093d9 Christian König 2019-04-01  47  		return NULL;
7bf60c52e093d9 Christian König 2019-04-01  48  	}
7bf60c52e093d9 Christian König 2019-04-01  49  
7bf60c52e093d9 Christian König 2019-04-01  50  	while ((prev = dma_fence_chain_get_prev(chain))) {
7bf60c52e093d9 Christian König 2019-04-01  51  
7bf60c52e093d9 Christian König 2019-04-01  52  		prev_chain = to_dma_fence_chain(prev);
7bf60c52e093d9 Christian König 2019-04-01  53  		if (prev_chain) {
7bf60c52e093d9 Christian König 2019-04-01  54  			if (!dma_fence_is_signaled(prev_chain->fence))
7bf60c52e093d9 Christian König 2019-04-01  55  				break;
7bf60c52e093d9 Christian König 2019-04-01  56  
7bf60c52e093d9 Christian König 2019-04-01  57  			replacement = dma_fence_chain_get_prev(prev_chain);
7bf60c52e093d9 Christian König 2019-04-01  58  		} else {
7bf60c52e093d9 Christian König 2019-04-01  59  			if (!dma_fence_is_signaled(prev))
7bf60c52e093d9 Christian König 2019-04-01  60  				break;
7bf60c52e093d9 Christian König 2019-04-01  61  
7bf60c52e093d9 Christian König 2019-04-01  62  			replacement = NULL;
7bf60c52e093d9 Christian König 2019-04-01  63  		}
7bf60c52e093d9 Christian König 2019-04-01  64  
14374e3eee1b02 Christian König 2022-05-11 @65  		tmp = unrcu_pointer(cmpxchg(&chain->prev, RCU_INITIALIZER(prev),
14374e3eee1b02 Christian König 2022-05-11  66  					     RCU_INITIALIZER(replacement)));
7bf60c52e093d9 Christian König 2019-04-01  67  		if (tmp == prev)
7bf60c52e093d9 Christian König 2019-04-01  68  			dma_fence_put(tmp);
7bf60c52e093d9 Christian König 2019-04-01  69  		else
7bf60c52e093d9 Christian König 2019-04-01  70  			dma_fence_put(replacement);
7bf60c52e093d9 Christian König 2019-04-01  71  		dma_fence_put(prev);
7bf60c52e093d9 Christian König 2019-04-01  72  	}
7bf60c52e093d9 Christian König 2019-04-01  73  
7bf60c52e093d9 Christian König 2019-04-01  74  	dma_fence_put(fence);
7bf60c52e093d9 Christian König 2019-04-01  75  	return prev;
7bf60c52e093d9 Christian König 2019-04-01  76  }
7bf60c52e093d9 Christian König 2019-04-01  77  EXPORT_SYMBOL(dma_fence_chain_walk);
7bf60c52e093d9 Christian König 2019-04-01  78  

:::::: The code at line 65 was first introduced by commit
:::::: 14374e3eee1b02dbf162e1dd75b789373f07ef43 dma-buf: cleanup dma_fence_chain_walk

:::::: TO: Christian König <christian.koenig@amd.com>
:::::: CC: Christian König <christian.koenig@amd.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2025-02-13 16:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202502140014.CYel5X8d-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=elver@google.com \
    --cc=oe-kbuild-all@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.