Re: [PATCH] pm8001: mark symbols static where possible

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

Baoyou> We get 2 warnings when building kernel with W=1:
Baoyou> drivers/scsi/pm8001/pm8001_sas.c:530:23: warning: no previous
Baoyou> prototype for 'pm8001_alloc_dev' [-Wmissing-prototypes]
Baoyou> drivers/scsi/pm8001/pm8001_hwi.c:4495:5: warning: no previous
Baoyou> prototype for 'pm8001_chip_phy_stop_req' [-Wmissing-prototypes]

Applied to 4.9/scsi-queue.

-- 
Martin K. Petersen  Oracle Linux Engineering


RE: [PATCH] pm8001: mark symbols static where possible

2016-09-25 Thread lindar_liu
Thanks for fix.
Acked-by: Lindar Liu 

> -Original Message-
> From: Baoyou Xie [mailto:baoyou@linaro.org]
> Sent: Friday, September 23, 2016 9:54 PM
> To: jinpu.w...@profitbricks.com; lindar_...@usish.com;
> j...@linux.vnet.ibm.com; martin.peter...@oracle.com
> Cc: pmc...@pmcs.com; linux-s...@vger.kernel.org;
> linux-kernel@vger.kernel.org; a...@arndb.de; baoyou@linaro.org;
> xie.bao...@zte.com.cn
> Subject: [PATCH] pm8001: mark symbols static where possible
> 
> We get 2 warnings when building kernel with W=1:
> drivers/scsi/pm8001/pm8001_sas.c:530:23: warning: no previous prototype
> for 'pm8001_alloc_dev' [-Wmissing-prototypes]
> drivers/scsi/pm8001/pm8001_hwi.c:4495:5: warning: no previous prototype
> for 'pm8001_chip_phy_stop_req' [-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/pm8001/pm8001_hwi.c | 4 ++--
> drivers/scsi/pm8001/pm8001_sas.c | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/pm8001/pm8001_hwi.c
> b/drivers/scsi/pm8001/pm8001_hwi.c
> index 04e67a1..10546fa 100644
> --- a/drivers/scsi/pm8001/pm8001_hwi.c
> +++ b/drivers/scsi/pm8001/pm8001_hwi.c
> @@ -4492,8 +4492,8 @@ pm8001_chip_phy_start_req(struct
> pm8001_hba_info *pm8001_ha, u8 phy_id)
>   * @num: the inbound queue number
>   * @phy_id: the phy id which we wanted to start up.
>   */
> -int pm8001_chip_phy_stop_req(struct pm8001_hba_info *pm8001_ha,
> - u8 phy_id)
> +static int pm8001_chip_phy_stop_req(struct pm8001_hba_info
> *pm8001_ha,
> + u8 phy_id)
>  {
>   struct phy_stop_req payload;
>   struct inbound_queue_table *circularQ; diff --git
> a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
> index dc33dfa..ce584c3 100644
> --- a/drivers/scsi/pm8001/pm8001_sas.c
> +++ b/drivers/scsi/pm8001/pm8001_sas.c
> @@ -527,7 +527,7 @@ void pm8001_ccb_task_free(struct pm8001_hba_info
> *pm8001_ha,
>* pm8001_alloc_dev - find a empty pm8001_device
>* @pm8001_ha: our hba card information
>*/
> -struct pm8001_device *pm8001_alloc_dev(struct pm8001_hba_info
> *pm8001_ha)
> +static struct pm8001_device *pm8001_alloc_dev(struct pm8001_hba_info
> +*pm8001_ha)
>  {
>   u32 dev;
>   for (dev = 0; dev < PM8001_MAX_DEVICES; dev++) {
> --
> 2.7.4



[PATCH] pm8001: mark symbols static where possible

2016-09-23 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/scsi/pm8001/pm8001_sas.c:530:23: warning: no previous prototype for 
'pm8001_alloc_dev' [-Wmissing-prototypes]
drivers/scsi/pm8001/pm8001_hwi.c:4495:5: warning: no previous prototype for 
'pm8001_chip_phy_stop_req' [-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/pm8001/pm8001_hwi.c | 4 ++--
 drivers/scsi/pm8001/pm8001_sas.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index 04e67a1..10546fa 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -4492,8 +4492,8 @@ pm8001_chip_phy_start_req(struct pm8001_hba_info 
*pm8001_ha, u8 phy_id)
  * @num: the inbound queue number
  * @phy_id: the phy id which we wanted to start up.
  */
-int pm8001_chip_phy_stop_req(struct pm8001_hba_info *pm8001_ha,
-   u8 phy_id)
+static int pm8001_chip_phy_stop_req(struct pm8001_hba_info *pm8001_ha,
+   u8 phy_id)
 {
struct phy_stop_req payload;
struct inbound_queue_table *circularQ;
diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index dc33dfa..ce584c3 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -527,7 +527,7 @@ void pm8001_ccb_task_free(struct pm8001_hba_info *pm8001_ha,
   * pm8001_alloc_dev - find a empty pm8001_device
   * @pm8001_ha: our hba card information
   */
-struct pm8001_device *pm8001_alloc_dev(struct pm8001_hba_info *pm8001_ha)
+static struct pm8001_device *pm8001_alloc_dev(struct pm8001_hba_info 
*pm8001_ha)
 {
u32 dev;
for (dev = 0; dev < PM8001_MAX_DEVICES; dev++) {
-- 
2.7.4