A series of small SCSI patches
Subsystems (9)
cover A series of small SCSI patches
Hi Martin,
This patch series fixes a number of static checker warnings. Most of these patches fix warnings introduced during the merge window.
Please consider these patches for kernel v5.17.
Thanks,
Bart.
Bart Van Assche (13):
scsi: core: Suppress a kernel-doc warning
scsi: core: Declare 'scsi_scan_type' static
scsi: core: Show SCMD_LAST in text form
scsi: a100u2w: Fix a kernel-doc warning
scsi: ata: Declare 'ata_ncq_sdev_attrs' static
scsi: atp870u: Fix a kernel-doc warning
scsi: bfa: Declare 'bfad_im_vport_attrs' static
scsi: dc395x: Fix a kernel-doc warning
scsi: initio: Fix a kernel-doc warning
scsi: megaraid: Fix a kernel-doc warning
scsi: pm8001: Fix kernel-doc warnings
scsi: pmcraid: Fix a kernel-doc warning
scsi: Remove superfluous #include <linux/async.h> directives
drivers/ata/libata-sata.c | 2 +- drivers/scsi/a100u2w.c | 2 -- drivers/scsi/atp870u.c | 1 - drivers/scsi/bfa/bfad_attr.c | 2 +- drivers/scsi/dc395x.c | 3 +-- drivers/scsi/hisi_sas/hisi_sas.h | 1 - drivers/scsi/initio.c | 2 -- drivers/scsi/libsas/sas_discover.c | 1 - drivers/scsi/megaraid/megaraid_mbox.c | 1 - drivers/scsi/pm8001/pm8001_ctl.c | 24 ++++++++++++------------ drivers/scsi/pmcraid.c | 1 - drivers/scsi/scsi.c | 1 - drivers/scsi/scsi_debugfs.c | 1 + drivers/scsi/scsi_pm.c | 1 - drivers/scsi/scsi_priv.h | 1 - drivers/scsi/scsi_scan.c | 4 ++-- drivers/scsi/sd.c | 1 - drivers/scsi/ufs/ufshpb.c | 1 - 18 files changed, 18 insertions(+), 32 deletions(-)
PATCH 1/13 scsi: core: Suppress a kernel-doc warning
Suppress the following kernel-doc warning:
drivers/scsi/scsi_scan.c:129: warning: Function parameter or member 'dev' not described in 'scsi_enable_async_suspend'
--- drivers/scsi/scsi_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_scan.c +1 -1
@@ -122,7 +122,7 @@ struct async_scan_data {struct completion prev_finished; }; -/** +/* * scsi_enable_async_suspend - Enable async suspend and resume */ void scsi_enable_async_suspend (struct device *dev)
PATCH 2/13 scsi: core: Declare 'scsi_scan_type' static
In reply to Bart Van Assche'scsi_scan_type' is only used in one source file. Hence declare it static.
--- drivers/scsi/scsi_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_scan.c +1 -1
@@ -97,7 +97,7 @@ MODULE_PARM_DESC(max_luns,#define SCSI_SCAN_TYPE_DEFAULT "sync"#endif -char scsi_scan_type[7 ] =SCSI_SCAN_TYPE_DEFAULT ; +static char scsi_scan_type[7 ] =SCSI_SCAN_TYPE_DEFAULT ;module_param_string (scan, scsi_scan_type,sizeof (scsi_scan_type),S_IRUGO |S_IWUSR );
PATCH 3/13 scsi: core: Show SCMD_LAST in text form
In reply to Bart Van AsscheThe SCSI debugfs code supports showing information about pending commands, including translating SCSI command flags from numeric into text format. Also convert the SCMD_LAST flag from numeric into text form.
--- drivers/scsi/scsi_debugfs.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/scsi_debugfs.c +1 -0
@@ -9,6 +9,7 @@static const char *const scsi_cmd_flags[] = {SCSI_CMD_FLAG_NAME (TAGGED ),SCSI_CMD_FLAG_NAME (INITIALIZED ), +SCSI_CMD_FLAG_NAME (LAST ), };#undef SCSI_CMD_FLAG_NAME
PATCH 4/13 scsi: a100u2w: Fix a kernel-doc warning
In reply to Bart Van AsscheFix the following kernel-doc warning:
drivers/scsi/a100u2w.c:915: warning: Excess function parameter 'done' description in 'inia100_queue_lck'
--- drivers/scsi/a100u2w.c | 2 -- 1 file changed, 2 deletions(-)
drivers/scsi/a100u2w.c +0 -2
@@ -904,13 +904,11 @@ static int inia100_build_scb(struct orc_host * host, struct orc_scb * scb, struc/** * inia100_queue_lck - queue command with host * @cmd: Command block -* @done: Completion function * * Called by the mid layer to queue a command. Process the command * block, build the host specific scb structures and if there is room * queue the command down to the controller */ -static int inia100_queue_lck (struct scsi_cmnd *cmd) {struct orc_scb *scb;
PATCH 5/13 scsi: ata: Declare 'ata_ncq_sdev_attrs' static
In reply to Bart Van AsscheFix the following kernel-doc warning:
'ata_ncq_sdev_attrs' is only used in one source file. Hence declare this array static.
--- drivers/ata/libata-sata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/libata-sata.c +1 -1
@@ -922,7 +922,7 @@ DEVICE_ATTR(ncq_prio_enable, S_IRUGO | S_IWUSR, ata_ncq_prio_enable_show, ata_ncq_prio_enable_store);EXPORT_SYMBOL_GPL (dev_attr_ncq_prio_enable); -struct attribute *ata_ncq_sdev_attrs[] = { +static struct attribute *ata_ncq_sdev_attrs[] = { &dev_attr_unload_heads.attr, &dev_attr_ncq_prio_enable.attr, &dev_attr_ncq_prio_supported.attr,
Re: [PATCH 05/13] scsi: ata: Declare 'ata_ncq_sdev_attrs' static
Quoted 18 lines · Bart Van Assche
Fix the following kernel-doc warning:
'
ata_ncq_sdev_attrs' is only used in one source file. Hence declare this array static.Fixes c3f69c7f629f ("scsi: ata: Switch to attribute groups")Reported-by kernel test robot <[email protected]>Signed-off-by Bart Van Assche <[email protected]>--- drivers/ata/libata-sata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/ata/libata-sata.c +0
-0
drivers/ata/libata-sata.c DEVICE_ATTR(ncq_prio_enable, S_IRUGO | S_IWUSR, · line 928
Quoted 8 lines
drivers/ata/libata-sata.c +1
-1@@ -922,7 +922,7 @@ DEVICE_ATTR(ncq_prio_enable, S_IRUGO | S_IWUSR, ata_ncq_prio_enable_show, ata_ncq_prio_enable_store);EXPORT_SYMBOL_GPL (dev_attr_ncq_prio_enable); -struct attribute *ata_ncq_sdev_attrs[] = { +static struct attribute *ata_ncq_sdev_attrs[] = { &dev_attr_unload_heads.attr, &dev_attr_ncq_prio_enable.attr, &dev_attr_ncq_prio_supported.attr,
Already fixed in rc2.
See commit cac7e8b5f5fa94e28d581fbb9e76cb1c0c7fd56a.
Signature · 2 lines
Damien Le Moal Western Digital Research
Re: [PATCH 05/13] scsi: ata: Declare 'ata_ncq_sdev_attrs' static
Quoted 21 lines · Damien Le Moal
Quoted 20 lines · Bart Van Assche
Fix the following kernel-doc warning:
'
ata_ncq_sdev_attrs' is only used in one source file. Hence declare this array static.Fixes c3f69c7f629f ("scsi: ata: Switch to attribute groups")Reported-by kernel test robot <[email protected]>Signed-off-by Bart Van Assche <[email protected]>--- drivers/ata/libata-sata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/ata/libata-sata.c +0
-0@@ -922,7 +922,7 @@ DEVICE_ATTR(ncq_prio_enable, S_IRUGO | S_IWUSR, ata_ncq_prio_enable_show, ata_ncq_prio_enable_store);EXPORT_SYMBOL_GPL (dev_attr_ncq_prio_enable);
Quoted 9 lines
drivers/ata/libata-sata.c DEVICE_ATTR(ncq_prio_enable, S_IRUGO | S_IWUSR, · line 928
Quoted 6 lines
drivers/ata/libata-sata.c +1
-1-struct attribute *ata_ncq_sdev_attrs[] = { +static struct attribute *ata_ncq_sdev_attrs[] = { &dev_attr_unload_heads.attr, &dev_attr_ncq_prio_enable.attr, &dev_attr_ncq_prio_supported.attr,Already fixed in rc2.
See commitcac7e8b5f5fa94e28d581fbb9e76cb1c0c7fd56a.
Hi Damien,
Thanks for the feedback. I remembered that I had seen an ATA fix but couldn't find it while I was preparing this series ...
Bart.
PATCH 6/13 scsi: atp870u: Fix a kernel-doc warning
In reply to Bart Van AsscheFix the following kernel-doc warning:
drivers/scsi/atp870u.c:622: warning: Excess function parameter 'done' description in 'atp870u_queuecommand_lck'
--- drivers/scsi/atp870u.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/atp870u.c +0 -1
@@ -614,7 +614,6 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id)/** * atp870u_queuecommand_lck - Queue SCSI command * @req_p: request block -* @done: completion function * * Queue a command to the ATP queue. Called with the host lock held. */
PATCH 7/13 scsi: bfa: Declare 'bfad_im_vport_attrs' static
In reply to Bart Van AsscheFix the following kernel-doc warning:
'bfad_im_vport_attrs' is only used in one source file. Hence declare this array static.
--- drivers/scsi/bfa/bfad_attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/bfa/bfad_attr.c +1 -1
@@ -981,7 +981,7 @@ const struct attribute_group *bfad_im_host_groups[] = {NULL }; -struct attribute *bfad_im_vport_attrs[] = { +static struct attribute *bfad_im_vport_attrs[] = { &dev_attr_serial_number.attr, &dev_attr_model.attr, &dev_attr_model_description.attr,
PATCH 8/13 scsi: dc395x: Fix a kernel-doc warning
In reply to Bart Van AsscheFix the following kernel-doc warning:
drivers/scsi/dc395x.c:964: warning: Excess function parameter 'done' description in 'dc395x_queue_command_lck'
--- drivers/scsi/dc395x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/dc395x.c +1 -2
@@ -946,7 +946,6 @@ static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb,* layer, invoke 'done' on completion * * @cmd: pointer to scsi command object -* @done: function pointer to be invoked on completion * * Returns 1 if the adapter (host) is busy, else returns 0. One * reason for an adapter to be busy is that the number
@@ -959,7 +958,7 @@ static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb,* Locks: struct Scsi_Host::host_lock held on entry (with "irqsave") * and is expected to be held on return. * -**/ +*/ static int dc395x_queue_command_lck (struct scsi_cmnd *cmd) {void (*done)(struct scsi_cmnd *) = scsi_done;
PATCH 9/13 scsi: initio: Fix a kernel-doc warning
In reply to Bart Van AsscheFix the following kernel-doc warning:
drivers/scsi/initio.c:2613: warning: Excess function parameter 'done' description in 'i91u_queuecommand_lck'
--- drivers/scsi/initio.c | 2 -- 1 file changed, 2 deletions(-)
drivers/scsi/initio.c +0 -2
@@ -2602,13 +2602,11 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c/** * i91u_queuecommand_lck - Queue a new command if possible * @cmd: SCSI command block from the mid layer -* @done: Completion handler * * Attempts to queue a new command with the host adapter. Will return * zero if successful or indicate a host busy condition if not (which * will cause the mid layer to call us again later with the command) */ -static int i91u_queuecommand_lck (struct scsi_cmnd *cmd) {struct initio_host *host = (struct initio_host *) cmd->device->host->hostdata;
PATCH 10/13 scsi: megaraid: Fix a kernel-doc warning
In reply to Bart Van AsscheFix the following kernel-doc warning:
drivers/scsi/megaraid/megaraid_mbox.c:1439: warning: Excess function parameter 'done' description in 'megaraid_queue_command_lck'
--- drivers/scsi/megaraid/megaraid_mbox.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/megaraid/megaraid_mbox.c +0 -1
@@ -1431,7 +1431,6 @@ mbox_post_cmd(adapter_t *adapter, scb_t *scb)/** * megaraid_queue_command_lck - generic queue entry point for all LLDs * @scp : pointer to the scsi command to be executed -* @done : callback routine to be called after the cmd has be completed * * Queue entry point for mailbox based controllers. */
PATCH 11/13 scsi: pm8001: Fix kernel-doc warnings
In reply to Bart Van AsscheFix the following kernel-doc warnings:
drivers/scsi/pm8001/pm8001_ctl.c:900: warning: cannot understand function prototype: 'const char *const mpiStateText[] = ' drivers/scsi/pm8001/pm8001_ctl.c:930: warning: Function parameter or member 'attr' not described in 'ctl_hmi_error_show' drivers/scsi/pm8001/pm8001_ctl.c:951: warning: Function parameter or member 'attr' not described in 'ctl_raae_count_show' drivers/scsi/pm8001/pm8001_ctl.c:972: warning: Function parameter or member 'attr' not described in 'ctl_iop0_count_show' drivers/scsi/pm8001/pm8001_ctl.c:993: warning: Function parameter or member 'attr' not described in 'ctl_iop1_count_show'
--- drivers/scsi/pm8001/pm8001_ctl.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/scsi/pm8001/pm8001_ctl.c +12 -12
@@ -889,14 +889,6 @@ static ssize_t pm8001_show_update_fw(struct device *cdev, static DEVICE_ATTR(update_fw, S_IRUGO|S_IWUSR|S_IWGRP, pm8001_show_update_fw, pm8001_store_update_fw); -/** -* ctl_mpi_state_show - controller MPI state check -* @cdev: pointer to embedded class device -* @buf: the buffer returned -* -* A sysfs 'read-only' shost attribute. -*/ -static const char *const mpiStateText[] = {"MPI is not initialized" ,"MPI is successfully initialized" ,
@@ -904,6 +896,14 @@ static const char *const mpiStateText[] = { "MPI initialization failed with error in [31:16]" }; +/** +* ctl_mpi_state_show - controller MPI state check +* @cdev: pointer to embedded class device +* @attr: device attribute (unused) +* @buf: the buffer returned +* +* A sysfs 'read-only' shost attribute. +*/ static ssize_t ctl_mpi_state_show (struct device *cdev,struct device_attribute *attr,char *buf) {
@@ -920,11 +920,11 @@ static DEVICE_ATTR_RO(ctl_mpi_state);/** * ctl_hmi_error_show - controller MPI initialization fails * @cdev: pointer to embedded class device +* @attr: device attribute (unused) * @buf: the buffer returned * * A sysfs 'read-only' shost attribute. */ -static ssize_t ctl_hmi_error_show (struct device *cdev,struct device_attribute *attr,char *buf) {
@@ -941,11 +941,11 @@ static DEVICE_ATTR_RO(ctl_hmi_error);/** * ctl_raae_count_show - controller raae count check * @cdev: pointer to embedded class device +* @attr: device attribute (unused) * @buf: the buffer returned * * A sysfs 'read-only' shost attribute. */ -static ssize_t ctl_raae_count_show (struct device *cdev,struct device_attribute *attr,char *buf) {
@@ -962,11 +962,11 @@ static DEVICE_ATTR_RO(ctl_raae_count);/** * ctl_iop0_count_show - controller iop0 count check * @cdev: pointer to embedded class device +* @attr: device attribute (unused) * @buf: the buffer returned * * A sysfs 'read-only' shost attribute. */ -static ssize_t ctl_iop0_count_show (struct device *cdev,struct device_attribute *attr,char *buf) {
@@ -983,11 +983,11 @@ static DEVICE_ATTR_RO(ctl_iop0_count);/** * ctl_iop1_count_show - controller iop1 count check * @cdev: pointer to embedded class device +* @attr: device attribute (unused) * @buf: the buffer returned * * A sysfs 'read-only' shost attribute. */ -static ssize_t ctl_iop1_count_show (struct device *cdev,struct device_attribute *attr,char *buf) {
Re: [PATCH 11/13] scsi: pm8001: Fix kernel-doc warnings
Quoted 11 lines · Bart Van Assche
Fix the following kernel-doc warnings:
drivers/scsi/pm8001/pm8001_ctl.c:900: warning: cannot understand function prototype: 'const char *const mpiStateText[] = 'drivers/scsi/pm8001/pm8001_ctl.c:930: warning: Function parameter or member 'attr' not described in 'ctl_hmi_error_show'drivers/scsi/pm8001/pm8001_ctl.c:951: warning: Function parameter or member 'attr' not described in 'ctl_raae_count_show'drivers/scsi/pm8001/pm8001_ctl.c:972: warning: Function parameter or member 'attr' not described in 'ctl_iop0_count_show'drivers/scsi/pm8001/pm8001_ctl.c:993: warning: Function parameter or member 'attr' not described in 'ctl_iop1_count_show'Fixes 4ddbea1b6f51 ("scsi: pm80xx: Add sysfs attribute to check MPI state")Signed-off-by Bart Van Assche <[email protected]>
looks good to me, thx!
Quoted 90 lines
--- drivers/scsi/pm8001/pm8001_ctl.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)drivers/scsi/pm8001/pm8001_ctl.c +12
-12@@ -889,14 +889,6 @@ static ssize_t pm8001_show_update_fw(struct device *cdev, static DEVICE_ATTR(update_fw, S_IRUGO|S_IWUSR|S_IWGRP, pm8001_show_update_fw, pm8001_store_update_fw); -/** -* ctl_mpi_state_show - controller MPI state check -* @cdev: pointer to embedded class device -* @buf: the buffer returned -* -* A sysfs 'read-only' shost attribute. -*/ -static const char *const mpiStateText[] = {"MPI is not initialized" ,"MPI is successfully initialized" ,@@ -904,6 +896,14 @@ static const char *const mpiStateText[] = { "MPI initialization failed with error in [31:16]" }; +/** +* ctl_mpi_state_show - controller MPI state check +* @cdev: pointer to embedded class device +* @attr: device attribute (unused) +* @buf: the buffer returned +* +* A sysfs 'read-only' shost attribute. +*/ static ssize_t ctl_mpi_state_show (struct device *cdev,struct device_attribute *attr,char *buf) {@@ -920,11 +920,11 @@ static DEVICE_ATTR_RO(ctl_mpi_state);/** * ctl_hmi_error_show - controller MPI initialization fails * @cdev: pointer to embedded class device +* @attr: device attribute (unused) * @buf: the buffer returned * * A sysfs 'read-only' shost attribute. */ -static ssize_t ctl_hmi_error_show (struct device *cdev,struct device_attribute *attr,char *buf) {@@ -941,11 +941,11 @@ static DEVICE_ATTR_RO(ctl_hmi_error);/** * ctl_raae_count_show - controller raae count check * @cdev: pointer to embedded class device +* @attr: device attribute (unused) * @buf: the buffer returned * * A sysfs 'read-only' shost attribute. */ -static ssize_t ctl_raae_count_show (struct device *cdev,struct device_attribute *attr,char *buf) {@@ -962,11 +962,11 @@ static DEVICE_ATTR_RO(ctl_raae_count);/** * ctl_iop0_count_show - controller iop0 count check * @cdev: pointer to embedded class device +* @attr: device attribute (unused) * @buf: the buffer returned * * A sysfs 'read-only' shost attribute. */ -static ssize_t ctl_iop0_count_show (struct device *cdev,struct device_attribute *attr,char *buf) {@@ -983,11 +983,11 @@ static DEVICE_ATTR_RO(ctl_iop0_count);/** * ctl_iop1_count_show - controller iop1 count check * @cdev: pointer to embedded class device +* @attr: device attribute (unused) * @buf: the buffer returned * * A sysfs 'read-only' shost attribute. */ -static ssize_t ctl_iop1_count_show (struct device *cdev,struct device_attribute *attr,char *buf) {
PATCH 12/13 scsi: pmcraid: Fix a kernel-doc warning
In reply to Bart Van AsscheFix the following kernel-doc warning:
drivers/scsi/pmcraid.c:3317: warning: Excess function parameter 'done' description in 'pmcraid_queuecommand_lck'
--- drivers/scsi/pmcraid.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/pmcraid.c +0 -1
@@ -3302,7 +3302,6 @@ static int pmcraid_copy_sglist(/** * pmcraid_queuecommand_lck - Queue a mid-layer request * @scsi_cmd: scsi command struct -* @done: done function * * This function queues a request generated by the mid-layer. Midlayer calls * this routine within host->lock. Some of the functions called by queuecommand
PATCH 13/13 scsi: Remove superfluous #include <linux/async.h> directives
In reply to Bart Van AsscheRemove this include directive from code that does not use any functionality from kernel/async.c.
--- drivers/scsi/hisi_sas/hisi_sas.h | 1 - drivers/scsi/libsas/sas_discover.c | 1 - drivers/scsi/scsi.c | 1 - drivers/scsi/scsi_pm.c | 1 - drivers/scsi/scsi_priv.h | 1 - drivers/scsi/sd.c | 1 - drivers/scsi/ufs/ufshpb.c | 1 - 7 files changed, 7 deletions(-)
drivers/scsi/hisi_sas/hisi_sas.h +0 -1
@@ -8,7 +8,6 @@#define _HISI_SAS_H_#include <linux/acpi.h> -#include <linux/async.h> #include <linux/blk-mq.h> #include <linux/blk-mq-pci.h> #include <linux/clk.h>
drivers/scsi/libsas/sas_discover.c +0 -1
@@ -8,7 +8,6 @@#include <linux/scatterlist.h> #include <linux/slab.h> -#include <linux/async.h> #include <scsi/scsi_host.h> #include <scsi/scsi_eh.h> #include "sas_internal.h"
drivers/scsi/scsi.c +0 -1
@@ -55,7 +55,6 @@#include <linux/notifier.h> #include <linux/cpu.h> #include <linux/mutex.h> -#include <linux/async.h> #include <asm/unaligned.h> #include <scsi/scsi.h>
drivers/scsi/scsi_pm.c +0 -1
@@ -8,7 +8,6 @@#include <linux/pm_runtime.h> #include <linux/export.h> -#include <linux/async.h> #include <linux/blk-pm.h> #include <scsi/scsi.h>
drivers/scsi/scsi_priv.h +0 -1
@@ -3,7 +3,6 @@#define _SCSI_PRIV_H#include <linux/device.h> -#include <linux/async.h> #include <scsi/scsi_device.h> #include <linux/sbitmap.h>
drivers/scsi/sd.c +0 -1
@@ -51,7 +51,6 @@#include <linux/major.h> #include <linux/mutex.h> #include <linux/string_helpers.h> -#include <linux/async.h> #include <linux/slab.h> #include <linux/sed-opal.h> #include <linux/pm_runtime.h>
drivers/scsi/ufs/ufshpb.c +0 -1
@@ -10,7 +10,6 @@*/ #include <asm/unaligned.h> -#include <linux/async.h> #include "ufshcd.h" #include "ufshpb.h"
RE: [PATCH 13/13] scsi: Remove superfluous #include <linux/async.h> directives
Hi Bart,
Quoted 6 lines
Remove this include directive from code that does not use any functionality from
kernel/async.c.Signed-off-by Bart Van Assche <[email protected]>---
Thanks,
Daejun