All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [zen-kernel-zen-kernel:5.11/zen-sauce 1/1] drivers/scsi/vhba/vhba.c:145:6: error: no previous prototype for 'devnum_to_bus_and_id'
Date: Thu, 22 Apr 2021 09:16:46 +0800	[thread overview]
Message-ID: <202104220939.Ddlstpjm-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 17287 bytes --]

tree:   https://github.com/zen-kernel/zen-kernel 5.11/zen-sauce
head:   72f34162f1f91a869b132ff133b0a4c5cac0e19f
commit: 72f34162f1f91a869b132ff133b0a4c5cac0e19f [1/1] ZEN: vhba: Update to 20210418
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-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
        # https://github.com/zen-kernel/zen-kernel/commit/72f34162f1f91a869b132ff133b0a4c5cac0e19f
        git remote add zen-kernel-zen-kernel https://github.com/zen-kernel/zen-kernel
        git fetch --no-tags zen-kernel-zen-kernel 5.11/zen-sauce
        git checkout 72f34162f1f91a869b132ff133b0a4c5cac0e19f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=arc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/scsi/vhba/vhba.c:145:6: error: no previous prototype for 'devnum_to_bus_and_id' [-Werror=missing-prototypes]
     145 | void devnum_to_bus_and_id(unsigned int devnum, unsigned int *bus, unsigned int *id)
         |      ^~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:151:14: error: no previous prototype for 'bus_and_id_to_devnum' [-Werror=missing-prototypes]
     151 | unsigned int bus_and_id_to_devnum(unsigned int bus, unsigned int id)
         |              ^~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:156:21: error: no previous prototype for 'vhba_device_alloc' [-Werror=missing-prototypes]
     156 | struct vhba_device *vhba_device_alloc (void)
         |                     ^~~~~~~~~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:176:6: error: no previous prototype for 'vhba_device_put' [-Werror=missing-prototypes]
     176 | void vhba_device_put (struct vhba_device *vdev)
         |      ^~~~~~~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:183:21: error: no previous prototype for 'vhba_device_get' [-Werror=missing-prototypes]
     183 | struct vhba_device *vhba_device_get (struct vhba_device *vdev)
         |                     ^~~~~~~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:190:5: error: no previous prototype for 'vhba_device_queue' [-Werror=missing-prototypes]
     190 | int vhba_device_queue (struct vhba_device *vdev, struct scsi_cmnd *cmd)
         |     ^~~~~~~~~~~~~~~~~
   drivers/scsi/vhba/vhba.c: In function 'vhba_device_queue':
>> drivers/scsi/vhba/vhba.c:192:23: error: variable 'vhost' set but not used [-Werror=unused-but-set-variable]
     192 |     struct vhba_host *vhost;
         |                       ^~~~~
   drivers/scsi/vhba/vhba.c: At top level:
>> drivers/scsi/vhba/vhba.c:215:5: error: no previous prototype for 'vhba_device_dequeue' [-Werror=missing-prototypes]
     215 | int vhba_device_dequeue (struct vhba_device *vdev, struct scsi_cmnd *cmd)
         |     ^~~~~~~~~~~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:270:6: error: no previous prototype for 'vhba_scan_devices_add' [-Werror=missing-prototypes]
     270 | void vhba_scan_devices_add (struct vhba_host *vhost, int bus, int id)
         |      ^~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:283:6: error: no previous prototype for 'vhba_scan_devices_remove' [-Werror=missing-prototypes]
     283 | void vhba_scan_devices_remove (struct vhba_host *vhost, int bus, int id)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:296:6: error: no previous prototype for 'vhba_scan_devices' [-Werror=missing-prototypes]
     296 | void vhba_scan_devices (struct work_struct *work)
         |      ^~~~~~~~~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:344:5: error: no previous prototype for 'vhba_add_device' [-Werror=missing-prototypes]
     344 | int vhba_add_device (struct vhba_device *vdev)
         |     ^~~~~~~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:378:5: error: no previous prototype for 'vhba_remove_device' [-Werror=missing-prototypes]
     378 | int vhba_remove_device (struct vhba_device *vdev)
         |     ^~~~~~~~~~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:399:21: error: no previous prototype for 'vhba_lookup_device' [-Werror=missing-prototypes]
     399 | struct vhba_device *vhba_lookup_device (int devnum)
         |                     ^~~~~~~~~~~~~~~~~~
   drivers/scsi/vhba/vhba.c:470:5: error: no previous prototype for 'vhba_queuecommand' [-Werror=missing-prototypes]
     470 | int vhba_queuecommand (struct Scsi_Host *shost, struct scsi_cmnd *cmd)
         |     ^~~~~~~~~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:496:5: error: no previous prototype for 'vhba_abort' [-Werror=missing-prototypes]
     496 | int vhba_abort (struct scsi_cmnd *cmd)
         |     ^~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:539:9: error: no previous prototype for 'do_request' [-Werror=missing-prototypes]
     539 | ssize_t do_request (struct vhba_device *vdev, unsigned long metatag, struct scsi_cmnd *cmd, char __user *buf, size_t buf_len)
         |         ^~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:605:9: error: no previous prototype for 'do_response' [-Werror=missing-prototypes]
     605 | ssize_t do_response (struct vhba_device *vdev, unsigned long metatag, struct scsi_cmnd *cmd, const char __user *buf, size_t buf_len, struct vhba_response *res)
         |         ^~~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:681:22: error: no previous prototype for 'next_command' [-Werror=missing-prototypes]
     681 | struct vhba_command *next_command (struct vhba_device *vdev)
         |                      ^~~~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:698:22: error: no previous prototype for 'match_command' [-Werror=missing-prototypes]
     698 | struct vhba_command *match_command (struct vhba_device *vdev, __u32 metatag)
         |                      ^~~~~~~~~~~~~
