public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bodo Stroesser <bostroesser@gmail.com>
To: kernel test robot <lkp@intel.com>,
	Guixin Liu <kanie@linux.alibaba.com>,
	martin.petersen@oracle.com
Cc: kbuild-all@lists.01.org, linux-scsi@vger.kernel.org,
	target-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
	xiaoguang.wang@linux.alibaba.com, xlpang@linux.alibaba.com
Subject: Re: [PATCH V3] scsi: target: tcmu: Make cmd_ring_size changeable via configfs.
Date: Tue, 15 Feb 2022 14:33:44 +0100	[thread overview]
Message-ID: <2fea1ce0-0818-69b2-1fc1-03e624f56ceb@gmail.com> (raw)
In-Reply-To: <202202152052.AEF7jHIH-lkp@intel.com>

Hi Liu,

since CMDR_OFF is defined as "sizeof(struct tcmu_mailbox)", we could
fix the warning by using %z. OTOH, the fields cmdr_off and cmdr_size
in struct tcmu_mailbox are defined as u32, as well as cmdr_size in
struct tcmu_dev.

So I think we should add a cast to u32 in the definition of CMDR_OFF.
That should allow us to use %u on all architectures. Additionally
it avoids expansion to long during calculations where CMDR_OFF is
involved.

Btw: in my comments I asked you to remove the "\n" in the sprintf for
DataPagesPerBlk. But of course we need a space instead to allow
proper parsing of the output.

Bodo

On 15.02.22 14:05, kernel test robot wrote:
> Hi Guixin,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on mkp-scsi/for-next]
> [also build test WARNING on v5.17-rc4 next-20220215]
> [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/Guixin-Liu/scsi-target-tcmu-Make-cmd_ring_size-changeable-via-configfs/20220215-160505
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
> config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220215/202202152052.AEF7jHIH-lkp@intel.com/config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> reproduce (this is a W=1 build):
>          # https://github.com/0day-ci/linux/commit/7f77700542b8196c546ef10656dda7a107d8d1ad
>          git remote add linux-review https://github.com/0day-ci/linux
>          git fetch --no-tags linux-review Guixin-Liu/scsi-target-tcmu-Make-cmd_ring_size-changeable-via-configfs/20220215-160505
>          git checkout 7f77700542b8196c546ef10656dda7a107d8d1ad
>          # save the config file to linux build tree
>          mkdir build_dir
>          make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/target/
> 
> 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 >>):
> 
>     drivers/target/target_core_user.c: In function 'tcmu_show_configfs_dev_params':
>>> drivers/target/target_core_user.c:2627:41: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
>      2627 |  bl += sprintf(b + bl, "CmdRingSizeMB: %u\n",
>           |                                        ~^
>           |                                         |
>           |                                         unsigned int
>           |                                        %lu
>      2628 |         (udev->cmdr_size + CMDR_OFF) >> 20);
>           |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           |                                      |
>           |                                      long unsigned int
>     drivers/target/target_core_user.c: In function 'tcmu_cmd_ring_size_mb_show':
>     drivers/target/target_core_user.c:2743:37: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
>      2743 |  return snprintf(page, PAGE_SIZE, "%u\n",
>           |                                    ~^
>           |                                     |
>           |                                     unsigned int
>           |                                    %lu
>      2744 |    (udev->cmdr_size + CMDR_OFF) >> 20);
>           |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           |                                 |
>           |                                 long unsigned int
> 
> 
> vim +2627 drivers/target/target_core_user.c
> 
>    2616	
>    2617	static ssize_t tcmu_show_configfs_dev_params(struct se_device *dev, char *b)
>    2618	{
>    2619		struct tcmu_dev *udev = TCMU_DEV(dev);
>    2620		ssize_t bl = 0;
>    2621	
>    2622		bl = sprintf(b + bl, "Config: %s ",
>    2623			     udev->dev_config[0] ? udev->dev_config : "NULL");
>    2624		bl += sprintf(b + bl, "Size: %llu ", udev->dev_size);
>    2625		bl += sprintf(b + bl, "MaxDataAreaMB: %u ", udev->data_area_mb);
>    2626		bl += sprintf(b + bl, "DataPagesPerBlk: %u", udev->data_pages_per_blk);
>> 2627		bl += sprintf(b + bl, "CmdRingSizeMB: %u\n",
>    2628			      (udev->cmdr_size + CMDR_OFF) >> 20);
>    2629	
>    2630		return bl;
>    2631	}
>    2632	
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

  reply	other threads:[~2022-02-15 13:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15  8:03 [PATCH V3] scsi: target: tcmu: Make cmd_ring_size changeable via configfs Guixin Liu
2022-02-15 13:05 ` kernel test robot
2022-02-15 13:33   ` Bodo Stroesser [this message]
2022-02-15 14:49 ` 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=2fea1ce0-0818-69b2-1fc1-03e624f56ceb@gmail.com \
    --to=bostroesser@gmail.com \
    --cc=kanie@linux.alibaba.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=martin.petersen@oracle.com \
    --cc=target-devel@vger.kernel.org \
    --cc=xiaoguang.wang@linux.alibaba.com \
    --cc=xlpang@linux.alibaba.com \
    /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