mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Christian König" <christian.koenig@amd.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [drm-misc:drm-misc-next 1/1] drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
Date: Wed, 8 Jun 2022 01:07:39 +0800	[thread overview]
Message-ID: <202206080105.4Bm4v1ri-lkp@intel.com> (raw)

tree:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head:   dfa687bffc8a4a21ed929c7dececf01b8f1f52ee
commit: 14374e3eee1b02dbf162e1dd75b789373f07ef43 [1/1] dma-buf: cleanup dma_fence_chain_walk
config: ia64-randconfig-s032-20220605 (https://download.01.org/0day-ci/archive/20220608/202206080105.4Bm4v1ri-lkp@intel.com/config)
compiler: ia64-linux-gcc (GCC) 11.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-26-gb3cf30ba-dirty
        git remote add drm-misc git://anongit.freedesktop.org/drm/drm-misc
        git fetch --no-tags drm-misc drm-misc-next
        git checkout 14374e3eee1b02dbf162e1dd75b789373f07ef43
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/dma-buf/

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


sparse warnings: (new ones prefixed by >>)
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression
>> drivers/dma-buf/dma-fence-chain.c:65:23: sparse: sparse: cast removes address space '__rcu' of expression

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

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

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

                 reply	other threads:[~2022-06-07 19:08 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=202206080105.4Bm4v1ri-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.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 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®