Re: [PATCH] [SCSI] mvsas: mark symbols static where possible

2016-09-26 Thread Martin K. Petersen
> "Baoyou" == Baoyou Xie  writes:

Baoyou> We get a few warnings when building kernel with W=1:
Baoyou> drivers/scsi/mvsas/mv_sas.c:77:18: warning: no previous
Baoyou> prototype for 'mvs_find_dev_mvi' [-Wmissing-prototypes]
Baoyou> drivers/scsi/mvsas/mv_sas.c:105:5: warning: no previous
Baoyou> prototype for 'mvs_find_dev_phyno' [-Wmissing-prototypes]
Baoyou> drivers/scsi/mvsas/mv_sas.c:1161:20: warning: no previous
Baoyou> prototype for 'mvs_alloc_dev' [-Wmissing-prototypes]
Baoyou> drivers/scsi/mvsas/mv_sas.c:1178:6: warning: no previous
Baoyou> prototype for 'mvs_free_dev' [-Wmissing-prototypes]
Baoyou> drivers/scsi/mvsas/mv_sas.c:1188:5: warning: no previous
Baoyou> prototype for 'mvs_dev_found_notify' [-Wmissing-prototypes]
Baoyou> drivers/scsi/mvsas/mv_sas.c:1244:6: warning: no previous
Baoyou> prototype for 'mvs_dev_gone_notify' [-Wmissing-prototypes]
Baoyou> drivers/scsi/mvsas/mv_sas.c:1614:6: warning: no previous
Baoyou> prototype for 'mvs_set_sense' [-Wmissing-prototypes]
Baoyou> drivers/scsi/mvsas/mv_sas.c:1653:6: warning: no previous
Baoyou> prototype for 'mvs_fill_ssp_resp_iu' [-Wmissing-prototypes]
Baoyou> drivers/scsi/mvsas/mv_64xx.c:139:6: warning: no previous
Baoyou> prototype for 'mvs_64xx_clear_srs_irq' [-Wmissing-prototypes]
Baoyou> drivers/scsi/mvsas/mv_64xx.c:566:6: warning: no previous
Baoyou> prototype for 'mvs_64xx_make_prd' [-Wmissing-prototypes] 

Applied to 4.9/scsi-queue.

-- 
Martin K. Petersen  Oracle Linux Engineering


Re: [PATCH] [SCSI] mvsas: mark symbols static where possible

2016-09-26 Thread Johannes Thumshirn
On Sun, Sep 25, 2016 at 01:48:50PM +0800, Baoyou Xie wrote:
> We get a few warnings when building kernel with W=1:
> drivers/scsi/mvsas/mv_sas.c:77:18: warning: no previous prototype for 
> 'mvs_find_dev_mvi' [-Wmissing-prototypes]
> drivers/scsi/mvsas/mv_sas.c:105:5: warning: no previous prototype for 
> 'mvs_find_dev_phyno' [-Wmissing-prototypes]
> drivers/scsi/mvsas/mv_sas.c:1161:20: warning: no previous prototype for 
> 'mvs_alloc_dev' [-Wmissing-prototypes]
> drivers/scsi/mvsas/mv_sas.c:1178:6: warning: no previous prototype for 
> 'mvs_free_dev' [-Wmissing-prototypes]
> drivers/scsi/mvsas/mv_sas.c:1188:5: warning: no previous prototype for 
> 'mvs_dev_found_notify' [-Wmissing-prototypes]
> drivers/scsi/mvsas/mv_sas.c:1244:6: warning: no previous prototype for 
> 'mvs_dev_gone_notify' [-Wmissing-prototypes]
> drivers/scsi/mvsas/mv_sas.c:1614:6: warning: no previous prototype for 
> 'mvs_set_sense' [-Wmissing-prototypes]
> drivers/scsi/mvsas/mv_sas.c:1653:6: warning: no previous prototype for 
> 'mvs_fill_ssp_resp_iu' [-Wmissing-prototypes]
> drivers/scsi/mvsas/mv_64xx.c:139:6: warning: no previous prototype for 
> 'mvs_64xx_clear_srs_irq' [-Wmissing-prototypes]
> drivers/scsi/mvsas/mv_64xx.c:566:6: warning: no previous prototype for 
> 'mvs_64xx_make_prd' [-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 
> ---

Looks good,
Reviewed-by: Johannes Thumshirn 

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850


[PATCH] [SCSI] mvsas: mark symbols static where possible

2016-09-24 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/scsi/mvsas/mv_sas.c:77:18: warning: no previous prototype for 
'mvs_find_dev_mvi' [-Wmissing-prototypes]
drivers/scsi/mvsas/mv_sas.c:105:5: warning: no previous prototype for 
'mvs_find_dev_phyno' [-Wmissing-prototypes]
drivers/scsi/mvsas/mv_sas.c:1161:20: warning: no previous prototype for 
'mvs_alloc_dev' [-Wmissing-prototypes]
drivers/scsi/mvsas/mv_sas.c:1178:6: warning: no previous prototype for 
'mvs_free_dev' [-Wmissing-prototypes]
drivers/scsi/mvsas/mv_sas.c:1188:5: warning: no previous prototype for 
'mvs_dev_found_notify' [-Wmissing-prototypes]
drivers/scsi/mvsas/mv_sas.c:1244:6: warning: no previous prototype for 
'mvs_dev_gone_notify' [-Wmissing-prototypes]
drivers/scsi/mvsas/mv_sas.c:1614:6: warning: no previous prototype for 
'mvs_set_sense' [-Wmissing-prototypes]
drivers/scsi/mvsas/mv_sas.c:1653:6: warning: no previous prototype for 
'mvs_fill_ssp_resp_iu' [-Wmissing-prototypes]
drivers/scsi/mvsas/mv_64xx.c:139:6: warning: no previous prototype for 
'mvs_64xx_clear_srs_irq' [-Wmissing-prototypes]
drivers/scsi/mvsas/mv_64xx.c:566:6: warning: no previous prototype for 
'mvs_64xx_make_prd' [-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 
---
 drivers/scsi/mvsas/mv_64xx.c | 19 ++-
 drivers/scsi/mvsas/mv_94xx.c | 41 +
 drivers/scsi/mvsas/mv_sas.c  | 16 
 3 files changed, 39 insertions(+), 37 deletions(-)

diff --git a/drivers/scsi/mvsas/mv_64xx.c b/drivers/scsi/mvsas/mv_64xx.c
index 8bb0699..b757d38 100644
--- a/drivers/scsi/mvsas/mv_64xx.c
+++ b/drivers/scsi/mvsas/mv_64xx.c
@@ -136,7 +136,8 @@ static void mvs_64xx_phy_reset(struct mvs_info *mvi, u32 
phy_id, int hard)
}
 }
 
