[PATCH 3/3] megaraid_sas: clean function declarations in megaraid_sas_base.c up

2016-09-24 Thread Baoyou Xie
We get 8 warnings when building kernel with W=1:
drivers/scsi/megaraid/megaraid_sas_fusion.c:281:1: warning: no previous 
prototype for 'megasas_free_cmds_fusion' [-Wmissing-prototypes]
drivers/scsi/megaraid/megaraid_sas_fusion.c:714:1: warning: no previous 
prototype for 'megasas_ioc_init_fusion' [-Wmissing-prototypes]
drivers/scsi/megaraid/megaraid_sas_fusion.c:1038:1: warning: no previous 
prototype for 'megasas_get_map_info' [-Wmissing-prototypes]
drivers/scsi/megaraid/megaraid_sas_fusion.c:1061:1: warning: no previous 
prototype for 'megasas_sync_map_info' [-Wmissing-prototypes]
drivers/scsi/megaraid/megaraid_sas_fusion.c:2599:1: warning: no previous 
prototype for 'megasas_release_fusion' [-Wmissing-prototypes]
drivers/scsi/megaraid/megaraid_sas_fusion.c:2833:7: warning: no previous 
prototype for 'megasas_reset_reply_desc' [-Wmissing-prototypes]
drivers/scsi/megaraid/megaraid_sas_fusion.c:3354:5: warning: no previous 
prototype for 'megasas_check_mpio_paths' [-Wmissing-prototypes]
drivers/scsi/megaraid/megaraid_sas_fusion.c:3664:6: warning: no previous 
prototype for 'megasas_fusion_ocr_wq' [-Wmissing-prototypes]

In fact, these functions are declared in
drivers/scsi/megaraid/megaraid_sas_base.c, but should be
declared in a header file. thus can be recognized in other file.

So this patch moves the declarations into
drivers/scsi/megaraid/megaraid_sas.h.

Signed-off-by: Baoyou Xie 
---
 drivers/scsi/megaraid/megaraid_sas.h  | 15 ++-
 drivers/scsi/megaraid/megaraid_sas_base.c | 14 --
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas.h 
b/drivers/scsi/megaraid/megaraid_sas.h
index d1a6ea5..aad81c6 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -2398,5 +2398,18 @@ void megasas_sriov_heartbeat_handler(unsigned long 
instance_addr);
 
 void megasas_free_cmds(struct megasas_instance *instance);
 int megasas_alloc_cmds(struct megasas_instance *instance);
-
+void
+megasas_free_cmds_fusion(struct megasas_instance *instance);
+int
+megasas_ioc_init_fusion(struct megasas_instance *instance);
+u8
+megasas_get_map_info(struct megasas_instance *instance);
+int
+megasas_sync_map_info(struct megasas_instance *instance);
+void
+megasas_release_fusion(struct megasas_instance *instance);
+void megasas_reset_reply_desc(struct megasas_instance *instance);
+int megasas_check_mpio_paths(struct megasas_instance *instance,
+struct scsi_cmnd *scmd);
+void megasas_fusion_ocr_wq(struct work_struct *work);
 #endif /*LSI_MEGARAID_SAS_H */
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c 
b/drivers/scsi/megaraid/megaraid_sas_base.c
index 1b033da..73f4e27 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -189,25 +189,11 @@ u32
 megasas_build_and_issue_cmd(struct megasas_instance *instance,
struct scsi_cmnd *scmd);
 static void megasas_complete_cmd_dpc(unsigned long instance_addr);
-void
-megasas_release_fusion(struct megasas_instance *instance);
-int
-megasas_ioc_init_fusion(struct megasas_instance *instance);
-void
-megasas_free_cmds_fusion(struct megasas_instance *instance);
-u8
-megasas_get_map_info(struct megasas_instance *instance);
-int
-megasas_sync_map_info(struct megasas_instance *instance);
 int
 wait_and_poll(struct megasas_instance *instance, struct megasas_cmd *cmd,
int seconds);
-void megasas_reset_reply_desc(struct megasas_instance *instance);
-void megasas_fusion_ocr_wq(struct work_struct *work);
 static int megasas_get_ld_vf_affiliation(struct megasas_instance *instance,
 int initial);
-int megasas_check_mpio_paths(struct megasas_instance *instance,
-struct scsi_cmnd *scmd);
 
 static int
 megasas_issue_dcmd(struct megasas_instance *instance, struct megasas_cmd *cmd)
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] megaraid_sas: clean function declarations in megaraid_sas_fusion.c up

