* [PATCH] fix:pmcraid: mark symbols static where possible
@ 2016-08-27 15:49 Baoyou Xie
2016-09-02 10:56 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Baoyou Xie @ 2016-08-27 15:49 UTC (permalink / raw)
To: jejb, martin.petersen
Cc: linux-scsi, linux-kernel, arnd, baoyou.xie, xie.baoyou
We get 4 warnings about global functions without a declaration
in the scsi pmcraid driver when building with W=1:
drivers/scsi/pmcraid.c:309:6: warning: no previous prototype for 'pmcraid_init_cmdblk' [-Wmissing-prototypes]
drivers/scsi/pmcraid.c:404:6: warning: no previous prototype for 'pmcraid_return_cmd' [-Wmissing-prototypes]
drivers/scsi/pmcraid.c:1713:6: warning: no previous prototype for 'pmcraid_ioasc_logger' [-Wmissing-prototypes]
drivers/scsi/pmcraid.c:3141:1: warning: no previous prototype for 'pmcraid_init_ioadls' [-Wmissing-prototypes]
In fact, these functions are only used in the file in which it is declared
and don't need a declaration, but can be made static.
so this patch marks it 'static'.
Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
---
drivers/scsi/pmcraid.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index b2a8820..68a5c34 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -306,7 +306,7 @@ static int pmcraid_change_queue_depth(struct scsi_device *scsi_dev, int depth)
* Return Value
* None
*/
-void pmcraid_init_cmdblk(struct pmcraid_cmd *cmd, int index)
+static void pmcraid_init_cmdblk(struct pmcraid_cmd *cmd, int index)
{
struct pmcraid_ioarcb *ioarcb = &(cmd->ioa_cb->ioarcb);
dma_addr_t dma_addr = cmd->ioa_cb_bus_addr;
@@ -401,7 +401,7 @@ static struct pmcraid_cmd *pmcraid_get_free_cmd(
* Return Value:
* nothing
*/
-void pmcraid_return_cmd(struct pmcraid_cmd *cmd)
+static void pmcraid_return_cmd(struct pmcraid_cmd *cmd)
{
struct pmcraid_instance *pinstance = cmd->drv_inst;
unsigned long lock_flags;
@@ -1710,7 +1710,7 @@ static struct pmcraid_ioasc_error *pmcraid_get_error_info(u32 ioasc)
* @ioasc: ioasc code
* @cmd: pointer to command that resulted in 'ioasc'
*/
-void pmcraid_ioasc_logger(u32 ioasc, struct pmcraid_cmd *cmd)
+static void pmcraid_ioasc_logger(u32 ioasc, struct pmcraid_cmd *cmd)
{
struct pmcraid_ioasc_error *error_info = pmcraid_get_error_info(ioasc);
@@ -3137,7 +3137,7 @@ static int pmcraid_eh_host_reset_handler(struct scsi_cmnd *scmd)
* returns pointer pmcraid_ioadl_desc, initialized to point to internal
* or external IOADLs
*/
-struct pmcraid_ioadl_desc *
+static struct pmcraid_ioadl_desc *
pmcraid_init_ioadls(struct pmcraid_cmd *cmd, int sgcount)
{
struct pmcraid_ioadl_desc *ioadl;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fix:pmcraid: mark symbols static where possible
2016-08-27 15:49 [PATCH] fix:pmcraid: mark symbols static where possible Baoyou Xie
@ 2016-09-02 10:56 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2016-09-02 10:56 UTC (permalink / raw)
To: Baoyou Xie
Cc: jejb, martin.petersen, linux-scsi, linux-kernel, arnd, xie.baoyou
>>>>> "Baoyou" == Baoyou Xie <baoyou.xie@linaro.org> writes:
Baoyou> We get 4 warnings about global functions without a declaration
Baoyou> in the scsi pmcraid driver when building with W=1:
Baoyou> drivers/scsi/pmcraid.c:309:6: warning: no previous prototype for
Baoyou> 'pmcraid_init_cmdblk' [-Wmissing-prototypes]
Baoyou> drivers/scsi/pmcraid.c:404:6: warning: no previous prototype for
Baoyou> 'pmcraid_return_cmd' [-Wmissing-prototypes]
Baoyou> drivers/scsi/pmcraid.c:1713:6: warning: no previous prototype
Baoyou> for 'pmcraid_ioasc_logger' [-Wmissing-prototypes]
Baoyou> drivers/scsi/pmcraid.c:3141:1: warning: no previous prototype
Baoyou> for 'pmcraid_init_ioadls' [-Wmissing-prototypes]
Baoyou> In fact, these functions are only used in the file in which it
Baoyou> is declared and don't need a declaration, but can be made
Baoyou> static. so this patch marks it 'static'.
Applied to 4.9/scsi-queue.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-02 10:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-27 15:49 [PATCH] fix:pmcraid: mark symbols static where possible Baoyou Xie
2016-09-02 10:56 ` 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;
as well as URLs for NNTP newsgroup(s).