All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [linux-next:master 1074/9662] drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: non size-preserving integer to pointer cast
Date: Sat, 16 May 2020 09:41:47 +0800	[thread overview]
Message-ID: <202005160943.VsRfcfWH%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4937 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Chris Wilson <chris@chris-wilson.co.uk>
CC: Mika Kuoppala <mika.kuoppala@linux.intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   bdecf38f228bcca73b31ada98b5b7ba1215eb9c9
commit: 29da47cfc1f0c3aad0daa89ccf284c3465971482 [1074/9662] dma-buf: Prettify typecasts for dma-fence-chain
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-193-gb8fad4bc-dirty
        git checkout 29da47cfc1f0c3aad0daa89ccf284c3465971482
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
:::::: branch date: 13 hours ago
:::::: commit date: 5 weeks ago

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


sparse warnings: (new ones prefixed by >>)

>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: non size-preserving integer to pointer cast

# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=29da47cfc1f0c3aad0daa89ccf284c3465971482
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout 29da47cfc1f0c3aad0daa89ccf284c3465971482
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  
29da47cfc1f0c3 Chris Wilson    2020-04-09 @65  		tmp = cmpxchg((struct dma_fence __force **)&chain->prev,
29da47cfc1f0c3 Chris Wilson    2020-04-09  66  			      prev, 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  

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

                 reply	other threads:[~2020-05-16  1:41 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=202005160943.VsRfcfWH%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /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.