scsi: be2iscsi: set some be_main.c variables storage-class-specifier to static
Commit Message
smatch reports several warnings
drivers/scsi/be2iscsi/be_main.c:148:1: warning:
symbol 'dev_attr_beiscsi_log_enable' was not declared. Should it be static?
drivers/scsi/be2iscsi/be_main.c:158:1: warning:
symbol 'dev_attr_beiscsi_drvr_ver' was not declared. Should it be static?
drivers/scsi/be2iscsi/be_main.c:159:1: warning:
symbol 'dev_attr_beiscsi_adapter_family' was not declared. Should it be static?
drivers/scsi/be2iscsi/be_main.c:160:1: warning:
symbol 'dev_attr_beiscsi_fw_ver' was not declared. Should it be static?
drivers/scsi/be2iscsi/be_main.c:161:1: warning:
symbol 'dev_attr_beiscsi_phys_port' was not declared. Should it be static?
drivers/scsi/be2iscsi/be_main.c:162:1: warning:
symbol 'dev_attr_beiscsi_active_session_count' was not declared. Should it be static?
drivers/scsi/be2iscsi/be_main.c:164:1: warning:
symbol 'dev_attr_beiscsi_free_session_count' was not declared. Should it be static ?
These variables are only used in be_main.c, so should be static.
Signed-off-by: Tom Rix <trix@redhat.com>
---
drivers/scsi/be2iscsi/be_main.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
Comments
Tom,
> smatch reports several warnings
Applied to 6.4/scsi-staging, thanks!
On Mon, 13 Mar 2023 20:51:57 -0400, Tom Rix wrote:
> smatch reports several warnings
> drivers/scsi/be2iscsi/be_main.c:148:1: warning:
> symbol 'dev_attr_beiscsi_log_enable' was not declared. Should it be static?
> drivers/scsi/be2iscsi/be_main.c:158:1: warning:
> symbol 'dev_attr_beiscsi_drvr_ver' was not declared. Should it be static?
> drivers/scsi/be2iscsi/be_main.c:159:1: warning:
> symbol 'dev_attr_beiscsi_adapter_family' was not declared. Should it be static?
> drivers/scsi/be2iscsi/be_main.c:160:1: warning:
> symbol 'dev_attr_beiscsi_fw_ver' was not declared. Should it be static?
> drivers/scsi/be2iscsi/be_main.c:161:1: warning:
> symbol 'dev_attr_beiscsi_phys_port' was not declared. Should it be static?
> drivers/scsi/be2iscsi/be_main.c:162:1: warning:
> symbol 'dev_attr_beiscsi_active_session_count' was not declared. Should it be static?
> drivers/scsi/be2iscsi/be_main.c:164:1: warning:
> symbol 'dev_attr_beiscsi_free_session_count' was not declared. Should it be static ?
>
> [...]
Applied to 6.4/scsi-queue, thanks!
[1/1] scsi: be2iscsi: set some be_main.c variables storage-class-specifier to static
https://git.kernel.org/mkp/scsi/c/1efbacd2b95a
@@ -139,7 +139,7 @@ beiscsi_disp_param(_name)\
beiscsi_change_param(_name, _minval, _maxval, _defval)\
beiscsi_store_param(_name)\
beiscsi_init_param(_name, _minval, _maxval, _defval)\
-DEVICE_ATTR(beiscsi_##_name, S_IRUGO | S_IWUSR,\
+static DEVICE_ATTR(beiscsi_##_name, S_IRUGO | S_IWUSR,\
beiscsi_##_name##_disp, beiscsi_##_name##_store)
/*
@@ -155,14 +155,14 @@ BEISCSI_RW_ATTR(log_enable, 0x00,
"\t\t\t\tConfiguration Path : 0x20\n"
"\t\t\t\tiSCSI Protocol : 0x40\n");
-DEVICE_ATTR(beiscsi_drvr_ver, S_IRUGO, beiscsi_drvr_ver_disp, NULL);
-DEVICE_ATTR(beiscsi_adapter_family, S_IRUGO, beiscsi_adap_family_disp, NULL);
-DEVICE_ATTR(beiscsi_fw_ver, S_IRUGO, beiscsi_fw_ver_disp, NULL);
-DEVICE_ATTR(beiscsi_phys_port, S_IRUGO, beiscsi_phys_port_disp, NULL);
-DEVICE_ATTR(beiscsi_active_session_count, S_IRUGO,
- beiscsi_active_session_disp, NULL);
-DEVICE_ATTR(beiscsi_free_session_count, S_IRUGO,
- beiscsi_free_session_disp, NULL);
+static DEVICE_ATTR(beiscsi_drvr_ver, S_IRUGO, beiscsi_drvr_ver_disp, NULL);
+static DEVICE_ATTR(beiscsi_adapter_family, S_IRUGO, beiscsi_adap_family_disp, NULL);
+static DEVICE_ATTR(beiscsi_fw_ver, S_IRUGO, beiscsi_fw_ver_disp, NULL);
+static DEVICE_ATTR(beiscsi_phys_port, S_IRUGO, beiscsi_phys_port_disp, NULL);
+static DEVICE_ATTR(beiscsi_active_session_count, S_IRUGO,
+ beiscsi_active_session_disp, NULL);
+static DEVICE_ATTR(beiscsi_free_session_count, S_IRUGO,
+ beiscsi_free_session_disp, NULL);
static struct attribute *beiscsi_attrs[] = {
&dev_attr_beiscsi_log_enable.attr,