2016-09-24 Thread Baoyou Xie
We get 10 warnings when building kernel with W=1:
drivers/scsi/megaraid/megaraid_sas_base.c:226:21: warning: no previous 
prototype for 'megasas_get_cmd' [-Wmissing-prototypes]
drivers/scsi/megaraid/megaraid_sas_base.c:252:1: warning: no previous 
declaration for 'megasas_return_cmd' [-Wmissing-declarations]
drivers/scsi/megaraid/megaraid_sas_base.c:998:1: warning: no previous prototype 
for 'megasas_issue_polled' [-Wmissing-prototypes]
drivers/scsi/megaraid/megaraid_sas_base.c:1936:6: warning: no previous 
prototype for 'megaraid_sas_kill_hba' [-Wmissing-prototypes]
drivers/scsi/megaraid/megaraid_sas_base.c:1965:1: warning: no previous 
prototype for 'megasas_check_and_restore_queue_depth' [-Wmissing-prototypes]
drivers/scsi/megaraid/megaraid_sas_base.c:2043:6: warning: no previous 
prototype for 'megasas_start_timer' [-Wmissing-prototypes]
drivers/scsi/megaraid/megaraid_sas_base.c:2366:5: warning: no previous 
prototype for 'megasas_sriov_start_heartbeat' [-Wmissing-prototypes]
drivers/scsi/megaraid/megaraid_sas_base.c:2436:6: warning: no previous 
prototype for 'megasas_sriov_heartbeat_handler' [-Wmissing-prototypes]
drivers/scsi/megaraid/megaraid_sas_base.c:3878:6: warning: no previous 
prototype for 'megasas_free_cmds' [-Wmissing-prototypes]
drivers/scsi/megaraid/megaraid_sas_base.c:3915:5: warning: no previous 
prototype for 'megasas_alloc_cmds' [-Wmissing-prototypes]

In fact, these functions are declared in
drivers/scsi/megaraid/megaraid_sas_fusion.c, but should be
declared in a header file. thus can be recognized in other file.

So this patch moves the declarations into
drivers/scsi/megaraid/megaraid_sas.h.

Signed-off-by: Baoyou Xie 
---
 drivers/scsi/megaraid/megaraid_sas.h| 19 +++
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 15 ---
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas.h 
b/drivers/scsi/megaraid/megaraid_sas.h
index ca86c88..d1a6ea5 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -2380,4 +2380,23 @@ void megasas_update_sdev_properties(struct scsi_device 
*sdev);
 int megasas_reset_fusion(struct Scsi_Host *shost, int reason);
 int megasas_task_abort_fusion(struct scsi_cmnd *scmd);
 int megasas_reset_target_fusion(struct scsi_cmnd *scmd);
+struct megasas_cmd *megasas_get_cmd(struct megasas_instance *instance);
+void
+megasas_return_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd);
+int
+megasas_issue_polled(struct megasas_instance *instance,
+struct megasas_cmd *cmd);
+void megaraid_sas_kill_hba(struct megasas_instance *instance);
+void
+megasas_check_and_restore_queue_depth(struct megasas_instance *instance);
+void megasas_start_timer(struct megasas_instance *instance,
+struct timer_list *timer,
+void *fn, unsigned long interval);
+int megasas_sriov_start_heartbeat(struct megasas_instance *instance,
+ int initial);
+void megasas_sriov_heartbeat_handler(unsigned long instance_addr);
+
+void megasas_free_cmds(struct megasas_instance *instance);
+int megasas_alloc_cmds(struct megasas_instance *instance);
+
 #endif /*LSI_MEGARAID_SAS_H */
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c 
b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index e7b77e1..6210922 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -59,9 +59,6 @@
 #include "megaraid_sas.h"
 
 
-extern void megasas_free_cmds(struct megasas_instance *instance);
-extern struct megasas_cmd *megasas_get_cmd(struct megasas_instance
-  *instance);
 extern void
 megasas_complete_cmd(struct megasas_instance *instance,
 struct megasas_cmd *cmd, u8 alt_status);
@@ -69,24 +66,12 @@ int
 wait_and_poll(struct megasas_instance *instance, struct megasas_cmd *cmd,
  int seconds);
 
-void
-megasas_return_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd);
-int megasas_alloc_cmds(struct megasas_instance *instance);
 int
 megasas_clear_intr_fusion(struct megasas_register_set __iomem *regs);
-int
-megasas_issue_polled(struct megasas_instance *instance,
-struct megasas_cmd *cmd);
-void
-megasas_check_and_restore_queue_depth(struct megasas_instance *instance);
 
 int megasas_transition_to_ready(struct megasas_instance *instance, int ocr);
-void megaraid_sas_kill_hba(struct megasas_instance *instance);
 
 extern u32 megasas_dbg_lvl;
-void megasas_sriov_heartbeat_handler(unsigned long instance_addr);
-int megasas_sriov_start_heartbeat(struct megasas_instance *instance,
- int initial);
 void megasas_start_timer(struct megasas_instance *instance,
struct timer_list *timer,
 void *fn, unsigned long interval);
-- 
2.7.4

--
To unsubscribe fro

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

2016-09-24 Thread Baoyou Xie
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_ValidateMapInfo(struct megasas_instance *instance)
return 1;
 }
 
