mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: be2iscsi: mark symbols static where possible
@ 2016-09-26 12:00 Baoyou Xie
  2016-09-27  4:19 ` Jitendra Bhivare
  2016-09-28  5:07 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Baoyou Xie @ 2016-09-26 12:00 UTC (permalink / raw)
  To: subbu.seetharaman, ketan.mukadam, jitendra.bhivare, jejb,
	martin.petersen
  Cc: linux-scsi, linux-kernel, arnd, baoyou.xie, xie.baoyou, han.fei,
	tang.qiang007

We get 6 warnings when building kernel with W=1:
drivers/scsi/be2iscsi/be_main.c:65:1: warning: no previous prototype for 'beiscsi_log_enable_disp' [-Wmissing-prototypes]
drivers/scsi/be2iscsi/be_main.c:78:1: warning: no previous prototype for 'beiscsi_log_enable_change' [-Wmissing-prototypes]
drivers/scsi/be2iscsi/be_main.c:97:1: warning: no previous prototype for 'beiscsi_log_enable_store' [-Wmissing-prototypes]
drivers/scsi/be2iscsi/be_main.c:116:1: warning: no previous prototype for 'beiscsi_log_enable_init' [-Wmissing-prototypes]
drivers/scsi/be2iscsi/be_main.c:4587:5: warning: no previous prototype for 'beiscsi_iotask_v2' [-Wmissing-prototypes]
drivers/scsi/be2iscsi/be_main.c:4976:6: warning: no previous prototype for 'beiscsi_hba_attrs_init' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.

So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
---
 drivers/scsi/be2iscsi/be_main.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 6a6906f..68138a6 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -61,7 +61,7 @@ MODULE_PARM_DESC(be_max_phys_size,
 		"memory that can be allocated. Range is 16 - 128");
 
 #define beiscsi_disp_param(_name)\
-ssize_t	\
+static ssize_t	\
 beiscsi_##_name##_disp(struct device *dev,\
 			struct device_attribute *attrib, char *buf)	\
 {	\
@@ -74,7 +74,7 @@ beiscsi_##_name##_disp(struct device *dev,\
 }
 
 #define beiscsi_change_param(_name, _minval, _maxval, _defaval)\
-int \
+static int \
 beiscsi_##_name##_change(struct beiscsi_hba *phba, uint32_t val)\
 {\
 	if (val >= _minval && val <= _maxval) {\
@@ -93,7 +93,7 @@ beiscsi_##_name##_change(struct beiscsi_hba *phba, uint32_t val)\
 }
 
 #define beiscsi_store_param(_name)  \
-ssize_t \
+static ssize_t \
 beiscsi_##_name##_store(struct device *dev,\
 			 struct device_attribute *attr, const char *buf,\
 			 size_t count) \
@@ -112,7 +112,7 @@ beiscsi_##_name##_store(struct device *dev,\
 }
 
 #define beiscsi_init_param(_name, _minval, _maxval, _defval) \
-int \
+static int \
 beiscsi_##_name##_init(struct beiscsi_hba *phba, uint32_t val) \
 { \
 	if (val >= _minval && val <= _maxval) {\
@@ -4584,7 +4584,7 @@ static int beiscsi_alloc_pdu(struct iscsi_task *task, uint8_t opcode)
 	io_task->cmd_bhs = NULL;
 	return -ENOMEM;
 }
-int beiscsi_iotask_v2(struct iscsi_task *task, struct scatterlist *sg,
+static int beiscsi_iotask_v2(struct iscsi_task *task, struct scatterlist *sg,
 		       unsigned int num_sg, unsigned int xferlen,
 		       unsigned int writedir)
 {
@@ -4973,7 +4973,7 @@ static int beiscsi_bsg_request(struct bsg_job *job)
 	return rc;
 }
 
-void beiscsi_hba_attrs_init(struct beiscsi_hba *phba)
+static void beiscsi_hba_attrs_init(struct beiscsi_hba *phba)
 {
 	/* Set the logging parameter */
 	beiscsi_log_enable_init(phba, beiscsi_log_enable);
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] scsi: be2iscsi: mark symbols static where possible
  2016-09-26 12:00 [PATCH] scsi: be2iscsi: mark symbols static where possible Baoyou Xie
@ 2016-09-27  4:19 ` Jitendra Bhivare
  2016-09-28  5:07 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Jitendra Bhivare @ 2016-09-27  4:19 UTC (permalink / raw)
  To: Baoyou Xie, Subramanian Seetharaman, Ketan Mukadam, jejb,
	martin.petersen
  Cc: linux-scsi, linux-kernel, arnd, xie.baoyou, han.fei, tang.qiang007

