mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Allison Collins <allison.henderson@oracle.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org
Subject: [allisonhenderson-xfs-work:pptrs_restart129 31/37] include/linux/mman.h:158:9: warning: division by zero is undefined
Date: Mon, 8 Nov 2021 01:03:23 +0800	[thread overview]
Message-ID: <202111080110.v4YgJEi0-lkp@intel.com> (raw)

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

tree:   https://github.com/allisonhenderson/xfs_work.git pptrs_restart129
head:   f0a0e96bd7e03c467041931dc1b9663111f1d365
commit: 72e3522333e0467ce3829aa51dcaaaa8e828b3ab [31/37] xfs: Add helper function xfs_attr_list_context_init
config: mips-buildonly-randconfig-r004-20211014 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 6c76d0101193aa4eb891a6954ff047eda2f9cf71)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://github.com/allisonhenderson/xfs_work/commit/72e3522333e0467ce3829aa51dcaaaa8e828b3ab
        git remote add allisonhenderson-xfs-work https://github.com/allisonhenderson/xfs_work.git
        git fetch --no-tags allisonhenderson-xfs-work pptrs_restart129
        git checkout 72e3522333e0467ce3829aa51dcaaaa8e828b3ab
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=mips 

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

All warnings (new ones prefixed by >>):

   In file included from fs/xfs/xfs_file.c:20:
   fs/xfs/libxfs/xfs_attr.h:33:21: error: no member named 'larp' in 'struct xfs_globals'
           return xfs_globals.larp;
                  ~~~~~~~~~~~ ^
   In file included from fs/xfs/xfs_file.c:31:
>> include/linux/mman.h:158:9: warning: division by zero is undefined [-Wdivision-by-zero]
                  _calc_vm_trans(flags, MAP_SYNC,       VM_SYNC      ) |
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/mman.h:134:48: note: expanded from macro '_calc_vm_trans'
     ((bit1) <= (bit2) ? ((x) & (bit1)) * ((bit2) / (bit1)) \
                                                  ^ ~~~~~~
>> include/linux/mman.h:158:9: warning: division by zero is undefined [-Wdivision-by-zero]
                  _calc_vm_trans(flags, MAP_SYNC,       VM_SYNC      ) |
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/mman.h:135:21: note: expanded from macro '_calc_vm_trans'
      : ((x) & (bit1)) / ((bit1) / (bit2))))
                       ^ ~~~~~~~~~~~~~~~~~
   2 warnings and 1 error generated.


vim +158 include/linux/mman.h

^1da177e4c3f41 Linus Torvalds  2005-04-16  148  
^1da177e4c3f41 Linus Torvalds  2005-04-16  149  /*
^1da177e4c3f41 Linus Torvalds  2005-04-16  150   * Combine the mmap "flags" argument into "vm_flags" used internally.
^1da177e4c3f41 Linus Torvalds  2005-04-16  151   */
^1da177e4c3f41 Linus Torvalds  2005-04-16  152  static inline unsigned long
^1da177e4c3f41 Linus Torvalds  2005-04-16  153  calc_vm_flag_bits(unsigned long flags)
^1da177e4c3f41 Linus Torvalds  2005-04-16  154  {
^1da177e4c3f41 Linus Torvalds  2005-04-16  155  	return _calc_vm_trans(flags, MAP_GROWSDOWN,  VM_GROWSDOWN ) |
^1da177e4c3f41 Linus Torvalds  2005-04-16  156  	       _calc_vm_trans(flags, MAP_DENYWRITE,  VM_DENYWRITE ) |
b6fb293f2497a9 Jan Kara        2017-11-01  157  	       _calc_vm_trans(flags, MAP_LOCKED,     VM_LOCKED    ) |
b3fbbea4c00220 Kevin Brodsky   2019-11-25 @158  	       _calc_vm_trans(flags, MAP_SYNC,	     VM_SYNC      ) |
b3fbbea4c00220 Kevin Brodsky   2019-11-25  159  	       arch_calc_vm_flag_bits(flags);
^1da177e4c3f41 Linus Torvalds  2005-04-16  160  }
00619bcc44d6b7 Jerome Marchand 2013-11-12  161  

:::::: The code at line 158 was first introduced by commit
:::::: b3fbbea4c00220f62e6f7e2514466e6ee81f7f60 mm: Introduce arch_calc_vm_flag_bits()

:::::: TO: Kevin Brodsky <Kevin.Brodsky@arm.com>
:::::: CC: Catalin Marinas <catalin.marinas@arm.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: 35443 bytes --]

                 reply	other threads:[~2021-11-07 17:04 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=202111080110.v4YgJEi0-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=allison.henderson@oracle.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@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 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®