public inbox for linux-kernel@vger.kernel.org
 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: include/linux/unaligned/be_byteshift.h:26:16: sparse: sparse: cast truncates bits from constant value (7fff becomes ff)
Date: Tue, 7 Jul 2020 23:40:17 +0800	[thread overview]
Message-ID: <202007072300.2eOmL3DD%lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   bfe91da29bfad9941d5d703d45e29f0812a20724
commit: 80591e61a0f7e88deaada69844e4a31280c4a38f kbuild: tell sparse about the $ARCH
date:   8 months ago
config: alpha-randconfig-s032-20200707 (attached as .config)
compiler: alpha-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-31-gabbfd661-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=alpha 

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 >>)

   include/linux/unaligned/be_byteshift.h:26:16: sparse: sparse: cast truncates bits from constant value (800 becomes 0)
   include/linux/unaligned/be_byteshift.h:32:30: sparse: sparse: cast truncates bits from constant value (8000000 becomes 0)
   include/linux/unaligned/be_byteshift.h:26:16: sparse: sparse: cast truncates bits from constant value (800 becomes 0)
   include/linux/unaligned/be_byteshift.h:32:30: sparse: sparse: cast truncates bits from constant value (8000000 becomes 0)
>> include/linux/unaligned/be_byteshift.h:26:16: sparse: sparse: cast truncates bits from constant value (7fff becomes ff)
>> include/linux/unaligned/be_byteshift.h:32:30: sparse: sparse: cast truncates bits from constant value (7fffffff becomes ffff)
>> include/linux/unaligned/be_byteshift.h:38:30: sparse: sparse: cast truncates bits from constant value (7fffffffffffffff becomes ffffffff)

vim +26 include/linux/unaligned/be_byteshift.h

064106a91be5e76 Harvey Harrison 2008-04-29  22  
064106a91be5e76 Harvey Harrison 2008-04-29  23  static inline void __put_unaligned_be16(u16 val, u8 *p)
064106a91be5e76 Harvey Harrison 2008-04-29  24  {
064106a91be5e76 Harvey Harrison 2008-04-29  25  	*p++ = val >> 8;
064106a91be5e76 Harvey Harrison 2008-04-29 @26  	*p++ = val;
064106a91be5e76 Harvey Harrison 2008-04-29  27  }
064106a91be5e76 Harvey Harrison 2008-04-29  28  
064106a91be5e76 Harvey Harrison 2008-04-29  29  static inline void __put_unaligned_be32(u32 val, u8 *p)
064106a91be5e76 Harvey Harrison 2008-04-29  30  {
064106a91be5e76 Harvey Harrison 2008-04-29  31  	__put_unaligned_be16(val >> 16, p);
064106a91be5e76 Harvey Harrison 2008-04-29 @32  	__put_unaligned_be16(val, p + 2);
064106a91be5e76 Harvey Harrison 2008-04-29  33  }
064106a91be5e76 Harvey Harrison 2008-04-29  34  
064106a91be5e76 Harvey Harrison 2008-04-29  35  static inline void __put_unaligned_be64(u64 val, u8 *p)
064106a91be5e76 Harvey Harrison 2008-04-29  36  {
064106a91be5e76 Harvey Harrison 2008-04-29  37  	__put_unaligned_be32(val >> 32, p);
064106a91be5e76 Harvey Harrison 2008-04-29 @38  	__put_unaligned_be32(val, p + 4);
064106a91be5e76 Harvey Harrison 2008-04-29  39  }
064106a91be5e76 Harvey Harrison 2008-04-29  40  

:::::: The code at line 26 was first introduced by commit
:::::: 064106a91be5e76cb42c1ddf5d3871e3a1bd2a23 kernel: add common infrastructure for unaligned access

:::::: TO: Harvey Harrison <harvey.harrison@gmail.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

---
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: 25423 bytes --]

                 reply	other threads:[~2020-07-07 15:43 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=202007072300.2eOmL3DD%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