> -----Original Message-----
> From: Baoyou Xie [mailto:baoyou.xie@linaro.org]
> Sent: Monday, September 26, 2016 5:31 PM
> To: subbu.seetharaman@broadcom.com; ketan.mukadam@broadcom.com;
> jitendra.bhivare@broadcom.com; jejb@linux.vnet.ibm.com;
> martin.petersen@oracle.com
> Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org;
arnd@arndb.de;
> baoyou.xie@linaro.org; xie.baoyou@zte.com.cn; han.fei@zte.com.cn;
> tang.qiang007@zte.com.cn
> Subject: [PATCH] scsi: be2iscsi: mark symbols static where possible
>
> We get 6 warnings when building kernel with W=1:
> drivers/scsi/be2iscsi/be_main.c:65:1: warning: no previous prototype for
> 'beiscsi_log_enable_disp' [-Wmissing-prototypes]
> drivers/scsi/be2iscsi/be_main.c:78:1: warning: no previous prototype for
> 'beiscsi_log_enable_change' [-Wmissing-prototypes]
> drivers/scsi/be2iscsi/be_main.c:97:1: warning: no previous prototype for
> 'beiscsi_log_enable_store' [-Wmissing-prototypes]
> drivers/scsi/be2iscsi/be_main.c:116:1: warning: no previous prototype
for
> 'beiscsi_log_enable_init' [-Wmissing-prototypes]
> drivers/scsi/be2iscsi/be_main.c:4587:5: warning: no previous prototype
for
> 'beiscsi_iotask_v2' [-Wmissing-prototypes]
> drivers/scsi/be2iscsi/be_main.c:4976:6: warning: no previous prototype
for
> 'beiscsi_hba_attrs_init' [-Wmissing-prototypes]
>
> In fact, these functions are only used in the file in which they are
declared and
> don't need a declaration, but can be made static.
>
> So this patch marks these functions with 'static'.
>
> Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
> ---
[JB] Looks good.
Reviewed by: Jitendra Bhivare <Jitendra.bhivare@broadcom>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: be2iscsi: mark symbols static where possible
  2016-09-26 12:00 [PATCH] scsi: be2iscsi: mark symbols static where possible Baoyou Xie
  2016-09-27  4:19 ` Jitendra Bhivare
@ 2016-09-28  5:07 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2016-09-28  5:07 UTC (permalink / raw)
  To: Baoyou Xie
  Cc: subbu.seetharaman, ketan.mukadam, jitendra.bhivare, jejb,
	martin.petersen, linux-scsi, linux-kernel, arnd, xie.baoyou,
	han.fei, tang.qiang007

>>>>> "Baoyou" == Baoyou Xie <baoyou.xie@linaro.org> writes:

Baoyou> We get 6 warnings when building kernel with W=1:
Baoyou> drivers/scsi/be2iscsi/be_main.c:65:1: warning: no previous
Baoyou> prototype for 'beiscsi_log_enable_disp' [-Wmissing-prototypes]
Baoyou> drivers/scsi/be2iscsi/be_main.c:78:1: warning: no previous
Baoyou> prototype for 'beiscsi_log_enable_change' [-Wmissing-prototypes]
Baoyou> drivers/scsi/be2iscsi/be_main.c:97:1: warning: no previous
Baoyou> prototype for 'beiscsi_log_enable_store' [-Wmissing-prototypes]
Baoyou> drivers/scsi/be2iscsi/be_main.c:116:1: warning: no previous
Baoyou> prototype for 'beiscsi_log_enable_init' [-Wmissing-prototypes]
Baoyou> drivers/scsi/be2iscsi/be_main.c:4587:5: warning: no previous
Baoyou> prototype for 'beiscsi_iotask_v2' [-Wmissing-prototypes]
Baoyou> drivers/scsi/be2iscsi/be_main.c:4976:6: warning: no previous
Baoyou> prototype for 'beiscsi_hba_attrs_init' [-Wmissing-prototypes]

Applied to 4.9/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-28  5:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-26 12:00 [PATCH] scsi: be2iscsi: mark symbols static where possible Baoyou Xie
2016-09-27  4:19 ` Jitendra Bhivare
2016-09-28  5:07 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®