Skip to content

Commit 0241fd3

Browse files
author
Nicholas Bellinger
committed
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>
1 parent b25c786 commit 0241fd3

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎drivers/target/target_core_user.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,8 @@ static inline size_t spc_bitmap_free(unsigned long *bitmap)
356356
static bool is_ring_space_avail(struct tcmu_dev *udev, size_t cmd_size, size_t data_needed)
357357
{
358358
struct tcmu_mailbox *mb = udev->mb_addr;
359-
size_t space;
359+
size_t space, cmd_needed;
360360
u32 cmd_head;
361-
size_t cmd_needed;
362361

363362
tcmu_flush_dcache_range(mb, sizeof(*mb));
364363

@@ -382,7 +381,7 @@ static bool is_ring_space_avail(struct tcmu_dev *udev, size_t cmd_size, size_t d
382381

383382
space = spc_bitmap_free(udev->data_bitmap);
384383
if (space < data_needed) {
385-
pr_debug("no data space: only %lu available, but ask for %lu\n",
384+
pr_debug("no data space: only %zu available, but ask for %zu\n",
386385
space, data_needed);
387386
return false;
388387
}

0 commit comments

Comments
 (0)