>> drivers/scsi/vhba/vhba.c:715:22: error: no previous prototype for 'wait_command' [-Werror=missing-prototypes]
     715 | struct vhba_command *wait_command (struct vhba_device *vdev, unsigned long flags)
         |                      ^~~~~~~~~~~~
   drivers/scsi/vhba/vhba.c:742:9: error: no previous prototype for 'vhba_ctl_read' [-Werror=missing-prototypes]
     742 | ssize_t vhba_ctl_read (struct file *file, char __user *buf, size_t buf_len, loff_t *offset)
         |         ^~~~~~~~~~~~~
   drivers/scsi/vhba/vhba.c:787:9: error: no previous prototype for 'vhba_ctl_write' [-Werror=missing-prototypes]
     787 | ssize_t vhba_ctl_write (struct file *file, const char __user *buf, size_t buf_len, loff_t *offset)
         |         ^~~~~~~~~~~~~~
   drivers/scsi/vhba/vhba.c:836:6: error: no previous prototype for 'vhba_ctl_ioctl' [-Werror=missing-prototypes]
     836 | long vhba_ctl_ioctl (struct file *file, unsigned int cmd, unsigned long arg)
         |      ^~~~~~~~~~~~~~
   drivers/scsi/vhba/vhba.c:877:14: error: no previous prototype for 'vhba_ctl_poll' [-Werror=missing-prototypes]
     877 | unsigned int vhba_ctl_poll (struct file *file, poll_table *wait)
         |              ^~~~~~~~~~~~~
   drivers/scsi/vhba/vhba.c:894:5: error: no previous prototype for 'vhba_ctl_open' [-Werror=missing-prototypes]
     894 | int vhba_ctl_open (struct inode *inode, struct file *file)
         |     ^~~~~~~~~~~~~
   drivers/scsi/vhba/vhba.c:926:5: error: no previous prototype for 'vhba_ctl_release' [-Werror=missing-prototypes]
     926 | int vhba_ctl_release (struct inode *inode, struct file *file)
         |     ^~~~~~~~~~~~~~~~
   drivers/scsi/vhba/vhba.c:979:5: error: no previous prototype for 'vhba_probe' [-Werror=missing-prototypes]
     979 | int vhba_probe (struct platform_device *pdev)
         |     ^~~~~~~~~~
   drivers/scsi/vhba/vhba.c:1033:5: error: no previous prototype for 'vhba_remove' [-Werror=missing-prototypes]
    1033 | int vhba_remove (struct platform_device *pdev)
         |     ^~~~~~~~~~~
   drivers/scsi/vhba/vhba.c:1049:6: error: no previous prototype for 'vhba_release' [-Werror=missing-prototypes]
    1049 | void vhba_release (struct device * dev)
         |      ^~~~~~~~~~~~
   drivers/scsi/vhba/vhba.c:1071:12: error: no previous prototype for 'vhba_init' [-Werror=missing-prototypes]
    1071 | int __init vhba_init (void)
         |            ^~~~~~~~~
   drivers/scsi/vhba/vhba.c:1096:13: error: no previous prototype for 'vhba_exit' [-Werror=missing-prototypes]
    1096 | void __exit vhba_exit(void)
         |             ^~~~~~~~~
   cc1: all warnings being treated as errors


