Re: [PATCH 1/3] megaraid_sas: 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/megaraid/megaraid_sas_fp.c:94:5: warning: no
Baoyou> previous prototype for 'mega_mod64' [-Wmissing-prototypes]
Baoyou> drivers/scsi/megaraid/megaraid_sas_fp.c:112:5: warning: no
Baoyou> previous prototype for 'mega_div64_32' [-Wmissing-prototypes]
Baoyou> drivers/scsi/megaraid/megaraid_sas_fp.c:177:6: warning: no
Baoyou> previous prototype for 'MR_PopulateDrvRaidMap'
Baoyou> [-Wmissing-prototypes]
Baoyou> drivers/scsi/megaraid/megaraid_sas_fp.c:315:5: warning: no
Baoyou> previous prototype for 'MR_GetSpanBlock' [-Wmissing-prototypes]
Baoyou> drivers/scsi/megaraid/megaraid_sas_fp.c:451:5: warning: no
Baoyou> previous prototype for 'mr_spanset_get_span_block'
Baoyou> [-Wmissing-prototypes]
Baoyou> drivers/scsi/megaraid/megaraid_sas_fp.c:692:4: warning: no
Baoyou> previous prototype for 'get_arm' [-Wmissing-prototypes]
Baoyou> drivers/scsi/megaraid/megaraid_sas_fp.c:815:4: warning: no
Baoyou> previous prototype for 'MR_GetPhyParams' [-Wmissing-prototypes]
Baoyou> drivers/scsi/megaraid/megaraid_sas_fp.c:1293:4: warning: no
Baoyou> previous prototype for 'megasas_get_best_arm_pd'
Baoyou> [-Wmissing-prototypes]
Baoyou> drivers/scsi/megaraid/megaraid_sas_fusion.c:106:1: warning: no
Baoyou> previous prototype for 'megasas_enable_intr_fusion'
Baoyou> [-Wmissing-prototypes]
Baoyou> drivers/scsi/megaraid/megaraid_sas_fusion.c:127:1: warning: no
Baoyou> previous prototype for 'megasas_disable_intr_fusion'
Baoyou> [-Wmissing-prototypes] 

Does not apply. Please make sure your patches are against my for-next
branch.

-- 
Martin K. Petersen  Oracle Linux Engineering


RE: [PATCH 1/3] megaraid_sas: mark symbols static where possible

