mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Masahiro Yamada <yamada.masahiro@socionext.com>
Subject: arch/microblaze/include/asm/cmpxchg.h:19:50: sparse: sparse: cast truncates bits from constant value (deadbeef becomes ef)
Date: Sat, 11 Jul 2020 21:18:06 +0800	[thread overview]
Message-ID: <202007112102.SN006RmP%lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1df0d8960499e58963fd6c8ac75e544f2b417b29
commit: 80591e61a0f7e88deaada69844e4a31280c4a38f kbuild: tell sparse about the $ARCH
date:   8 months ago
config: microblaze-randconfig-s031-20200711 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.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.2-37-gc9676a3b-dirty
        git checkout 80591e61a0f7e88deaada69844e4a31280c4a38f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=microblaze 

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


sparse warnings: (new ones prefixed by >>)

>> arch/microblaze/include/asm/cmpxchg.h:19:50: sparse: sparse: cast truncates bits from constant value (deadbeef becomes ef)
>> arch/microblaze/include/asm/cmpxchg.h:19:50: sparse: sparse: cast truncates bits from constant value (deadbeef becomes ef)
>> arch/microblaze/include/asm/cmpxchg.h:19:50: sparse: sparse: cast truncates bits from constant value (deadbeef becomes ef)
>> arch/microblaze/include/asm/cmpxchg.h:19:50: sparse: sparse: cast truncates bits from constant value (deadbeef becomes ef)
   include/asm-generic/cmpxchg-local.h:30:42: sparse: sparse: cast truncates bits from constant value (deadbeef becomes ef)
   include/asm-generic/cmpxchg-local.h:34:44: sparse: sparse: cast truncates bits from constant value (deadbeef becomes beef)
   include/asm-generic/cmpxchg-local.h:30:42: sparse: sparse: cast truncates bits from constant value (deadbeef becomes ef)
   include/asm-generic/cmpxchg-local.h:34:44: sparse: sparse: cast truncates bits from constant value (deadbeef becomes beef)
   include/asm-generic/cmpxchg-local.h:30:42: sparse: sparse: cast truncates bits from constant value (deadbeef becomes ef)
   include/asm-generic/cmpxchg-local.h:34:44: sparse: sparse: cast truncates bits from constant value (deadbeef becomes beef)
   include/asm-generic/cmpxchg-local.h:30:42: sparse: sparse: cast truncates bits from constant value (deadbeef becomes ef)
   include/asm-generic/cmpxchg-local.h:34:44: sparse: sparse: cast truncates bits from constant value (deadbeef becomes beef)
   include/asm-generic/cmpxchg-local.h:30:42: sparse: sparse: cast truncates bits from constant value (deadbeef becomes ef)
   include/asm-generic/cmpxchg-local.h:34:44: sparse: sparse: cast truncates bits from constant value (deadbeef becomes beef)
   include/asm-generic/cmpxchg-local.h:30:42: sparse: sparse: cast truncates bits from constant value (deadbeef becomes ef)
   include/asm-generic/cmpxchg-local.h:34:44: sparse: sparse: cast truncates bits from constant value (deadbeef becomes beef)
   include/asm-generic/cmpxchg-local.h:30:42: sparse: sparse: cast truncates bits from constant value (deadbeef becomes ef)
   include/asm-generic/cmpxchg-local.h:34:44: sparse: sparse: cast truncates bits from constant value (deadbeef becomes beef)
   include/asm-generic/cmpxchg-local.h:30:42: sparse: sparse: cast truncates bits from constant value (deadbeef becomes ef)
   include/asm-generic/cmpxchg-local.h:34:44: sparse: sparse: cast truncates bits from constant value (deadbeef becomes beef)

vim +19 arch/microblaze/include/asm/cmpxchg.h

c40d04df152a11 David Howells 2012-03-28   8  
c40d04df152a11 David Howells 2012-03-28   9  static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
c40d04df152a11 David Howells 2012-03-28  10  								int size)
c40d04df152a11 David Howells 2012-03-28  11  {
c40d04df152a11 David Howells 2012-03-28  12  	unsigned long ret;
c40d04df152a11 David Howells 2012-03-28  13  	unsigned long flags;
c40d04df152a11 David Howells 2012-03-28  14  
c40d04df152a11 David Howells 2012-03-28  15  	switch (size) {
c40d04df152a11 David Howells 2012-03-28  16  	case 1:
c40d04df152a11 David Howells 2012-03-28  17  		local_irq_save(flags);
c40d04df152a11 David Howells 2012-03-28  18  		ret = *(volatile unsigned char *)ptr;
c40d04df152a11 David Howells 2012-03-28 @19  		*(volatile unsigned char *)ptr = x;
c40d04df152a11 David Howells 2012-03-28  20  		local_irq_restore(flags);
c40d04df152a11 David Howells 2012-03-28  21  		break;
c40d04df152a11 David Howells 2012-03-28  22  
c40d04df152a11 David Howells 2012-03-28  23  	case 4:
c40d04df152a11 David Howells 2012-03-28  24  		local_irq_save(flags);
c40d04df152a11 David Howells 2012-03-28  25  		ret = *(volatile unsigned long *)ptr;
c40d04df152a11 David Howells 2012-03-28  26  		*(volatile unsigned long *)ptr = x;
c40d04df152a11 David Howells 2012-03-28  27  		local_irq_restore(flags);
c40d04df152a11 David Howells 2012-03-28  28  		break;
c40d04df152a11 David Howells 2012-03-28  29  	default:
c40d04df152a11 David Howells 2012-03-28  30  		__bad_xchg(ptr, size), ret = 0;
c40d04df152a11 David Howells 2012-03-28  31  		break;
c40d04df152a11 David Howells 2012-03-28  32  	}
c40d04df152a11 David Howells 2012-03-28  33  
c40d04df152a11 David Howells 2012-03-28  34  	return ret;
c40d04df152a11 David Howells 2012-03-28  35  }
c40d04df152a11 David Howells 2012-03-28  36  

:::::: The code at line 19 was first introduced by commit
:::::: c40d04df152a1111c5bbcb632278394dabd2b73d Disintegrate asm/system.h for Microblaze

:::::: TO: David Howells <dhowells@redhat.com>
:::::: CC: David Howells <dhowells@redhat.com>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 23770 bytes --]

                 reply	other threads:[~2020-07-11 13:24 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=202007112102.SN006RmP%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=yamada.masahiro@socionext.com \
    /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®