[linux-nvme:nvme-5.14 32/32] drivers/nvme/target/zns.c:257:6: warning: no previous prototype for 'nvmet_bdev_zone_zmgmt_recv_work'

Chaitanya Kulkarni Chaitanya.Kulkarni at wdc.com
Tue Jun 15 13:04:45 PDT 2021


On 6/15/21 12:46, kernel test robot wrote:
> tree:   git://git.infradead.org/nvme.git nvme-5.14
> head:   9653e01d9c3c46930da3f007a39a2aaf230bd8ff
> commit: 9653e01d9c3c46930da3f007a39a2aaf230bd8ff [32/32] nvmet: add ZBD over ZNS backend support
> config: m68k-allmodconfig (attached as .config)
> compiler: m68k-linux-gcc (GCC) 9.3.0
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         git remote add linux-nvme git://git.infradead.org/nvme.git
>         git fetch --no-tags linux-nvme nvme-5.14
>         git checkout 9653e01d9c3c46930da3f007a39a2aaf230bd8ff
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp at intel.com>
>
> All warnings (new ones prefixed by >>):
>
>>> drivers/nvme/target/zns.c:257:6: warning: no previous prototype for 'nvmet_bdev_zone_zmgmt_recv_work' [-Wmissing-prototypes]
>      257 | void nvmet_bdev_zone_zmgmt_recv_work(struct work_struct *w)
>          |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> vim +/nvmet_bdev_zone_zmgmt_recv_work +257 drivers/nvme/target/zns.c
>
>    256	
>  > 257	void nvmet_bdev_zone_zmgmt_recv_work(struct work_struct *w)
>    258	{
>    259		struct nvmet_req *req = container_of(w, struct nvmet_req, z.zmgmt_work);
>    260		sector_t start_sect = nvmet_lba_to_sect(req->ns, req->cmd->zmr.slba);
>    261		unsigned long req_slba_nr_zones = nvmet_req_nr_zones_from_slba(req);
>    262		u32 out_bufsize = (le32_to_cpu(req->cmd->zmr.numd) + 1) << 2;
>    263		__le64 nr_zones;
>    264		u16 status;
>    265		int ret;
>    266		struct nvmet_report_zone_data rz_data = {
>    267			.out_nr_zones = get_nr_zones_from_buf(req, out_bufsize),
>    268			/* leave the place for report zone header */
>    269			.out_buf_offset = sizeof(struct nvme_zone_report),
>    270			.zrasf = req->cmd->zmr.zrasf,
>    271			.nr_zones = 0,
>    272			.req = req,
>    273		};
>    274	
>    275		status = nvmet_bdev_validate_zone_mgmt_recv(req);
>    276		if (status)
>    277			goto out;
>    278	
>    279		if (!req_slba_nr_zones) {
>    280			status = NVME_SC_SUCCESS;
>    281			goto out;
>    282		}
>    283	
>    284		ret = blkdev_report_zones(req->ns->bdev, start_sect, req_slba_nr_zones,
>    285					 nvmet_bdev_report_zone_cb, &rz_data);
>    286		if (ret < 0) {
>    287			status = NVME_SC_INTERNAL;
>    288			goto out;
>    289		}
>    290	
>    291		/*
>    292		 * When partial bit is set nr_zones must indicate the number of zone
>    293		 * descriptors actually transferred.
>    294		 */
>    295		if (req->cmd->zmr.pr)
>    296			rz_data.nr_zones = min(rz_data.nr_zones, rz_data.out_nr_zones);
>    297	
>    298		nr_zones = cpu_to_le64(rz_data.nr_zones);
>    299		status = nvmet_copy_to_sgl(req, 0, &nr_zones, sizeof(nr_zones));
>    300	
>    301	out:
>    302		nvmet_req_complete(req, status);
>    303	}
>    304	
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

I don't understand why does this need a prototype ?

The function nvmet_bdev_zone_zmgmt_recv_work() is defined  (line 257)
before it was used (line 307).

Will try and reproduce this on latest 5.14.







More information about the Linux-nvme mailing list