Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

target/user: Fix size_t format-spec build warning

Fix the following printk size_t warning as per 0-day build:

All warnings (new ones prefixed by >>):

drivers/target/target_core_user.c: In function 'is_ring_space_avail':
>> drivers/target/target_core_user.c:385:12: warning: format '%lu'
>> expects argument of type 'long unsigned int', but argument 3 has type
>> 'size_t {aka unsigned int}' [-Wformat=]
pr_debug("no data space: only %lu available, but ask for %lu\n",
^

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

+2 -3
+2 -3
drivers/target/target_core_user.c
··· 356 356 static bool is_ring_space_avail(struct tcmu_dev *udev, size_t cmd_size, size_t data_needed) 357 357 { 358 358 struct tcmu_mailbox *mb = udev->mb_addr; 359 - size_t space; 359 + size_t space, cmd_needed; 360 360 u32 cmd_head; 361 - size_t cmd_needed; 362 361 363 362 tcmu_flush_dcache_range(mb, sizeof(*mb)); 364 363 ··· 381 382 382 383 space = spc_bitmap_free(udev->data_bitmap); 383 384 if (space < data_needed) { 384 - pr_debug("no data space: only %lu available, but ask for %lu\n", 385 + pr_debug("no data space: only %zu available, but ask for %zu\n", 385 386 space, data_needed); 386 387 return false; 387 388 }