-void mvs_64xx_clear_srs_irq(struct mvs_info *mvi, u8 reg_set, u8 clear_all)
+static void
+mvs_64xx_clear_srs_irq(struct mvs_info *mvi, u8 reg_set, u8 clear_all)
 {
void __iomem *regs = mvi->regs;
u32 tmp;
@@ -563,7 +564,7 @@ static u8 mvs_64xx_assign_reg_set(struct mvs_info *mvi, u8 
*tfs)
return MVS_ID_NOT_MAPPED;
 }
 
-void mvs_64xx_make_prd(struct scatterlist *scatter, int nr, void *prd)
+static void mvs_64xx_make_prd(struct scatterlist *scatter, int nr, void *prd)
 {
int i;
struct scatterlist *sg;
@@ -633,7 +634,7 @@ static void mvs_64xx_phy_work_around(struct mvs_info *mvi, 
int i)
mvs_write_port_vsr_data(mvi, i, tmp);
 }
 
-void mvs_64xx_phy_set_link_rate(struct mvs_info *mvi, u32 phy_id,
+static void mvs_64xx_phy_set_link_rate(struct mvs_info *mvi, u32 phy_id,
struct sas_phy_linkrates *rates)
 {
u32 lrmin = 0, lrmax = 0;
@@ -668,20 +669,20 @@ static void mvs_64xx_clear_active_cmds(struct mvs_info 
*mvi)
 }
 
 
-u32 mvs_64xx_spi_read_data(struct mvs_info *mvi)
+static u32 mvs_64xx_spi_read_data(struct mvs_info *mvi)
 {
void __iomem *regs = mvi->regs_ex;
return ior32(SPI_DATA_REG_64XX);
 }
 
-void mvs_64xx_spi_write_data(struct mvs_info *mvi, u32 data)
+static void mvs_64xx_spi_write_data(struct mvs_info *mvi, u32 data)
 {
void __iomem *regs = mvi->regs_ex;
 iow32(SPI_DATA_REG_64XX, data);
 }
 
 
-int mvs_64xx_spi_buildcmd(struct mvs_info *mvi,
+static int mvs_64xx_spi_buildcmd(struct mvs_info *mvi,
u32  *dwCmd,
u8   cmd,
u8   read,
@@ -705,7 +706,7 @@ int mvs_64xx_spi_buildcmd(struct mvs_info *mvi,
 }
 
 
-int mvs_64xx_spi_issuecmd(struct mvs_info *mvi, u32 cmd)
+static int mvs_64xx_spi_issuecmd(struct mvs_info *mvi, u32 cmd)
 {
void __iomem *regs = mvi->regs_ex;
int retry;
@@ -720,7 +721,7 @@ int mvs_64xx_spi_issuecmd(struct mvs_info *mvi, u32 cmd)
return 0;
 }
 
-int mvs_64xx_spi_waitdataready(struct mvs_info *mvi, u32 timeout)
+static int mvs_64xx_spi_waitdataready(struct mvs_info *mvi, u32 timeout)
 {
void __iomem *regs = mvi->regs_ex;
u32 i, dwTmp;
@@ -735,7 +736,7 @@ int mvs_64xx_spi_waitdataready(struct mvs_info *mvi, u32 
timeout)
return -1;
 }
 
-void mvs_64xx_fix_dma(struct mvs_info *mvi, u32 phy_mask,
+static void mvs_64xx_fix_dma(struct mvs_info *mvi, u32 phy_mask,
int buf_len, int from, void *prd)
 {
int i;
diff --git a/drivers/scsi/mvsas/mv_94xx.c b/drivers/scsi/mvsas/mv_94xx.c
index f6fc4a7..4c57d9a 100644
--- a/drivers/scsi/mvsas/mv_94xx.c
+++ b/drivers/scsi/mvsas/mv_94xx.c
@@ -48,8 +48,8 @@ static void mvs_94xx_detect_porttype(struct mvs_info *mvi, 
int i)
}
 }
 
-void set_phy_tuning(struct mvs_info *mvi, int phy_id,
-   struct phy_tuning phy_tuning)
+static void set_phy_tuning(struct mvs_info *mvi, int phy_id,
+  struct phy_tuning phy_tuning)