be2iscsi: Fix warnings from new checkpatch.pl
Subsystems (2)
PATCH 1/12 be2iscsi: Fix warnings from new checkpatch.pl
The latest checkpatch.pl throws some new warnings. Fixing it
to get rid of a bunch of warnings
Signed-off-by Jayamohan Kallickal <[email protected]>
--- drivers/scsi/be2iscsi/be.h | 6 +- drivers/scsi/be2iscsi/be_cmds.c | 24 +++--- drivers/scsi/be2iscsi/be_cmds.h | 20 +++--- drivers/scsi/be2iscsi/be_iscsi.c | 32 ++++---- drivers/scsi/be2iscsi/be_main.c | 145 +++++++++++++++++++------------------ drivers/scsi/be2iscsi/be_main.h | 20 +++--- drivers/scsi/be2iscsi/be_mgmt.c | 6 +- 7 files changed, 128 insertions(+), 125 deletions(-)
drivers/scsi/be2iscsi/be.h +3 -3
@@ -128,8 +128,8 @@ struct be_ctrl_info {#define mcc_timeout 120000/* 5s timeout */ /* Returns number of pages spanned by the data starting at the given addr */ -#define PAGES_4K_SPANNED (_address, size) \ - ((u32)((((size_t)(_address) & (PAGE_SIZE_4K - 1)) + \ +#define PAGES_4K_SPANNED (_address, size) \ + ((u32)((((size_t)(_address) & (PAGE_SIZE_4K - 1)) + \ (size) + (PAGE_SIZE_4K - 1)) >> PAGE_SHIFT_4K))/* Byte offset into the page corresponding to given address */
@@ -137,7 +137,7 @@ struct be_ctrl_info { ((size_t )(addr) & (PAGE_SIZE_4K -1 )) /* Returns bit offset within a DWORD of a bitfield */ -#define AMAP_BIT_OFFSET (_struct, field) \ +#define AMAP_BIT_OFFSET (_struct, field) \ (((size_t)&(((_struct *)0)->field))%32)/* Returns the bit mask of the field that is NOT shifted into location. */
drivers/scsi/be2iscsi/be_cmds.c +12 -12
@@ -151,20 +151,20 @@ void beiscsi_async_link_state_process(struct beiscsi_hba *phba, {switch (evt->port_link_status) {case ASYNC_EVENT_LINK_DOWN : -SE_DEBUG (DBG_LVL_1 ,"Link Down on Physical Port %d \n" , - evt->physical_port); +SE_DEBUG (DBG_LVL_1 ,"Link Down on Physical Port %d\n" , + evt->physical_port); phba->state |=BE_ADAPTER_LINK_DOWN ;iscsi_host_for_each_session (phba->shost, be2iscsi_fail_session);break ;case ASYNC_EVENT_LINK_UP : phba->state =BE_ADAPTER_UP ; -SE_DEBUG (DBG_LVL_1 ,"Link UP on Physical Port %d \n" , +SE_DEBUG (DBG_LVL_1 ,"Link UP on Physical Port %d\n" , evt->physical_port);break ;default :SE_DEBUG (DBG_LVL_1 ,"Unexpected Async Notification %d on" -"Physical Port %d \n" , +"Physical Port %d\n" , evt->port_link_status, evt->physical_port); }
@@ -199,7 +199,7 @@ int beiscsi_process_mcc(struct beiscsi_hba *phba)else SE_DEBUG (DBG_LVL_1 ," Unsupported Async Event, flags" -" = 0x%08x \n" , compl->flags); +" = 0x%08x\n" , compl->flags); }else if (compl->flags &CQE_FLAGS_COMPLETED_MASK ) { status =be_mcc_compl_process (ctrl, compl);
@@ -286,7 +286,7 @@ int be_mbox_notify(struct be_ctrl_info *ctrl) status =be_mbox_db_ready_wait (ctrl);if (status !=0 ) { -SE_DEBUG (DBG_LVL_1 ," be_mbox_db_ready_wait failed 1\n" ); +SE_DEBUG (DBG_LVL_1 ," be_mbox_db_ready_wait failed\n" );return status; } val =0 ;
@@ -297,14 +297,14 @@ int be_mbox_notify(struct be_ctrl_info *ctrl) status =be_mbox_db_ready_wait (ctrl);if (status !=0 ) { -SE_DEBUG (DBG_LVL_1 ," be_mbox_db_ready_wait failed 2\n" ); +SE_DEBUG (DBG_LVL_1 ," be_mbox_db_ready_wait failed\n" );return status; }if (be_mcc_compl_is_new (compl)) { status =be_mcc_compl_process (ctrl, &mbox->compl);be_mcc_compl_use (compl);if (status) { -SE_DEBUG (DBG_LVL_1 ,"After be_mcc_compl_process \n" ); +SE_DEBUG (DBG_LVL_1 ,"After be_mcc_compl_process\n" );return status; } }else {
@@ -500,7 +500,7 @@ int be_cmd_fw_initialize(struct be_ctrl_info *ctrl) status =be_mbox_notify (ctrl);if (status) -SE_DEBUG (DBG_LVL_1 ,"be_cmd_fw_initialize Failed \n" ); +SE_DEBUG (DBG_LVL_1 ,"be_cmd_fw_initialize Failed\n" );spin_unlock (&ctrl->mbox_lock);return status;
@@ -517,7 +517,7 @@ int beiscsi_cmd_cq_create(struct be_ctrl_info *ctrl,void *ctxt = &req->context;int status; -SE_DEBUG (DBG_LVL_8 ,"In beiscsi_cmd_cq_create \n" ); +SE_DEBUG (DBG_LVL_8 ,"In beiscsi_cmd_cq_create\n" );spin_lock (&ctrl->mbox_lock);memset (wrb,0 ,sizeof (*wrb));
@@ -550,7 +550,7 @@ int beiscsi_cmd_cq_create(struct be_ctrl_info *ctrl, cq->id =le16_to_cpu (resp->cq_id); cq->created = true; }else -SE_DEBUG (DBG_LVL_1 ,"In be_cmd_cq_create, status=ox%08x \n" , +SE_DEBUG (DBG_LVL_1 ,"In be_cmd_cq_create, status=ox%08x\n" , status);spin_unlock (&ctrl->mbox_lock);
@@ -619,7 +619,7 @@ int beiscsi_cmd_q_destroy(struct be_ctrl_info *ctrl, struct be_queue_info *q,u8 subsys =0 , opcode =0 ;int status; -SE_DEBUG (DBG_LVL_8 ,"In beiscsi_cmd_q_destroy \n" ); +SE_DEBUG (DBG_LVL_8 ,"In beiscsi_cmd_q_destroy\n" );spin_lock (&ctrl->mbox_lock);memset (wrb,0 ,sizeof (*wrb));be_wrb_hdr_prepare (wrb,sizeof (*req), true,0 );
drivers/scsi/be2iscsi/be_cmds.h +10 -10
@@ -47,8 +47,8 @@ struct be_mcc_wrb {#define CQE_FLAGS_VALID_MASK (1 << 31)#define CQE_FLAGS_ASYNC_MASK (1 << 30) -#define CQE_FLAGS_COMPLETED_MASK (1 << 28) -#define CQE_FLAGS_CONSUMED_MASK (1 << 27) +#define CQE_FLAGS_COMPLETED_MASK (1 << 28) +#define CQE_FLAGS_CONSUMED_MASK (1 << 27)/* Completion Status */ #define MCC_STATUS_SUCCESS 0x0
@@ -143,14 +143,14 @@ struct be_mcc_mailbox {*/ #define OPCODE_COMMON_CQ_CREATE 12#define OPCODE_COMMON_EQ_CREATE 13 -#define OPCODE_COMMON_MCC_CREATE 21 -#define OPCODE_COMMON_GET_CNTL_ATTRIBUTES 32 +#define OPCODE_COMMON_MCC_CREATE 21 +#define OPCODE_COMMON_GET_CNTL_ATTRIBUTES 32#define OPCODE_COMMON_GET_FW_VERSION 35#define OPCODE_COMMON_MODIFY_EQ_DELAY 41#define OPCODE_COMMON_FIRMWARE_CONFIG 42 -#define OPCODE_COMMON_MCC_DESTROY 53 -#define OPCODE_COMMON_CQ_DESTROY 54 -#define OPCODE_COMMON_EQ_DESTROY 55 +#define OPCODE_COMMON_MCC_DESTROY 53 +#define OPCODE_COMMON_CQ_DESTROY 54 +#define OPCODE_COMMON_EQ_DESTROY 55#define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG 58#define OPCODE_COMMON_FUNCTION_RESET 61
@@ -164,9 +164,9 @@ struct be_mcc_mailbox {#define OPCODE_COMMON_ISCSI_NTWK_GET_NIC_CONFIG 7#define OPCODE_COMMON_ISCSI_SET_FRAGNUM_BITS_FOR_SGL_CRA 61#define OPCODE_COMMON_ISCSI_DEFQ_CREATE 64 -#define OPCODE_COMMON_ISCSI_DEFQ_DESTROY 65 +#define OPCODE_COMMON_ISCSI_DEFQ_DESTROY 65#define OPCODE_COMMON_ISCSI_WRBQ_CREATE 66 -#define OPCODE_COMMON_ISCSI_WRBQ_DESTROY 67 +#define OPCODE_COMMON_ISCSI_WRBQ_DESTROY 67struct be_cmd_req_hdr {u8 opcode;/* dword 0 */
@@ -875,7 +875,7 @@ struct be_fw_cfg {*/ #define UNSOL_HDR_NOTIFY 28/* Unsolicited header notify.*/ #define UNSOL_DATA_NOTIFY 29/* Unsolicited data notify.*/ -#define UNSOL_DATA_DIGEST_ERROR_NOTIFY 30/* Unsolicited data digest +#define UNSOL_DATA_DIGEST_ERROR_NOTIFY 30/* Unsolicited data digest * error notify. */ #define DRIVERMSG_NOTIFY 31/* TCP acknowledge based
drivers/scsi/be2iscsi/be_iscsi.c +16 -16
@@ -52,7 +52,7 @@ struct iscsi_cls_session *beiscsi_session_create(struct iscsi_endpoint *ep,SE_DEBUG (DBG_LVL_8 ,"In beiscsi_session_create\n" );if (!ep) { -SE_DEBUG (DBG_LVL_1 ,"beiscsi_session_create: invalid ep \n" ); +SE_DEBUG (DBG_LVL_1 ,"beiscsi_session_create: invalid ep\n" );return NULL ; } beiscsi_ep = ep->dd_data;
@@ -157,7 +157,7 @@ static int beiscsi_bindconn_cid(struct beiscsi_hba *phba, "Connection table already occupied. Detected clash\n");return -EINVAL ; }else { -SE_DEBUG (DBG_LVL_8 ,"phba->conn_table[%d]=%p(beiscsi_conn) \n" , +SE_DEBUG (DBG_LVL_8 ,"phba->conn_table[%d]=%p(beiscsi_conn)\n" , cid, beiscsi_conn); phba->conn_table[cid] = beiscsi_conn; }
@@ -196,7 +196,7 @@ int beiscsi_conn_bind(struct iscsi_cls_session *cls_session,if (beiscsi_ep->phba != phba) {SE_DEBUG (DBG_LVL_8 , -"beiscsi_ep->hba=%p not equal to phba=%p \n" , +"beiscsi_ep->hba=%p not equal to phba=%p\n" , beiscsi_ep->phba, phba);return -EEXIST ; }
@@ -204,7 +204,7 @@ int beiscsi_conn_bind(struct iscsi_cls_session *cls_session, beiscsi_conn->beiscsi_conn_cid = beiscsi_ep->ep_cid; beiscsi_conn->ep = beiscsi_ep; beiscsi_ep->conn = beiscsi_conn; -SE_DEBUG (DBG_LVL_8 ,"beiscsi_conn=%p conn=%p ep_cid=%d \n" , +SE_DEBUG (DBG_LVL_8 ,"beiscsi_conn=%p conn=%p ep_cid=%d\n" , beiscsi_conn, conn, beiscsi_ep->ep_cid);return beiscsi_bindconn_cid (phba, beiscsi_conn, beiscsi_ep->ep_cid); }
@@ -308,7 +308,7 @@ int beiscsi_get_host_param(struct Scsi_Host *shost,case ISCSI_HOST_PARAM_HWADDRESS : tag =be_cmd_get_mac_addr (phba);if (!tag) { -SE_DEBUG (DBG_LVL_1 ,"be_cmd_get_mac_addr Failed \n" ); +SE_DEBUG (DBG_LVL_1 ,"be_cmd_get_mac_addr Failed\n" );return -1 ; }else wait_event_interruptible(phba->ctrl.mcc_wait[tag],
@@ -319,7 +319,7 @@ int beiscsi_get_host_param(struct Scsi_Host *shost, status = phba->ctrl.mcc_numtag[tag] &0x000000FF ;if (status || extd_status) {SE_DEBUG (DBG_LVL_1 ,"be_cmd_get_mac_addr Failed" -" status = %d extd_status = %d \n" , +" status = %d extd_status = %d\n" , status, extd_status);free_mcc_tag (&phba->ctrl, tag);return -1 ;
@@ -493,7 +493,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,SE_DEBUG (DBG_LVL_1 ,"No free cid available\n" );return ret; } -SE_DEBUG (DBG_LVL_8 ,"In beiscsi_open_conn, ep_cid=%d " , +SE_DEBUG (DBG_LVL_8 ,"In beiscsi_open_conn, ep_cid=%d\n" , beiscsi_ep->ep_cid); phba->ep_array[beiscsi_ep->ep_cid - phba->fw_config.iscsi_cid_start] = ep;
@@ -507,7 +507,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep, tag =mgmt_open_connection (phba, dst_addr, beiscsi_ep);if (!tag) {SE_DEBUG (DBG_LVL_1 , -"mgmt_open_connection Failed for cid=%d \n" , +"mgmt_open_connection Failed for cid=%d\n" , beiscsi_ep->ep_cid); }else { wait_event_interruptible(phba->ctrl.mcc_wait[tag],
@@ -526,7 +526,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep, wrb =queue_get_wrb (mccq, wrb_num);free_mcc_tag (&phba->ctrl, tag); - ptcpcnct_out =embedded_payload (wrb); + ptcpcnct_out =embedded_payload (wrb); beiscsi_ep = ep->dd_data; beiscsi_ep->fw_handle = ptcpcnct_out->connection_handle; beiscsi_ep->cid_vld =1 ;
@@ -556,18 +556,18 @@ beiscsi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,struct iscsi_endpoint *ep;int ret; -SE_DEBUG (DBG_LVL_8 ,"In beiscsi_ep_connect \n" ); +SE_DEBUG (DBG_LVL_8 ,"In beiscsi_ep_connect\n" );if (shost) phba =iscsi_host_priv (shost);else { ret = -ENXIO ; -SE_DEBUG (DBG_LVL_1 ,"shost is NULL \n" ); +SE_DEBUG (DBG_LVL_1 ,"shost is NULL\n" );return ERR_PTR (ret); }if (phba->state !=BE_ADAPTER_UP ) { ret = -EBUSY ; -SE_DEBUG (DBG_LVL_1 ,"The Adapter state is Not UP \n" ); +SE_DEBUG (DBG_LVL_1 ,"The Adapter state is Not UP\n" );return ERR_PTR (ret); }
@@ -581,7 +581,7 @@ beiscsi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr, beiscsi_ep->phba = phba; beiscsi_ep->openiscsi_ep = ep;if (beiscsi_open_conn (ep,NULL , dst_addr, non_blocking)) { -SE_DEBUG (DBG_LVL_1 ,"Failed in beiscsi_open_conn \n" ); +SE_DEBUG (DBG_LVL_1 ,"Failed in beiscsi_open_conn\n" ); ret = -ENOMEM ; goto free_ep; }
@@ -624,7 +624,7 @@ static int beiscsi_close_conn(struct beiscsi_endpoint *beiscsi_ep, int flag) tag =mgmt_upload_connection (phba, beiscsi_ep->ep_cid, flag);if (!tag) { -SE_DEBUG (DBG_LVL_8 ,"upload failed for cid 0x%x" , +SE_DEBUG (DBG_LVL_8 ,"upload failed for cid 0x%x\n" , beiscsi_ep->ep_cid); ret =-1 ; }else {
@@ -646,7 +646,7 @@ static int beiscsi_unbind_conn_to_cid(struct beiscsi_hba *phba,if (phba->conn_table[cid]) phba->conn_table[cid] =NULL ;else { -SE_DEBUG (DBG_LVL_8 ,"Connection table Not occupied. \n" ); +SE_DEBUG (DBG_LVL_8 ,"Connection table Not occupied.\n" );return -EINVAL ; }return 0 ;
@@ -687,7 +687,7 @@ void beiscsi_ep_disconnect(struct iscsi_endpoint *ep) savecfg_flag);if (!tag) {SE_DEBUG (DBG_LVL_1 , -"mgmt_invalidate_connection Failed for cid=%d \n" , +"mgmt_invalidate_connection Failed for cid=%d\n" , beiscsi_ep->ep_cid); }else { wait_event_interruptible(phba->ctrl.mcc_wait[tag],
drivers/scsi/be2iscsi/be_main.c +74 -71
507 lines not on this page · raw message
drivers/scsi/be2iscsi/be_main.h +10 -10
@@ -39,7 +39,7 @@ "Linux iSCSI Driver version" BUILD_STR#define DRV_DESC BE_NAME " " "Driver" -#define BE_VENDOR_ID 0x19A2 +#define BE_VENDOR_ID 0x19A2/* DEVICE ID's for BE2 */ #define BE_DEVICE_ID1 0x212#define OC_DEVICE_ID1 0x702
@@ -68,8 +68,8 @@#define BEISCSI_NUM_MAX_LUN 256/* scsi_host->max_lun */ #define BEISCSI_NUM_DEVICES_SUPPORTED 0x01#define BEISCSI_MAX_FRAGS_INIT 192 -#define BE_NUM_MSIX_ENTRIES 1 -#define MPU_EP_SEMAPHORE 0xac +#define BE_NUM_MSIX_ENTRIES 1 +#define MPU_EP_SEMAPHORE 0xac#define BE_SENSE_INFO_SIZE 258#define BE_ISCSI_PDU_HEADER_SIZE 64
@@ -105,7 +105,7 @@ do { \#define HWI_GET_ASYNC_PDU_CTX (phwi) (phwi->phwi_ctxt->pasync_ctx)/********* Memory BAR register ************/ -#define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 0xfc +#define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 0xfc/** * Host Interrupt Enable, if set interrupts are enabled although "PCI Interrupt * Disable" may still globally block interrupts in addition to individual
@@ -116,7 +116,7 @@ do { \#define MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK (1 << 29)/* bit 29 */ /********* ISR0 Register offset **********/ -#define CEV_ISR0_OFFSET 0xC18 +#define CEV_ISR0_OFFSET 0xC18#define CEV_ISR_SIZE 4/**
@@ -139,12 +139,12 @@ do { \#define DB_EQ_REARM_SHIFT (29)/* bit 29 */ /********* Compl Q door bell *************/ -#define DB_CQ_OFFSET 0x120 +#define DB_CQ_OFFSET 0x120#define DB_CQ_RING_ID_MASK 0x3FF/* bits 0 - 9 */ /* Number of event entries processed */ -#define DB_CQ_NUM_POPPED_SHIFT (16)/* bits 16 - 28 */ +#define DB_CQ_NUM_POPPED_SHIFT (16)/* bits 16 - 28 */ /* Rearm bit */ -#define DB_CQ_REARM_SHIFT (29)/* bit 29 */ +#define DB_CQ_REARM_SHIFT (29)/* bit 29 */ #define GET_HWI_CONTROLLER_WS (pc) (pc->phwi_ctrlr)#define HWI_GET_DEF_BUFQ_ID (pc) (((struct hwi_controller *)\
@@ -161,12 +161,12 @@ enum be_mem_enum {HWI_MEM_WRBH ,HWI_MEM_SGLH ,HWI_MEM_SGE , -HWI_MEM_ASYNC_HEADER_BUF ,/* 5 */ +HWI_MEM_ASYNC_HEADER_BUF ,/* 5 */ HWI_MEM_ASYNC_DATA_BUF ,HWI_MEM_ASYNC_HEADER_RING ,HWI_MEM_ASYNC_DATA_RING ,HWI_MEM_ASYNC_HEADER_HANDLE , -HWI_MEM_ASYNC_DATA_HANDLE ,/* 10 */ +HWI_MEM_ASYNC_DATA_HANDLE ,/* 10 */ HWI_MEM_ASYNC_PDU_CONTEXT ,ISCSI_MEM_GLOBAL_HEADER ,SE_MEM_MAX
drivers/scsi/be2iscsi/be_mgmt.c +3 -3
@@ -58,7 +58,7 @@ unsigned char mgmt_get_fw_config(struct be_ctrl_info *ctrl, } }else {shost_printk (KERN_WARNING , phba->shost, -"Failed in mgmt_get_fw_config \n" ); +"Failed in mgmt_get_fw_config\n" ); }spin_unlock (&ctrl->mbox_lock);
@@ -167,7 +167,7 @@ unsigned char mgmt_invalidate_icds(struct beiscsi_hba *phba, &nonemb_cmd.dma);if (nonemb_cmd.va ==NULL ) {SE_DEBUG (DBG_LVL_1 , -"Failed to allocate memory for mgmt_invalidate_icds\n" ); +"Failed to alloc memory for mgmt_invalidate_icds\n" );spin_unlock (&ctrl->mbox_lock);return 0 ; }
@@ -339,7 +339,7 @@ int mgmt_open_connection(struct beiscsi_hba *phba,if (phba->nxt_cqid == phba->num_cpus) phba->nxt_cqid =0 ; req->cq_id = phwi_context->be_cq[i].id; -SE_DEBUG (DBG_LVL_8 ,"i=%d cq_id=%d \n" , i, req->cq_id); +SE_DEBUG (DBG_LVL_8 ,"i=%d cq_id=%d\n" , i, req->cq_id); req->defq_id = def_hdr_id; req->hdr_ring_id = def_hdr_id; req->data_ring_id = def_data_id;
Signature · 1 line
1.6.5.2