From: kernel test robot <lkp@intel.com>
To: John Garry <john.g.garry@oracle.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Jens Axboe <axboe@kernel.dk>,
Himanshu Madhani <himanshu.madhani@oracle.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Keith Busch <kbusch@kernel.org>
Subject: [axboe-block:for-next 69/81] block/blk-settings.c:200:20: error: incompatible pointer types passing 'unsigned int *' to parameter of type 'uint64_t *' (aka 'unsigned long long *')
Date: Sat, 22 Jun 2024 05:56:20 +0800 [thread overview]
Message-ID: <202406220538.GuaaK0FH-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
head: b398f439dc8f6eeb855ba46842cb5d127f39ae77
commit: 9da3d1e912f3953196e66991d75208cde3e845e1 [69/81] block: Add core atomic write support
config: arm-randconfig-003-20240622 (https://download.01.org/0day-ci/archive/20240622/202406220538.GuaaK0FH-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240622/202406220538.GuaaK0FH-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406220538.GuaaK0FH-lkp@intel.com/
Note: the axboe-block/for-next HEAD b398f439dc8f6eeb855ba46842cb5d127f39ae77 builds fine.
It only hurts bisectability.
All error/warnings (new ones prefixed by >>):
>> block/blk-settings.c:200:20: warning: comparison of distinct pointer types ('typeof ((chunk_sectors)) *' (aka 'unsigned int *') and 'uint64_t *' (aka 'unsigned long long *')) [-Wcompare-distinct-pointer-types]
if (WARN_ON_ONCE(do_div(chunk_sectors, boundary_sectors)))
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/div64.h:222:28: note: expanded from macro 'do_div'
(void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
^ ~~~~~~~~~~~~~~~
include/asm-generic/bug.h:148:18: note: expanded from macro 'WARN_ON_ONCE'
DO_ONCE_LITE_IF(condition, WARN_ON, 1)
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
include/linux/once_lite.h:28:27: note: expanded from macro 'DO_ONCE_LITE_IF'
bool __ret_do_once = !!(condition); \
^~~~~~~~~
>> block/blk-settings.c:200:20: error: incompatible pointer types passing 'unsigned int *' to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
if (WARN_ON_ONCE(do_div(chunk_sectors, boundary_sectors)))
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/div64.h:238:22: note: expanded from macro 'do_div'
__rem = __div64_32(&(n), __base); \
^
include/asm-generic/bug.h:148:18: note: expanded from macro 'WARN_ON_ONCE'
DO_ONCE_LITE_IF(condition, WARN_ON, 1)
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
include/linux/once_lite.h:28:27: note: expanded from macro 'DO_ONCE_LITE_IF'
bool __ret_do_once = !!(condition); \
^~~~~~~~~
arch/arm/include/asm/div64.h:24:45: note: passing argument to parameter 'n' here
static inline uint32_t __div64_32(uint64_t *n, uint32_t base)
^
>> block/blk-settings.c:200:20: warning: shift count >= width of type [-Wshift-count-overflow]
if (WARN_ON_ONCE(do_div(chunk_sectors, boundary_sectors)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/div64.h:234:25: note: expanded from macro 'do_div'
} else if (likely(((n) >> 32) == 0)) { \
^ ~~
include/linux/compiler.h:76:40: note: expanded from macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
include/asm-generic/bug.h:148:18: note: expanded from macro 'WARN_ON_ONCE'
DO_ONCE_LITE_IF(condition, WARN_ON, 1)
^~~~~~~~~
include/linux/once_lite.h:28:27: note: expanded from macro 'DO_ONCE_LITE_IF'
bool __ret_do_once = !!(condition); \
^~~~~~~~~
2 warnings and 1 error generated.
vim +200 block/blk-settings.c
175
176 static void blk_validate_atomic_write_limits(struct queue_limits *lim)
177 {
178 unsigned int chunk_sectors = lim->chunk_sectors;
179 unsigned int boundary_sectors;
180
181 if (!lim->atomic_write_hw_max)
182 goto unsupported;
183
184 boundary_sectors = lim->atomic_write_hw_boundary >> SECTOR_SHIFT;
185
186 if (boundary_sectors) {
187 /*
188 * A feature of boundary support is that it disallows bios to
189 * be merged which would result in a merged request which
190 * crosses either a chunk sector or atomic write HW boundary,
191 * even though chunk sectors may be just set for performance.
192 * For simplicity, disallow atomic writes for a chunk sector
193 * which is non-zero and smaller than atomic write HW boundary.
194 * Furthermore, chunk sectors must be a multiple of atomic
195 * write HW boundary. Otherwise boundary support becomes
196 * complicated.
197 * Devices which do not conform to these rules can be dealt
198 * with if and when they show up.
199 */
> 200 if (WARN_ON_ONCE(do_div(chunk_sectors, boundary_sectors)))
201 goto unsupported;
202
203 /*
204 * The boundary size just needs to be a multiple of unit_max
205 * (and not necessarily a power-of-2), so this following check
206 * could be relaxed in future.
207 * Furthermore, if needed, unit_max could even be reduced so
208 * that it is compliant with a !power-of-2 boundary.
209 */
210 if (!is_power_of_2(boundary_sectors))
211 goto unsupported;
212 }
213
214 blk_atomic_writes_update_limits(lim);
215 return;
216
217 unsupported:
218 lim->atomic_write_max_sectors = 0;
219 lim->atomic_write_boundary_sectors = 0;
220 lim->atomic_write_unit_min = 0;
221 lim->atomic_write_unit_max = 0;
222 }
223
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-06-21 21:56 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=202406220538.GuaaK0FH-lkp@intel.com \
--to=lkp@intel.com \
--cc=axboe@kernel.dk \
--cc=himanshu.madhani@oracle.com \
--cc=john.g.garry@oracle.com \
--cc=kbusch@kernel.org \
--cc=llvm@lists.linux.dev \
--cc=martin.petersen@oracle.com \
--cc=oe-kbuild-all@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