vim +/devnum_to_bus_and_id +145 drivers/scsi/vhba/vhba.c

   140	
   141	
   142	
   143	/* These functions define a symmetric 1:1 mapping between device numbers and
   144	   the bus and id. We have reserved the last id per bus for the host itself. */
 > 145	void devnum_to_bus_and_id(unsigned int devnum, unsigned int *bus, unsigned int *id)
   146	{
   147	    *bus = devnum / (VHBA_MAX_ID-1);
   148	    *id  = devnum % (VHBA_MAX_ID-1);
   149	}
   150	
 > 151	unsigned int bus_and_id_to_devnum(unsigned int bus, unsigned int id)
   152	{
   153	    return (bus * (VHBA_MAX_ID-1)) + id;
   154	}
   155	
 > 156	struct vhba_device *vhba_device_alloc (void)
   157	{
   158	    struct vhba_device *vdev;
   159	
   160	    vdev = kzalloc(sizeof(struct vhba_device), GFP_KERNEL);
   161	    if (!vdev) {
   162	        return NULL;
   163	    }
   164	
   165	    spin_lock_init(&vdev->cmd_lock);
   166	    INIT_LIST_HEAD(&vdev->cmd_list);
   167	    init_waitqueue_head(&vdev->cmd_wq);
   168	    atomic_set(&vdev->refcnt, 1);
   169	
   170	    vdev->kbuf = NULL;
   171	    vdev->kbuf_size = 0;
   172	
   173	    return vdev;
   174	}
   175	
 > 176	void vhba_device_put (struct vhba_device *vdev)
   177	{
   178	    if (atomic_dec_and_test(&vdev->refcnt)) {
   179	        kfree(vdev);
   180	    }
   181	}
   182	
 > 183	struct vhba_device *vhba_device_get (struct vhba_device *vdev)
   184	{
   185	    atomic_inc(&vdev->refcnt);
   186	
   187	    return vdev;
   188	}
   189	
 > 190	int vhba_device_queue (struct vhba_device *vdev, struct scsi_cmnd *cmd)
   191	{
 > 192	    struct vhba_host *vhost;
   193	    struct vhba_command *vcmd;
   194	    unsigned long flags;
   195	
   196	    vhost = platform_get_drvdata(&vhba_platform_device);
   197	
   198	    vcmd = vhba_alloc_command();
   199	    if (!vcmd) {
   200	        return SCSI_MLQUEUE_HOST_BUSY;
   201	    }
   202	
   203	    vcmd->cmd = cmd;
   204	
   205	    spin_lock_irqsave(&vdev->cmd_lock, flags);
   206	    vcmd->metatag = vcmd->cmd->request->tag;
   207	    list_add_tail(&vcmd->entry, &vdev->cmd_list);
   208	    spin_unlock_irqrestore(&vdev->cmd_lock, flags);
   209	
   210	    wake_up_interruptible(&vdev->cmd_wq);
   211	
   212	    return 0;
   213	}
   214	
 > 215	int vhba_device_dequeue (struct vhba_device *vdev, struct scsi_cmnd *cmd)
   216	{
   217	    struct vhba_command *vcmd;
   218	    int retval;
   219	    unsigned long flags;
   220	
   221	    spin_lock_irqsave(&vdev->cmd_lock, flags);
   222	    list_for_each_entry(vcmd, &vdev->cmd_list, entry) {
   223	        if (vcmd->cmd == cmd) {
   224	            list_del_init(&vcmd->entry);
   225	            break;
   226	        }
   227	    }
   228	
   229	    /* command not found */
   230	    if (&vcmd->entry == &vdev->cmd_list) {
   231	        spin_unlock_irqrestore(&vdev->cmd_lock, flags);
   232	        return SUCCESS;
   233	    }
   234	
   235	    while (vcmd->status == VHBA_REQ_READING || vcmd->status == VHBA_REQ_WRITING) {
   236	        spin_unlock_irqrestore(&vdev->cmd_lock, flags);
   237	        scmd_dbg(cmd, "wait for I/O before aborting\n");
   238	        schedule_timeout(1);
   239	        spin_lock_irqsave(&vdev->cmd_lock, flags);
   240	    }
   241	
   242	    retval = (vcmd->status == VHBA_REQ_SENT) ? FAILED : SUCCESS;
   243	
   244	    vhba_free_command(vcmd);
   245	
   246	    spin_unlock_irqrestore(&vdev->cmd_lock, flags);
   247	
   248	    return retval;
   249	}
   250	
   251	#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
   252	int vhba_slave_alloc(struct scsi_device *sdev)
   253	{
   254	    struct Scsi_Host *shost = sdev->host;
   255	
   256	    sdev_dbg(sdev, "enabling tagging (queue depth: %i).\n", sdev->queue_depth);
   257	#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
   258	    if (!shost_use_blk_mq(shost) && shost->bqt) {
   259	#else
   260	    if (shost->bqt) {
   261	#endif
   262	        blk_queue_init_tags(sdev->request_queue, sdev->queue_depth, shost->bqt);
   263	    }
   264	    scsi_adjust_queue_depth(sdev, 0, sdev->queue_depth);
   265	
   266	    return 0;
   267	}
   268	#endif
   269	
 > 270	void vhba_scan_devices_add (struct vhba_host *vhost, int bus, int id)
   271	{
   272	    struct scsi_device *sdev;
   273	
   274	    sdev = scsi_device_lookup(vhost->shost, bus, id, 0);
   275	    if (!sdev) {
   276	        scsi_add_device(vhost->shost, bus, id, 0);
   277	    } else {
   278	        dev_warn(&vhost->shost->shost_gendev, "tried to add an already-existing device %d:%d:0!\n", bus, id);
   279	        scsi_device_put(sdev);
   280	    }
   281	}
   282	
 > 283	void vhba_scan_devices_remove (struct vhba_host *vhost, int bus, int id)
   284	{
   285	    struct scsi_device *sdev;
   286	
   287	    sdev = scsi_device_lookup(vhost->shost, bus, id, 0);
   288	    if (sdev) {
   289	        scsi_remove_device(sdev);
   290	        scsi_device_put(sdev);
   291	    } else {
   292	        dev_warn(&vhost->shost->shost_gendev, "tried to remove non-existing device %d:%d:0!\n", bus, id);
   293	    }
   294	}
   295	
 > 296	void vhba_scan_devices (struct work_struct *work)
   297	{
   298	    struct vhba_host *vhost = container_of(work, struct vhba_host, scan_devices);
   299	    unsigned long flags;
   300	    int change, exists;
   301	    unsigned int devnum;
   302	    unsigned int bus, id;
   303	
   304	    for (;;) {
   305	        spin_lock_irqsave(&vhost->dev_lock, flags);
   306	
   307	        devnum = find_first_bit(vhost->chgmap, VHBA_MAX_DEVICES);
   308	        if (devnum >= VHBA_MAX_DEVICES) {
   309	            spin_unlock_irqrestore(&vhost->dev_lock, flags);
   310	            break;
   311	        }
   312	        change = vhost->chgtype[devnum];
   313	        exists = vhost->devices[devnum] != NULL;
   314	
   315	        vhost->chgtype[devnum] = 0;
   316	        clear_bit(devnum, vhost->chgmap);
   317	
   318	        spin_unlock_irqrestore(&vhost->dev_lock, flags);
   319	
   320	        devnum_to_bus_and_id(devnum, &bus, &id);
   321	
   322	        if (change < 0) {
   323	            dev_dbg(&vhost->shost->shost_gendev, "trying to remove target %d:%d:0\n", bus, id);
   324	            vhba_scan_devices_remove(vhost, bus, id);
   325	        } else if (change > 0) {
   326	            dev_dbg(&vhost->shost->shost_gendev, "trying to add target %d:%d:0\n", bus, id);
   327	            vhba_scan_devices_add(vhost, bus, id);
   328	        } else {
   329	            /* quick sequence of add/remove or remove/add; we determine
   330	               which one it was by checking if device structure exists */
   331	            if (exists) {
   332	                /* remove followed by add: remove and (re)add */
   333	                dev_dbg(&vhost->shost->shost_gendev, "trying to (re)add target %d:%d:0\n", bus, id);
   334	                vhba_scan_devices_remove(vhost, bus, id);
   335	                vhba_scan_devices_add(vhost, bus, id);
   336	            } else {
   337	                /* add followed by remove: no-op */
   338	                dev_dbg(&vhost->shost->shost_gendev, "no-op for target %d:%d:0\n", bus, id);
   339	            }
   340	        }
   341	    }
   342	}
   343	
 > 344	int vhba_add_device (struct vhba_device *vdev)
   345	{
   346	    struct vhba_host *vhost;
   347	    unsigned int devnum;
   348	    unsigned long flags;
   349	
   350	    vhost = platform_get_drvdata(&vhba_platform_device);
   351	
   352	    vhba_device_get(vdev);
   353	
   354	    spin_lock_irqsave(&vhost->dev_lock, flags);
   355	    if (vhost->num_devices >= VHBA_MAX_DEVICES) {
   356	        spin_unlock_irqrestore(&vhost->dev_lock, flags);
   357	        vhba_device_put(vdev);
   358	        return -EBUSY;
   359	    }
   360	
   361	    for (devnum = 0; devnum < VHBA_MAX_DEVICES; devnum++) {
   362	        if (vhost->devices[devnum] == NULL) {
   363	            vdev->num = devnum;
   364	            vhost->devices[devnum] = vdev;
   365	            vhost->num_devices++;
   366	            set_bit(devnum, vhost->chgmap);
   367	            vhost->chgtype[devnum]++;
   368	            break;
   369	        }
   370	    }
   371	    spin_unlock_irqrestore(&vhost->dev_lock, flags);
   372	
   373	    schedule_work(&vhost->scan_devices);
   374	
   375	    return 0;
   376	}
   377	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 67335 bytes --]

                 reply	other threads:[~2021-04-22  1:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202104220939.Ddlstpjm-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.