From: kernel test robot <lkp@intel.com>
To: Li Feng <fengli@smartx.com>, Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
lifeng1519@gmail.com, Li Feng <fengli@smartx.com>
Subject: Re: [PATCH] blk: avoid divide-by-zero with zero granularity
Date: Wed, 13 Jan 2021 05:49:31 +0800 [thread overview]
Message-ID: <202101130537.tNx9aHkp-lkp@intel.com> (raw)
In-Reply-To: <20210112152951.154024-1-fengli@smartx.com>
[-- Attachment #1: Type: text/plain, Size: 15673 bytes --]
Hi Li,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on block/for-next]
[also build test WARNING on v5.11-rc3 next-20210112]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Li-Feng/blk-avoid-divide-by-zero-with-zero-granularity/20210112-233454
base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
config: arm-randconfig-r012-20210112 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 32bcfcda4e28375e5a85268d2acfabcfcc011abf)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/0day-ci/linux/commit/796e67f6b22f94f155669688e5e08281621b3ee6
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Li-Feng/blk-avoid-divide-by-zero-with-zero-granularity/20210112-233454
git checkout 796e67f6b22f94f155669688e5e08281621b3ee6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
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 drivers/ata/ahci_ceva.c:11:
In file included from include/linux/libata.h:21:
In file included from include/scsi/scsi_host.h:11:
In file included from include/linux/blk-mq.h:5:
>> include/linux/blkdev.h:1492:15: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
^
drivers/ata/ahci_ceva.c:187:2: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:387:16: note: expanded from macro 'AHCI_SHT'
.can_queue = AHCI_MAX_CMDS, \
^~~~~~~~~~~~~
drivers/ata/ahci_ceva.c:187:2: note: previous initialization is here
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:386:2: note: expanded from macro 'AHCI_SHT'
ATA_NCQ_SHT(drv_name), \
^~~~~~~~~~~~~~~~~~~~~
include/linux/libata.h:1418:2: note: expanded from macro 'ATA_NCQ_SHT'
__ATA_BASE_SHT(drv_name), \
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/libata.h:1400:16: note: expanded from macro '__ATA_BASE_SHT'
.can_queue = ATA_DEF_QUEUE, \
^~~~~~~~~~~~~
drivers/ata/ahci_ceva.c:187:2: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:391:17: note: expanded from macro 'AHCI_SHT'
.sdev_attrs = ahci_sdev_attrs
^~~~~~~~~~~~~~~
drivers/ata/ahci_ceva.c:187:2: note: previous initialization is here
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:386:2: note: expanded from macro 'AHCI_SHT'
ATA_NCQ_SHT(drv_name), \
^~~~~~~~~~~~~~~~~~~~~
include/linux/libata.h:1419:17: note: expanded from macro 'ATA_NCQ_SHT'
.sdev_attrs = ata_ncq_sdev_attrs, \
^~~~~~~~~~~~~~~~~~
3 warnings generated.
--
In file included from drivers/ata/ahci_sunxi.c:19:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
>> include/linux/blkdev.h:1492:15: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
^
drivers/ata/ahci_sunxi.c:210:2: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:387:16: note: expanded from macro 'AHCI_SHT'
.can_queue = AHCI_MAX_CMDS, \
^~~~~~~~~~~~~
drivers/ata/ahci_sunxi.c:210:2: note: previous initialization is here
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:386:2: note: expanded from macro 'AHCI_SHT'
ATA_NCQ_SHT(drv_name), \
^~~~~~~~~~~~~~~~~~~~~
include/linux/libata.h:1418:2: note: expanded from macro 'ATA_NCQ_SHT'
__ATA_BASE_SHT(drv_name), \
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/libata.h:1400:16: note: expanded from macro '__ATA_BASE_SHT'
.can_queue = ATA_DEF_QUEUE, \
^~~~~~~~~~~~~
drivers/ata/ahci_sunxi.c:210:2: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:391:17: note: expanded from macro 'AHCI_SHT'
.sdev_attrs = ahci_sdev_attrs
^~~~~~~~~~~~~~~
drivers/ata/ahci_sunxi.c:210:2: note: previous initialization is here
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:386:2: note: expanded from macro 'AHCI_SHT'
ATA_NCQ_SHT(drv_name), \
^~~~~~~~~~~~~~~~~~~~~
include/linux/libata.h:1419:17: note: expanded from macro 'ATA_NCQ_SHT'
.sdev_attrs = ata_ncq_sdev_attrs, \
^~~~~~~~~~~~~~~~~~
3 warnings generated.
--
In file included from drivers/ata/ahci_st.c:16:
In file included from include/linux/libata.h:21:
In file included from include/scsi/scsi_host.h:11:
In file included from include/linux/blk-mq.h:5:
>> include/linux/blkdev.h:1492:15: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
^
drivers/ata/ahci_st.c:142:2: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:387:16: note: expanded from macro 'AHCI_SHT'
.can_queue = AHCI_MAX_CMDS, \
^~~~~~~~~~~~~
drivers/ata/ahci_st.c:142:2: note: previous initialization is here
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:386:2: note: expanded from macro 'AHCI_SHT'
ATA_NCQ_SHT(drv_name), \
^~~~~~~~~~~~~~~~~~~~~
include/linux/libata.h:1418:2: note: expanded from macro 'ATA_NCQ_SHT'
__ATA_BASE_SHT(drv_name), \
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/libata.h:1400:16: note: expanded from macro '__ATA_BASE_SHT'
.can_queue = ATA_DEF_QUEUE, \
^~~~~~~~~~~~~
drivers/ata/ahci_st.c:142:2: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:391:17: note: expanded from macro 'AHCI_SHT'
.sdev_attrs = ahci_sdev_attrs
^~~~~~~~~~~~~~~
drivers/ata/ahci_st.c:142:2: note: previous initialization is here
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:386:2: note: expanded from macro 'AHCI_SHT'
ATA_NCQ_SHT(drv_name), \
^~~~~~~~~~~~~~~~~~~~~
include/linux/libata.h:1419:17: note: expanded from macro 'ATA_NCQ_SHT'
.sdev_attrs = ata_ncq_sdev_attrs, \
^~~~~~~~~~~~~~~~~~
3 warnings generated.
--
In file included from drivers/ata/pata_platform.c:16:
>> include/linux/blkdev.h:1492:15: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
^
1 warning generated.
--
In file included from drivers/ata/ahci_imx.c:18:
In file included from include/linux/libata.h:21:
In file included from include/scsi/scsi_host.h:11:
In file included from include/linux/blk-mq.h:5:
>> include/linux/blkdev.h:1492:15: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
^
drivers/ata/ahci_imx.c:978:2: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:387:16: note: expanded from macro 'AHCI_SHT'
.can_queue = AHCI_MAX_CMDS, \
^~~~~~~~~~~~~
drivers/ata/ahci_imx.c:978:2: note: previous initialization is here
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:386:2: note: expanded from macro 'AHCI_SHT'
ATA_NCQ_SHT(drv_name), \
^~~~~~~~~~~~~~~~~~~~~
include/linux/libata.h:1418:2: note: expanded from macro 'ATA_NCQ_SHT'
__ATA_BASE_SHT(drv_name), \
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/libata.h:1400:16: note: expanded from macro '__ATA_BASE_SHT'
.can_queue = ATA_DEF_QUEUE, \
^~~~~~~~~~~~~
drivers/ata/ahci_imx.c:978:2: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:391:17: note: expanded from macro 'AHCI_SHT'
.sdev_attrs = ahci_sdev_attrs
^~~~~~~~~~~~~~~
drivers/ata/ahci_imx.c:978:2: note: previous initialization is here
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:386:2: note: expanded from macro 'AHCI_SHT'
ATA_NCQ_SHT(drv_name), \
^~~~~~~~~~~~~~~~~~~~~
include/linux/libata.h:1419:17: note: expanded from macro 'ATA_NCQ_SHT'
.sdev_attrs = ata_ncq_sdev_attrs, \
^~~~~~~~~~~~~~~~~~
3 warnings generated.
--
In file included from drivers/ata/ahci_tegra.c:17:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
>> include/linux/blkdev.h:1492:15: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
^
drivers/ata/ahci_tegra.c:477:2: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:387:16: note: expanded from macro 'AHCI_SHT'
.can_queue = AHCI_MAX_CMDS, \
^~~~~~~~~~~~~
drivers/ata/ahci_tegra.c:477:2: note: previous initialization is here
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:386:2: note: expanded from macro 'AHCI_SHT'
ATA_NCQ_SHT(drv_name), \
^~~~~~~~~~~~~~~~~~~~~
include/linux/libata.h:1418:2: note: expanded from macro 'ATA_NCQ_SHT'
__ATA_BASE_SHT(drv_name), \
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/libata.h:1400:16: note: expanded from macro '__ATA_BASE_SHT'
.can_queue = ATA_DEF_QUEUE, \
^~~~~~~~~~~~~
drivers/ata/ahci_tegra.c:477:2: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:391:17: note: expanded from macro 'AHCI_SHT'
.sdev_attrs = ahci_sdev_attrs
^~~~~~~~~~~~~~~
drivers/ata/ahci_tegra.c:477:2: note: previous initialization is here
AHCI_SHT(DRV_NAME),
^~~~~~~~~~~~~~~~~~
drivers/ata/ahci.h:386:2: note: expanded from macro 'AHCI_SHT'
ATA_NCQ_SHT(drv_name), \
^~~~~~~~~~~~~~~~~~~~~
include/linux/libata.h:1419:17: note: expanded from macro 'ATA_NCQ_SHT'
.sdev_attrs = ata_ncq_sdev_attrs, \
^~~~~~~~~~~~~~~~~~
3 warnings generated.
vim +1492 include/linux/blkdev.h
c72758f33784e5e2 Martin K. Petersen 2009-05-22 1484
e03a72e13648ac62 Martin K. Petersen 2010-01-11 1485 static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
81744ee44ab2845c Martin K. Petersen 2009-12-29 1486 {
81744ee44ab2845c Martin K. Petersen 2009-12-29 1487 unsigned int granularity = max(lim->physical_block_size, lim->io_min);
796e67f6b22f94f1 Li Feng 2021-01-12 1488 granularity = granularity >> SECTOR_SHIFT;
796e67f6b22f94f1 Li Feng 2021-01-12 1489 if (!granularity)
796e67f6b22f94f1 Li Feng 2021-01-12 1490 return 0;
796e67f6b22f94f1 Li Feng 2021-01-12 1491
233bde21aa43516b Bart Van Assche 2018-03-14 @1492 unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
233bde21aa43516b Bart Van Assche 2018-03-14 1493 << SECTOR_SHIFT;
81744ee44ab2845c Martin K. Petersen 2009-12-29 1494
b8839b8c55f3fdd6 Mike Snitzer 2014-10-08 1495 return (granularity + lim->alignment_offset - alignment) % granularity;
c72758f33784e5e2 Martin K. Petersen 2009-05-22 1496 }
c72758f33784e5e2 Martin K. Petersen 2009-05-22 1497
---
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: 37822 bytes --]
next prev parent reply other threads:[~2021-01-12 21:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-12 15:29 [PATCH] blk: avoid divide-by-zero with zero granularity Li Feng
2021-01-12 15:34 ` Feng Li
2021-01-12 15:55 ` [PATCH v2] " Li Feng
2021-01-12 17:10 ` Martin K. Petersen
2021-01-12 17:27 ` Feng Li
2021-01-12 17:36 ` Johannes Thumshirn
2021-01-12 17:46 ` Martin K. Petersen
2021-01-13 2:42 ` Li Feng
2021-01-12 18:42 ` [PATCH] " kernel test robot
2021-01-12 21:49 ` kernel test robot [this message]
2021-01-12 22:57 ` kernel test robot
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=202101130537.tNx9aHkp-lkp@intel.com \
--to=lkp@intel.com \
--cc=axboe@kernel.dk \
--cc=clang-built-linux@googlegroups.com \
--cc=fengli@smartx.com \
--cc=kbuild-all@lists.01.org \
--cc=lifeng1519@gmail.com \
--cc=linux-block@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).