2016-09-25 Thread Sumit Saxena
>-Original Message-
>From: Baoyou Xie [mailto:baoyou@linaro.org]
>Sent: Sunday, September 25, 2016 11:21 AM
>To: kashyap.de...@avagotech.com; sumit.sax...@avagotech.com;
>uday.ling...@avagotech.com; j...@linux.vnet.ibm.com;
>martin.peter...@oracle.com
>Cc: megaraidlinux@avagotech.com; linux-s...@vger.kernel.org; linux-
>ker...@vger.kernel.org; a...@arndb.de; baoyou@linaro.org;
>xie.bao...@zte.com.cn
>Subject: [PATCH 1/3] megaraid_sas: mark symbols static where possible
>
>We get a few warnings when building kernel with W=1:
>drivers/scsi/megaraid/megaraid_sas_fp.c:94:5: warning: no previous
prototype
>for 'mega_mod64' [-Wmissing-prototypes]
>drivers/scsi/megaraid/megaraid_sas_fp.c:112:5: warning: no previous
prototype
>for 'mega_div64_32' [-Wmissing-prototypes]
>drivers/scsi/megaraid/megaraid_sas_fp.c:177:6: warning: no previous
prototype
>for 'MR_PopulateDrvRaidMap' [-Wmissing-prototypes]
>drivers/scsi/megaraid/megaraid_sas_fp.c:315:5: warning: no previous
prototype
>for 'MR_GetSpanBlock' [-Wmissing-prototypes]
>drivers/scsi/megaraid/megaraid_sas_fp.c:451:5: warning: no previous
prototype
>for 'mr_spanset_get_span_block' [-Wmissing-prototypes]
>drivers/scsi/megaraid/megaraid_sas_fp.c:692:4: warning: no previous
prototype
>for 'get_arm' [-Wmissing-prototypes]
>drivers/scsi/megaraid/megaraid_sas_fp.c:815:4: warning: no previous
prototype
>for 'MR_GetPhyParams' [-Wmissing-prototypes]
>drivers/scsi/megaraid/megaraid_sas_fp.c:1293:4: warning: no previous
>prototype for 'megasas_get_best_arm_pd' [-Wmissing-prototypes]
>drivers/scsi/megaraid/megaraid_sas_fusion.c:106:1: warning: no previous
>prototype for 'megasas_enable_intr_fusion' [-Wmissing-prototypes]
>drivers/scsi/megaraid/megaraid_sas_fusion.c:127:1: warning: no previous
>prototype for 'megasas_disable_intr_fusion' [-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/megaraid/megaraid_sas_base.c   |  6 ++--
> drivers/scsi/megaraid/megaraid_sas_fp.c | 30 ++---
> drivers/scsi/megaraid/megaraid_sas_fusion.c | 52
+++--
> 3 files changed, 48 insertions(+), 40 deletions(-)
>
>diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
>b/drivers/scsi/megaraid/megaraid_sas_base.c
>index c236c4d..1b033da 100644
>--- a/drivers/scsi/megaraid/megaraid_sas_base.c
>+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
>@@ -209,7 +209,7 @@ static int megasas_get_ld_vf_affiliation(struct
>megasas_instance *instance,  int megasas_check_mpio_paths(struct
>megasas_instance *instance,
>struct scsi_cmnd *scmd);
>
>-int
>+static int
> megasas_issue_dcmd(struct megasas_instance *instance, struct megasas_cmd
>*cmd)  {
>   instance->instancet->fire_cmd(instance,
>@@ -2057,7 +2057,7 @@ megasas_internal_reset_defer_cmds(struct
>megasas_instance *instance);  static void
process_fw_state_change_wq(struct
>work_struct *work);
>
>-void megasas_do_ocr(struct megasas_instance *instance)
>+static void megasas_do_ocr(struct megasas_instance *instance)
> {
>   if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS1064R) ||
>   (instance->pdev->device == PCI_DEVICE_ID_DELL_PERC5) || @@ -
>3981,7 +3981,7 @@ int megasas_alloc_cmds(struct megasas_instance
*instance)
>  * Return 0 for only Fusion adapter, if driver load/unload is not in
progress
>  * or FW is not under OCR.
>  */
>-inline int
>+static inline int
> dcmd_timeout_ocr_possible(struct megasas_instance *instance) {
>
>   if (!instance->ctrl_context)
>diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c
>b/drivers/scsi/megaraid/megaraid_sas_fp.c
>index e413113..d22bb59 100644
>--- a/drivers/scsi/megaraid/megaraid_sas_fp.c
>+++ b/drivers/scsi/megaraid/megaraid_sas_fp.c
>@@ -91,7 +91,7 @@ static u8 mr_spanset_get_phy_params(struct
>megasas_instance *instance, u32 ld,  static u64 get_row_from_strip(struct
>megasas_instance *instance, u32 ld,
>   u64 strip, struct MR_DRV_RAID_MAP_ALL *map);
>
>-u32 mega_mod64(u64 dividend, u32 divisor)
>+static u32 mega_mod64(u64 dividend, u32 divisor)
> {
>   u64 d;
>   u32 remainder;
>@@ -109,7 +109,7 @@ u32 mega_mod64(u64 dividend, u32 divisor)
>  *
>  * @return quotient
>  **/
>-u64 mega_div64_32(uint64_t dividend, uint32_t divisor)
>+static u64 mega_div64_32(uint64_t dividend, uint32_t divisor)
> {
>   u32 remainder;
>   u64 d;
>@@ -174,7 +174,7 @@ static struct MR_LD_SPAN *MR_LdSpanPtrGet(u32 ld,
>u32 span,
> /*
>  * This function will Populate Driver Map using firmware raid map
>  */
>-void MR_PopulateDrvRaidMap(struct megasas_instance *instance)
>+static void MR_PopulateDrvRaidMap(struct megasas_instance *instance)
> {
>   struct fusion_context *fusion = instance->ctrl_context;
>   struct MR_FW_RAID_MAP_ALL *fw_map_old= NULL;
>@@ -312,8 +312,8 @@ u8 MR_ValidateMap