diff mbox series

scsi: myrs: make some symbols static

Message ID 20200915084008.2826835-1-yanaijie@huawei.com (mailing list archive)
State Accepted
Headers show
Series scsi: myrs: make some symbols static | expand

Commit Message

Jason Yan Sept. 15, 2020, 8:40 a.m. UTC
This addresses the following sparse warning:

drivers/scsi/myrs.c:1532:5: warning: symbol 'myrs_host_reset' was not
declared. Should it be static?
drivers/scsi/myrs.c:1922:27: warning: symbol 'myrs_template' was not
declared. Should it be static?
drivers/scsi/myrs.c:2036:31: warning: symbol 'myrs_raid_functions' was
not declared. Should it be static?
drivers/scsi/myrs.c:2046:6: warning: symbol 'myrs_flush_cache' was not
declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
 drivers/scsi/myrs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Martin K. Petersen Sept. 16, 2020, 1:31 a.m. UTC | #1
Jason,

> This addresses the following sparse warning:
>
> drivers/scsi/myrs.c:1532:5: warning: symbol 'myrs_host_reset' was not
> declared. Should it be static?
> drivers/scsi/myrs.c:1922:27: warning: symbol 'myrs_template' was not
> declared. Should it be static?
> drivers/scsi/myrs.c:2036:31: warning: symbol 'myrs_raid_functions' was
> not declared. Should it be static?
> drivers/scsi/myrs.c:2046:6: warning: symbol 'myrs_flush_cache' was not
> declared. Should it be static?

Applied to 5.10/scsi-staging, thanks!
Martin K. Petersen Sept. 22, 2020, 3:57 a.m. UTC | #2
On Tue, 15 Sep 2020 16:40:08 +0800, Jason Yan wrote:

> This addresses the following sparse warning:
> 
> drivers/scsi/myrs.c:1532:5: warning: symbol 'myrs_host_reset' was not
> declared. Should it be static?
> drivers/scsi/myrs.c:1922:27: warning: symbol 'myrs_template' was not
> declared. Should it be static?
> drivers/scsi/myrs.c:2036:31: warning: symbol 'myrs_raid_functions' was
> not declared. Should it be static?
> drivers/scsi/myrs.c:2046:6: warning: symbol 'myrs_flush_cache' was not
> declared. Should it be static?

Applied to 5.10/scsi-queue, thanks!

[1/1] scsi: myrs: Make some symbols static
      https://git.kernel.org/mkp/scsi/c/ebe41b991d37
diff mbox series

Patch

diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c
index 103803e779f2..7a3ade765ce3 100644
--- a/drivers/scsi/myrs.c
+++ b/drivers/scsi/myrs.c
@@ -1529,7 +1529,7 @@  static struct device_attribute *myrs_shost_attrs[] = {
 /*
  * SCSI midlayer interface
  */
-int myrs_host_reset(struct scsi_cmnd *scmd)
+static int myrs_host_reset(struct scsi_cmnd *scmd)
 {
 	struct Scsi_Host *shost = scmd->device->host;
 	struct myrs_hba *cs = shost_priv(shost);
@@ -1919,7 +1919,7 @@  static void myrs_slave_destroy(struct scsi_device *sdev)
 	kfree(sdev->hostdata);
 }
 
-struct scsi_host_template myrs_template = {
+static struct scsi_host_template myrs_template = {
 	.module			= THIS_MODULE,
 	.name			= "DAC960",
 	.proc_name		= "myrs",
@@ -2033,7 +2033,7 @@  myrs_get_state(struct device *dev)
 	raid_set_state(myrs_raid_template, dev, state);
 }
 
-struct raid_function_template myrs_raid_functions = {
+static struct raid_function_template myrs_raid_functions = {
 	.cookie		= &myrs_template,
 	.is_raid	= myrs_is_raid,
 	.get_resync	= myrs_get_resync,
@@ -2043,7 +2043,7 @@  struct raid_function_template myrs_raid_functions = {
 /*
  * PCI interface functions
  */
-void myrs_flush_cache(struct myrs_hba *cs)
+static void myrs_flush_cache(struct myrs_hba *cs)
 {
 	myrs_dev_op(cs, MYRS_IOCTL_FLUSH_DEVICE_DATA, MYRS_RAID_CONTROLLER);
 }