-u32 MR_GetSpanBlock(u32 ld, u64 row, u64 *span_blk,
-   struct MR_DRV_RAID_MAP_ALL *map)
+static u32 MR_GetSpanBlock(u32 ld, u64 row, u64 *span_blk,
+  struct MR_DRV_RAID_MAP_ALL *map)
 {
struct MR_SPAN_BLOCK_INFO *pSpanBlock = MR_LdSpanInfoGet(ld, map);
struct MR_QUAD_ELEMENT*quad;
@@ -448,8 +448,10 @@ static int getSpanInfo(struct MR_DRV_RAID_MAP_ALL *map,
 *div_error- Devide error code.
 */
 
-u32 mr_spanset_get_span_block(stru

[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)

[PATCH] lpfc: mark symbols static where possible

2016-09-24 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/scsi/lpfc/lpfc_sli.c:5693:1: warning: no previous prototype for 
'lpfc_set_features' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_sli.c:8972:1: warning: no previous prototype for 
'lpfc_sli_calc_ring' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4621:1: warning: no previous prototype for 
'lpfc_rdp_res_link_service' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4633:1: warning: no previous prototype for 
'lpfc_rdp_res_sfp_desc' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4698:1: warning: no previous prototype for 
'lpfc_rdp_res_link_error' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4727:1: warning: no previous prototype for 
'lpfc_rdp_res_bbc_desc' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4752:1: warning: no previous prototype for 
'lpfc_rdp_res_oed_temp_desc' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4780:1: warning: no previous prototype for 
'lpfc_rdp_res_oed_voltage_desc' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4809:1: warning: no previous prototype for 
'lpfc_rdp_res_oed_txbias_desc' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4838:1: warning: no previous prototype for 
'lpfc_rdp_res_oed_txpower_desc' [-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/lpfc/lpfc_ct.c   | 82 +--
 drivers/scsi/lpfc/lpfc_els.c  | 34 +-
 drivers/scsi/lpfc/lpfc_mbox.c |  4 +--
 drivers/scsi/lpfc/lpfc_sli.c  |  4 +--
 4 files changed, 62 insertions(+), 62 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index 63e48d4..4ac03b1 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -1535,7 +1535,7 @@ lpfc_fdmi_num_disc_check(struct lpfc_vport *vport)
 }
 
 /* Routines for all individual HBA attributes */
-int
+static int
 lpfc_fdmi_hba_attr_wwnn(struct lpfc_vport *vport, struct lpfc_fdmi_attr_def 
*ad)
 {
struct lpfc_fdmi_attr_entry *ae;
@@ -1551,7 +1551,7 @@ lpfc_fdmi_hba_attr_wwnn(struct lpfc_vport *vport, struct 
lpfc_fdmi_attr_def *ad)
ad->AttrType = cpu_to_be16(RHBA_NODENAME);
return size;
 }
-int
+static int
 lpfc_fdmi_hba_attr_manufacturer(struct lpfc_vport *vport,
struct lpfc_fdmi_attr_def *ad)
 {
@@ -1573,7 +1573,7 @@ lpfc_fdmi_hba_attr_manufacturer(struct lpfc_vport *vport,
return size;
 }
 
-int
+static int
 lpfc_fdmi_hba_attr_sn(struct lpfc_vport *vport, struct lpfc_fdmi_attr_def *ad)
 {
struct lpfc_hba *phba = vport->phba;
@@ -1594,7 +1594,7 @@ lpfc_fdmi_hba_attr_sn(struct lpfc_vport *vport, struct 
lpfc_fdmi_attr_def *ad)
return size;
 }
 
-int
+static int
 lpfc_fdmi_hba_attr_model(struct lpfc_vport *vport,
 struct lpfc_fdmi_attr_def *ad)
 {
@@ -1615,7 +1615,7 @@ lpfc_fdmi_hba_attr_model(struct lpfc_vport *vport,
return size;
 }
 
-int
+static int
 lpfc_fdmi_hba_attr_description(struct lpfc_vport *vport,
   struct lpfc_fdmi_attr_def *ad)
 {
@@ -1637,7 +1637,7 @@ lpfc_fdmi_hba_attr_description(struct lpfc_vport *vport,
return size;
 }
 
-int
+static int
 lpfc_fdmi_hba_attr_hdw_ver(struct lpfc_vport *vport,
   struct lpfc_fdmi_attr_def *ad)
 {
@@ -1669,7 +1669,7 @@ lpfc_fdmi_hba_attr_hdw_ver(struct lpfc_vport *vport,
return size;
 }
 
-int
+static int
 lpfc_fdmi_hba_attr_drvr_ver(struct lpfc_vport *vport,
struct lpfc_fdmi_attr_def *ad)
 {
@@ -1690,7 +1690,7 @@ lpfc_fdmi_hba_attr_drvr_ver(struct lpfc_vport *vport,
return size;
 }
 
-int
+static int
 lpfc_fdmi_hba_attr_rom_ver(struct lpfc_vport *vport,
   struct lpfc_fdmi_attr_def *ad)
 {
@@ -1715,7 +1715,7 @@ lpfc_fdmi_hba_attr_rom_ver(struct lpfc_vport *vport,
return size;
 }
 
-int
+static int
 lpfc_fdmi_hba_attr_fmw_ver(struct lpfc_vport *vport,
   struct lpfc_fdmi_attr_def *ad)
 {
@@ -1736,7 +1736,7 @@ lpfc_fdmi_hba_attr_fmw_ver(struct lpfc_vport *vport,
return size;
 }
 
-int
+static int
 lpfc_fdmi_hba_attr_os_ver(struct lpfc_vport *vport,
  struct lpfc_fdmi_attr_def *ad)
 {
@@ -1759,7 +1759,7 @@ lpfc_fdmi_hba_attr_os_ver(struct lpfc_vport *vport,
return size;
 }
 
-int
+static int
 lpfc_fdmi_hba_attr_ct_len(struct lpfc_vport *vport,
  struct lpfc_fdmi_attr_def *ad)
 {
@@ -1775,7 +1775,7 @@ lpfc_fdmi_hba_attr_ct_len(struct lpfc_vport *vport,
return size;
 }
 
-int
+static int
 lpfc_fdmi_hba_attr_symbolic_name(struct lpfc_vport *vport,
 struct lpfc_fdmi_attr_def *ad)
 {
@@ -1794,7 +1794,7 @@ lpfc_fdmi_hba_attr_symbolic_name(struct lpfc_vport *vpor

RE: [PATCH v6 1/9] rpmb: add Replay Protected Memory Block (RPMB) subsystem

2016-09-24 Thread Winkler, Tomas
> 
> 
> >
> > Signed-off-by: Tomas Winkler 
> > Signed-off-by: Alexander Usyskin 
> Tested-by: Avri Altman 
> 
> - mmc -  full functionality. One issue found that was fixed on V6: patch V6 
> 2/9.
> - ufs - read & read counter only.  Testing is still wip.
> 
> 
> > +static int rpmb_request_verify(struct rpmb_dev *rdev, struct rpmb_data
> > +*rpmbd) {
> 
> Seems excessive - Isn't the standard should be enforced by the device?

Yes the device is responsible to detect the issues in the protocol. The 
rpmb_request_verify is called only for the managed interface (rpmb_cmd_req) the 
raw interface (rpm_cmd_seq) is going through.  Second,  we only check more or 
less if we can accommodate the request/response into the arguments.  If there 
is a specific issue  you see in this check, please let me know.

Thanks
Tomas




[PATCH 0/3] g_NCR5380: Modernization

2016-09-24 Thread Ondrej Zary

This small patch series removes deprecated code from g_NCR5380 driver
and converts it from scsi_module.c to scsi_add_host().

Tested with:
HP C2502 (53C400A chip)
Canon FG2-5202 (53C400 chip, memory-mapped)
DTC-3181L (DTCT-436P chip, PnP)

P.S. I don't like the ifdef mess needed for g_NCR5380_mmio. Should I try to
merge the code so g_NCR5380 will support both PIO and MMIO cards (and
g_NCR5380_mmio could be removed)?

-- 
Ondrej Zary
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] g_NCR5380: Reduce overrides[] from array to struct

2016-09-24 Thread Ondrej Zary
Remove compile-time card type definition GENERIC_NCR5380_OVERRIDE.
Then remove all code iterating the overrides[] array and reduce it to
struct card.

Signed-off-by: Ondrej Zary 
---
 drivers/scsi/g_NCR5380.c |  351 ++
 1 file changed, 167 insertions(+), 184 deletions(-)

diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index 7e50b44e..5162de6 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -42,19 +42,12 @@ static int ncr_53c400a;
 static int dtc_3181e;
 static int hp_c2502;
 
-static struct override {
+static struct card {
NCR5380_map_type NCR5380_map_name;
int irq;
int dma;
int board;  /* Use NCR53c400, Ricoh, etc. extensions ? */
-} overrides
-#ifdef GENERIC_NCR5380_OVERRIDE
-[] __initdata = GENERIC_NCR5380_OVERRIDE;
-#else
-[1] __initdata = { { 0,},};
-#endif
-
-#define NO_OVERRIDES ARRAY_SIZE(overrides)
+} card;
 
 #ifndef SCSI_G_NCR5380_MEM
 /*
@@ -85,16 +78,13 @@ static void magic_configure(int idx, u8 irq, u8 magic[])
  * @tpnt: the scsi template
  *
  * Scan for the present of NCR5380, NCR53C400, NCR53C400A, DTC3181E
- * and DTC436(ISAPnP) controllers. If overrides have been set we use
- * them.
+ * and DTC436(ISAPnP) controllers.
  *
  * Locks: none
  */
 
 static int __init generic_NCR5380_detect(struct scsi_host_template *tpnt)
 {
-   static int current_override;
-   int count;
unsigned int *ports;
u8 *magic = NULL;
 #ifndef SCSI_G_NCR5380_MEM
@@ -124,28 +114,25 @@ static int __init generic_NCR5380_detect(struct 
scsi_host_template *tpnt)
 #endif
 
if (ncr_irq)
-   overrides[0].irq = ncr_irq;
+   card.irq = ncr_irq;
if (ncr_dma)
-   overrides[0].dma = ncr_dma;
+   card.dma = ncr_dma;
if (ncr_addr)
-   overrides[0].NCR5380_map_name = (NCR5380_map_type) ncr_addr;
+   card.NCR5380_map_name = (NCR5380_map_type) ncr_addr;
if (ncr_5380)
-   overrides[0].board = BOARD_NCR5380;
+   card.board = BOARD_NCR5380;
else if (ncr_53c400)
-   overrides[0].board = BOARD_NCR53C400;
+   card.board = BOARD_NCR53C400;
else if (ncr_53c400a)
-   overrides[0].board = BOARD_NCR53C400A;
+   card.board = BOARD_NCR53C400A;
else if (dtc_3181e)
-   overrides[0].board = BOARD_DTC3181E;
+   card.board = BOARD_DTC3181E;
else if (hp_c2502)
-   overrides[0].board = BOARD_HP_C2502;
+   card.board = BOARD_HP_C2502;
 #ifndef SCSI_G_NCR5380_MEM
-   if (!current_override && isapnp_present()) {
+   if (isapnp_present()) {
struct pnp_dev *dev = NULL;
-   count = 0;
while ((dev = pnp_find_dev(NULL, ISAPNP_VENDOR('D', 'T', 'C'), 
ISAPNP_FUNCTION(0x436e), dev))) {
-   if (count >= NO_OVERRIDES)
-   break;
if (pnp_device_attach(dev) < 0)
continue;
if (pnp_activate_dev(dev) < 0) {
@@ -159,202 +146,198 @@ static int __init generic_NCR5380_detect(struct 
scsi_host_template *tpnt)
continue;
}
if (pnp_irq_valid(dev, 0))
-   overrides[count].irq = pnp_irq(dev, 0);
+   card.irq = pnp_irq(dev, 0);
else
-   overrides[count].irq = NO_IRQ;
+   card.irq = NO_IRQ;
if (pnp_dma_valid(dev, 0))
-   overrides[count].dma = pnp_dma(dev, 0);
+   card.dma = pnp_dma(dev, 0);
else
-   overrides[count].dma = DMA_NONE;
-   overrides[count].NCR5380_map_name = (NCR5380_map_type) 
pnp_port_start(dev, 0);
-   overrides[count].board = BOARD_DTC3181E;
-   count++;
+   card.dma = DMA_NONE;
+   card.NCR5380_map_name = (NCR5380_map_type) 
pnp_port_start(dev, 0);
+   card.board = BOARD_DTC3181E;
+   break;
}
}
 #endif
 
-   for (count = 0; current_override < NO_OVERRIDES; ++current_override) {
-   if (!(overrides[current_override].NCR5380_map_name))
-   continue;
+   if (!(card.NCR5380_map_name))
+   return 0;
 
-   ports = NULL;
-   flags = 0;
-   switch (overrides[current_override].board) {
-   case BOARD_NCR5380:
-   flags = FLAG_NO_PSEUDO_DMA | FLAG_DMA_FIXUP;
-   break;
-   case BOARD_NCR53C400A:
-  

[PATCH 1/3] g_NCR5380: Remove deprecated __setup

2016-09-24 Thread Ondrej Zary
Remove deprecated __setup for parsing command line parameters.
g_NCR5380.* parameters could be used instead.

Signed-off-by: Ondrej Zary 
---
 drivers/scsi/g_NCR5380.c |  135 --
 1 file changed, 135 deletions(-)

diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index 516bd6c..7e50b44e 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -56,136 +56,6 @@ static struct override {
 
 #define NO_OVERRIDES ARRAY_SIZE(overrides)
 
-#ifndef MODULE
-
-/**
- * internal_setup  -   handle lilo command string override
- * @board: BOARD_* identifier for the board
- * @str: unused
- * @ints: numeric parameters
- *
- * Do LILO command line initialization of the overrides array. Display
- * errors when needed
- *
- * Locks: none
- */
-
-static void __init internal_setup(int board, char *str, int *ints)
-{
-   static int commandline_current;
-   switch (board) {
-   case BOARD_NCR5380:
-   if (ints[0] != 2 && ints[0] != 3) {
-   printk(KERN_ERR "generic_NCR5380_setup : usage 
ncr5380=" STRVAL(NCR5380_map_name) ",irq,dma\n");
-   return;
-   }
-   break;
-   case BOARD_NCR53C400:
-   if (ints[0] != 2) {
-   printk(KERN_ERR "generic_NCR53C400_setup : usage 
ncr53c400=" STRVAL(NCR5380_map_name) ",irq\n");
-   return;
-   }
-   break;
-   case BOARD_NCR53C400A:
-   if (ints[0] != 2) {
-   printk(KERN_ERR "generic_NCR53C400A_setup : usage 
ncr53c400a=" STRVAL(NCR5380_map_name) ",irq\n");
-   return;
-   }
-   break;
-   case BOARD_DTC3181E:
-   if (ints[0] != 2) {
-   printk("generic_DTC3181E_setup : usage dtc3181e=" 
STRVAL(NCR5380_map_name) ",irq\n");
-   return;
-   }
-   break;
-   }
-
-   if (commandline_current < NO_OVERRIDES) {
-   overrides[commandline_current].NCR5380_map_name = 
(NCR5380_map_type) ints[1];
-   overrides[commandline_current].irq = ints[2];
-   if (ints[0] == 3)
-   overrides[commandline_current].dma = ints[3];
-   else
-   overrides[commandline_current].dma = DMA_NONE;
-   overrides[commandline_current].board = board;
-   ++commandline_current;
-   }
-}
-
-
-/**
- * do_NCR53C80_setup   -   set up entry point
- * @str: unused
- *
- * Setup function invoked at boot to parse the ncr5380= command
- * line.
- */
-
-static int __init do_NCR5380_setup(char *str)
-{
-   int ints[10];
-
-   get_options(str, ARRAY_SIZE(ints), ints);
-   internal_setup(BOARD_NCR5380, str, ints);
-   return 1;
-}
-
-/**
- * do_NCR53C400_setup  -   set up entry point
- * @str: unused
- * @ints: integer parameters from kernel setup code
- *
- * Setup function invoked at boot to parse the ncr53c400= command
- * line.
- */
-
-static int __init do_NCR53C400_setup(char *str)
-{
-   int ints[10];
-
-   get_options(str, ARRAY_SIZE(ints), ints);
-   internal_setup(BOARD_NCR53C400, str, ints);
-   return 1;
-}
-
-/**
- * do_NCR53C400A_setup -   set up entry point
- * @str: unused
- * @ints: integer parameters from kernel setup code
- *
- * Setup function invoked at boot to parse the ncr53c400a= command
- * line.
- */
-
-static int __init do_NCR53C400A_setup(char *str)
-{
-   int ints[10];
-
-   get_options(str, ARRAY_SIZE(ints), ints);
-   internal_setup(BOARD_NCR53C400A, str, ints);
-   return 1;
-}
-
-/**
- * do_DTC3181E_setup   -   set up entry point
- * @str: unused
- * @ints: integer parameters from kernel setup code
- *
- * Setup function invoked at boot to parse the dtc3181e= command
- * line.
- */
-
-static int __init do_DTC3181E_setup(char *str)
-{
-   int ints[10];
-
-   get_options(str, ARRAY_SIZE(ints), ints);
-   internal_setup(BOARD_DTC3181E, str, ints);
-   return 1;
-}
-
-#endif
-
 #ifndef SCSI_G_NCR5380_MEM
 /*
  * Configure I/O address of 53C400A or DTC436 by writing magic numbers
@@ -741,8 +611,3 @@ static struct isapnp_device_id id_table[] = {
 
 MODULE_DEVICE_TABLE(isapnp, id_table);
 #endif
-
-__setup("ncr5380=", do_NCR5380_setup);
-__setup("ncr53c400=", do_NCR53C400_setup);
-__setup("ncr53c400a=", do_NCR53C400A_setup);
-__setup("dtc3181e=", do_DTC3181E_setup);
-- 
Ondrej Zary

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] g_NCR5380: Stop using scsi_module.c

2016-09-24 Thread Ondrej Zary
Convert g_NCR5380 to use scsi_add_host instead of scsi_module.c
Use pnp_driver and isa_driver to manage cards.

Signed-off-by: Ondrej Zary 
---
 drivers/scsi/g_NCR5380.c |  310 +-
 drivers/scsi/g_NCR5380.h |8 --
 2 files changed, 169 insertions(+), 149 deletions(-)

diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index 5162de6..6cf6b00 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -30,24 +30,25 @@
 #include "NCR5380.h"
 #include 
 #include 
-#include 
+#include 
+#include 
 #include 
 
-static int ncr_irq;
-static int ncr_dma;
-static int ncr_addr;
-static int ncr_5380;
-static int ncr_53c400;
-static int ncr_53c400a;
-static int dtc_3181e;
-static int hp_c2502;
-
-static struct card {
-   NCR5380_map_type NCR5380_map_name;
-   int irq;
-   int dma;
-   int board;  /* Use NCR53c400, Ricoh, etc. extensions ? */
-} card;
+#define MAX_CARDS 8
+
+static int irq[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+module_param_array(irq, int, NULL, 0);
+MODULE_PARM_DESC(irq, "IRQ number(s)");
+
+static int base[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+module_param_array(base, int, NULL, 0);
+MODULE_PARM_DESC(base, "base address(es)");
+
+static int card[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
+module_param_array(card, int, NULL, 0);
+MODULE_PARM_DESC(card, "card type (0=NCR5380, 1=NCR53C400, 2=NCR53C400A, 
3=DTC3181E, 4=HP C2502)");
+
+MODULE_LICENSE("GPL");
 
 #ifndef SCSI_G_NCR5380_MEM
 /*
@@ -73,17 +74,9 @@ static void magic_configure(int idx, u8 irq, u8 magic[])
 }
 #endif
 
-/**
- * generic_NCR5380_detect  -   look for NCR5380 controllers
- * @tpnt: the scsi template
- *
- * Scan for the present of NCR5380, NCR53C400, NCR53C400A, DTC3181E
- * and DTC436(ISAPnP) controllers.
- *
- * Locks: none
- */
-
-static int __init generic_NCR5380_detect(struct scsi_host_template *tpnt)
+static struct Scsi_Host *generic_NCR5380_hw_init(
+   struct scsi_host_template *tpnt, struct device *pdev,
+   int base, int irq, int board)
 {
unsigned int *ports;
u8 *magic = NULL;
@@ -108,64 +101,13 @@ static int __init generic_NCR5380_detect(struct 
scsi_host_template *tpnt)
struct Scsi_Host *instance;
struct NCR5380_hostdata *hostdata;
 #ifdef SCSI_G_NCR5380_MEM
-   unsigned long base;
void __iomem *iomem;
resource_size_t iomem_size;
 #endif
 
-   if (ncr_irq)
-   card.irq = ncr_irq;
-   if (ncr_dma)
-   card.dma = ncr_dma;
-   if (ncr_addr)
-   card.NCR5380_map_name = (NCR5380_map_type) ncr_addr;
-   if (ncr_5380)
-   card.board = BOARD_NCR5380;
-   else if (ncr_53c400)
-   card.board = BOARD_NCR53C400;
-   else if (ncr_53c400a)
-   card.board = BOARD_NCR53C400A;
-   else if (dtc_3181e)
-   card.board = BOARD_DTC3181E;
-   else if (hp_c2502)
-   card.board = BOARD_HP_C2502;
-#ifndef SCSI_G_NCR5380_MEM
-   if (isapnp_present()) {
-   struct pnp_dev *dev = NULL;
-   while ((dev = pnp_find_dev(NULL, ISAPNP_VENDOR('D', 'T', 'C'), 
ISAPNP_FUNCTION(0x436e), dev))) {
-   if (pnp_device_attach(dev) < 0)
-   continue;
-   if (pnp_activate_dev(dev) < 0) {
-   printk(KERN_ERR "dtc436e probe: activate 
failed\n");
-   pnp_device_detach(dev);
-   continue;
-   }
-   if (!pnp_port_valid(dev, 0)) {
-   printk(KERN_ERR "dtc436e probe: no valid 
port\n");
-   pnp_device_detach(dev);
-   continue;
-   }
-   if (pnp_irq_valid(dev, 0))
-   card.irq = pnp_irq(dev, 0);
-   else
-   card.irq = NO_IRQ;
-   if (pnp_dma_valid(dev, 0))
-   card.dma = pnp_dma(dev, 0);
-   else
-   card.dma = DMA_NONE;
-   card.NCR5380_map_name = (NCR5380_map_type) 
pnp_port_start(dev, 0);
-   card.board = BOARD_DTC3181E;
-   break;
-   }
-   }
-#endif
-
-   if (!(card.NCR5380_map_name))
-   return 0;
-
ports = NULL;
flags = 0;
-   switch (card.board) {
+   switch (board) {
case BOARD_NCR5380:
flags = FLAG_NO_PSEUDO_DMA | FLAG_DMA_FIXUP;
break;
@@ -191,17 +133,20 @@ static int __init generic_NCR5380_detect(struct 
scsi_host_template *tpnt)
magic_configure(-1, 0, magic);
 
region_size = 16;
-
-   if (card.NCR5380_map_name != PORT_AUTO)
+   

Re: [PATCH 1/3] devicetree: bindings: scsi: hisi_sas hip07 support

2016-09-24 Thread John Garry

On 23/09/2016 19:36, Rob Herring wrote:

On Tue, Sep 20, 2016 at 06:48:58PM +0800, John Garry wrote:

Add support for hip07 chipset to bindings.

Chipset hip07 has v2 hw.

The sas-v2 quirk amt is expanded to cover hip07.

Signed-off-by: John Garry 
Signed-off-by: Xiang Chen 
---
 Documentation/devicetree/bindings/scsi/hisilicon-sas.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt 
b/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
index bf2411f..e604527 100644
--- a/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
+++ b/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
@@ -6,6 +6,7 @@ Main node required properties:
   - compatible : value should be as follows:
(a) "hisilicon,hip05-sas-v1" for v1 hw in hip05 chipset
(b) "hisilicon,hip06-sas-v2" for v2 hw in hip06 chipset
+   (c) "hisilicon,hip07-sas-v2" for v2 hw in hip07 chipset
   - sas-addr : array of 8 bytes for host SAS address
   - reg : Address and length of the SAS register
   - hisilicon,sas-syscon: phandle of syscon used for sas control
@@ -47,7 +48,7 @@ Main node required properties:
increasing order.

 Optional main node properties:
- - hip06-sas-v2-quirk-amt : when set, indicates that the v2 controller has the
+ - hip06/7-sas-v2-quirk-amt : when set, indicates that the v2 controller has 
the


Just use the existing property name for hip07.


OK, but you mean existing hip06 property (hip06-sas-v2-quirk-amt), right?




"am-max-transmissions" limitation.

 Example:
--
1.9.1



.




--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3] add u64 number parser

2016-09-24 Thread Linus Torvalds
On Sat, Sep 24, 2016 at 8:27 AM, James Smart  wrote:
>
> add u64 number parser
>
> Prior patch revised to use kasprintf.
> Modified match_number to use kasprintf as well

Why would you do this? It's insane. kasprintf() is not the right thing
at all to use for anything like this. It appears that you want to use
strncpy() or something. Or you could just avoid the extra copy
entirely in 99% of all cases and just use simple_strtol() and check
that the end didn't overflow the substring, which it presumably never
does anyway.

Yes, the stupid code is already disgustingly bad. But let's not make
it *worse*, for chrissake!

   Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] MAINTAINERS: Update open-iscsi maintainers

2016-09-24 Thread Lee Duncan
[Added linux-scsi to the cc list.]

I will resubmit an updated version of this patch.

On 09/23/2016 02:34 PM, Lee Duncan wrote:
> Chris Leech and I are taking over open-iscsi
> maintenance from Mike Christie.
> 
> Signed-off-by: Lee Duncan 
> ---
>  MAINTAINERS | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 01bff8ea28d8..0afaf42d5416 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -6448,7 +6448,8 @@ S:  Maintained
>  F:   drivers/firmware/iscsi_ibft*
>  
>  ISCSI
> -M:   Mike Christie 
> +M:   Lee Duncan 
> +M:   Chris Leech 
>  L:   open-is...@googlegroups.com
>  W:   www.open-iscsi.org
>  T:   git 
> git://git.kernel.org/pub/scm/linux/kernel/git/mnc/linux-2.6-iscsi.git
> 

-- 
Lee Duncan
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3] add u64 number parser

2016-09-24 Thread James Smart

add u64 number parser

Prior patch revised to use kasprintf.
Modified match_number to use kasprintf as well

Signed-off-by: James Smart 
---
 include/linux/parser.h |  1 +
 lib/parser.c   | 51 ++
 2 files changed, 48 insertions(+), 4 deletions(-)

diff --git a/include/linux/parser.h b/include/linux/parser.h
index 39d5b79..884c1e6 100644
--- a/include/linux/parser.h
+++ b/include/linux/parser.h
@@ -27,6 +27,7 @@ typedef struct {
 
 int match_token(char *, const match_table_t table, substring_t args[]);
 int match_int(substring_t *, int *result);
+int match_u64(substring_t *, u64 *result);
 int match_octal(substring_t *, int *result);
 int match_hex(substring_t *, int *result);
 bool match_wildcard(const char *pattern, const char *str);
diff --git a/lib/parser.c b/lib/parser.c
index b6d1163..7e9d23f 100644
--- a/lib/parser.c
+++ b/lib/parser.c
@@ -131,13 +131,11 @@ static int match_number(substring_t *s, int *result, int 
base)
char *buf;
int ret;
long val;
-   size_t len = s->to - s->from;
+   int len = s->to - s->from;
 
-   buf = kmalloc(len + 1, GFP_KERNEL);
+   buf = kasprintf(GFP_KERNEL, "%.*s", len, s->from);
if (!buf)
return -ENOMEM;
-   memcpy(buf, s->from, len);
-   buf[len] = '\0';
 
ret = 0;
val = simple_strtol(buf, &endp, base);
@@ -152,6 +150,34 @@ static int match_number(substring_t *s, int *result, int 
base)
 }
 
 /**
+ * match_u64int: scan a number in the given base from a substring_t
+ * @s: substring to be scanned
+ * @result: resulting u64 on success
+ * @base: base to use when converting string
+ *
+ * Description: Given a &substring_t and a base, attempts to parse the 
substring
+ * as a number in that base. On success, sets @result to the integer 
represented
+ * by the string and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on 
failure.
+ */
+static int match_u64int(substring_t *s, u64 *result, int base)
+{
+   char *buf;
+   int ret;
+   u64 val;
+   int len = s->to - s->from;
+
+   buf = kasprintf(GFP_KERNEL, "%.*s", len, s->from);
+   if (!buf)
+   return -ENOMEM;
+
+   ret = kstrtoull(buf, base, &val);
+   if (!ret)
+   *result = val;
+   kfree(buf);
+   return ret;
+}
+
+/**
  * match_int: - scan a decimal representation of an integer from a substring_t
  * @s: substring_t to be scanned
  * @result: resulting integer on success
@@ -167,6 +193,23 @@ int match_int(substring_t *s, int *result)
 EXPORT_SYMBOL(match_int);
 
 /**
+ * match_u64: - scan a decimal representation of a u64 from
+ *  a substring_t
+ * @s: substring_t to be scanned
+ * @result: resulting unsigned long long on success
+ *
+ * Description: Attempts to parse the &substring_t @s as a long decimal
+ * integer. On success, sets @result to the integer represented by the
+ * string and returns 0.
+ * Returns -ENOMEM, -EINVAL, or -ERANGE on failure.
+ */
+int match_u64(substring_t *s, u64 *result)
+{
+   return match_u64int(s, result, 0);
+}
+EXPORT_SYMBOL(match_u64);
+
+/**
  * match_octal: - scan an octal representation of an integer from a substring_t
  * @s: substring_t to be scanned
  * @result: resulting integer on success
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE RE

2016-09-24 Thread Mr.Campbell Neiman
This message is the last notification about U USD14.5 million bearing our
Name as Beneficiary, all effort to reach you have not be successful,
Please if you Receive this message kindly respond back stating your Desire
to make the claim, Reconfirm your full name and age Mr. Mr.Campbell Neiman

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html