Skip to content

Commit

Permalink
[SCSI] be2iscsi: Fix warnings from new checkpatch.pl
Browse files Browse the repository at this point in the history
The latest checkpatch.pl throws some new warnings. Fixing it
to get rid of a bunch of warnings

Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Jayamohan Kallickal authored and James Bottomley committed Jul 28, 2010
1 parent bbe56c7 commit 457ff3b
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 123 deletions.
6 changes: 3 additions & 3 deletions drivers/scsi/be2iscsi/be.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,16 @@ 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 */
#define OFFSET_IN_PAGE(addr) \
((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. */
Expand Down
24 changes: 12 additions & 12 deletions drivers/scsi/be2iscsi/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
Expand All @@ -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));

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
20 changes: 10 additions & 10 deletions drivers/scsi/be2iscsi/be_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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 67

struct be_cmd_req_hdr {
u8 opcode; /* dword 0 */
Expand Down Expand Up @@ -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
Expand Down
32 changes: 16 additions & 16 deletions drivers/scsi/be2iscsi/be_iscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -196,15 +196,15 @@ 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;
}

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);
}
Expand Down Expand Up @@ -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],
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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],
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}

Expand All @@ -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;
}
Expand Down Expand Up @@ -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 {
Expand All @@ -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;
Expand Down Expand Up @@ -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],
Expand Down
Loading

0 comments on commit 457ff3b

Please sign in to comment.