Re: [target:for-next 32/33] 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}'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2016-02-28 at 09:03 +0800, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git for-next
> head:   dfa462fc9b909fd0fe17616ad5b74e794625339c
> commit: b0693b3011de734d8ba863de1349d1a42edeaf15 [32/33] target/user: Introduce data_bitmap, replace data_length/data_head/data_tail
> config: i386-allmodconfig (attached as .config)
> reproduce:
>         git checkout b0693b3011de734d8ba863de1349d1a42edeaf15
>         # save the attached .config to linux build tree
>         make ARCH=i386 
> 
> All warnings (new ones prefixed by >>):
> 
>    In file included from include/linux/kernel.h:13:0,
>                     from include/linux/list.h:8,
>                     from include/linux/preempt.h:10,
>                     from include/linux/spinlock.h:50,
>                     from drivers/target/target_core_user.c:20:
>    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",
>                ^
>    include/linux/printk.h:236:21: note: in definition of macro 'pr_fmt'
>     #define pr_fmt(fmt) fmt
>                         ^
>    include/linux/printk.h:283:2: note: in expansion of macro 'dynamic_pr_debug'
>      dynamic_pr_debug(fmt, ##__VA_ARGS__)
>      ^
> >> drivers/target/target_core_user.c:385:3: note: in expansion of macro 'pr_debug'
>       pr_debug("no data space: only %lu available, but ask for %lu\n",
>       ^
>    drivers/target/target_core_user.c:385:12: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
>       pr_debug("no data space: only %lu available, but ask for %lu\n",
>                ^
>    include/linux/printk.h:236:21: note: in definition of macro 'pr_fmt'
>     #define pr_fmt(fmt) fmt
>                         ^
>    include/linux/printk.h:283:2: note: in expansion of macro 'dynamic_pr_debug'
>      dynamic_pr_debug(fmt, ##__VA_ARGS__)
>      ^
> >> drivers/target/target_core_user.c:385:3: note: in expansion of macro 'pr_debug'
>       pr_debug("no data space: only %lu available, but ask for %lu\n",
>       ^
> 
> vim +385 drivers/target/target_core_user.c
> 
>    369		 * original cmd - cmds are internally contiguous.
>    370		 */
>    371		if (head_to_end(cmd_head, udev->cmdr_size) >= cmd_size)
>    372			cmd_needed = cmd_size;
>    373		else
>    374			cmd_needed = cmd_size + head_to_end(cmd_head, udev->cmdr_size);
>    375	
>    376		space = spc_free(cmd_head, udev->cmdr_last_cleaned, udev->cmdr_size);
>    377		if (space < cmd_needed) {
>    378			pr_debug("no cmd space: %u %u %u\n", cmd_head,
>    379			       udev->cmdr_last_cleaned, udev->cmdr_size);
>    380			return false;
>    381		}
>    382	
>    383		space = spc_bitmap_free(udev->data_bitmap);
>    384		if (space < data_needed) {
>  > 385			pr_debug("no data space: only %lu available, but ask for %lu\n",
>    386					space, data_needed);
>    387			return false;
>    388		}
>    389	
>    390		return true;
>    391	}
>    392	
>    393	static int tcmu_queue_cmd_ring(struct tcmu_cmd *tcmu_cmd)
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Fixed in target-pending/for-next with the following patch.

Thanks Fengguang!

diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index d0655913..fc4789c 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -356,9 +356,8 @@ static inline size_t spc_bitmap_free(unsigned long *bitmap)
 static bool is_ring_space_avail(struct tcmu_dev *udev, size_t cmd_size, size_t data_needed)
 {
        struct tcmu_mailbox *mb = udev->mb_addr;
-       size_t space;
+       size_t space, cmd_needed;
        u32 cmd_head;
-       size_t cmd_needed;
 
        tcmu_flush_dcache_range(mb, sizeof(*mb));
 
@@ -382,7 +381,7 @@ static bool is_ring_space_avail(struct tcmu_dev *udev, size_t cmd_size, size_t d
 
        space = spc_bitmap_free(udev->data_bitmap);
        if (space < data_needed) {
-               pr_debug("no data space: only %lu available, but ask for %lu\n",
+               pr_debug("no data space: only %zu available, but ask for %zu\n",
                                space, data_needed);
                return false;
        }

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux