Skip to content

Commit

Permalink
[SCSI] bfa: fixed checkpatch errors for bfad files
Browse files Browse the repository at this point in the history
This patch fixes checkpatch errors/warnings in bfad files.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Jing Huang authored and James Bottomley committed Dec 4, 2009
1 parent 8798a69 commit f8ceafd
Show file tree
Hide file tree
Showing 53 changed files with 324 additions and 539 deletions.
10 changes: 5 additions & 5 deletions drivers/scsi/bfa/bfa_cb_ioim_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ bfad_int_to_lun(u32 luno)
lun.bfa_lun = 0;
lun.scsi_lun[0] = bfa_os_htons(luno);

return (lun.bfa_lun);
return lun.bfa_lun;
}

/**
Expand All @@ -68,7 +68,7 @@ bfa_cb_ioim_get_cdb(struct bfad_ioim_s *dio)
{
struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio;

return ((u8 *) cmnd->cmnd);
return (u8 *) cmnd->cmnd;
}

/**
Expand Down Expand Up @@ -97,7 +97,7 @@ bfa_cb_ioim_get_size(struct bfad_ioim_s *dio)
{
struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio;

return (scsi_bufflen(cmnd));
return scsi_bufflen(cmnd);
}

/**
Expand Down Expand Up @@ -129,7 +129,7 @@ bfa_cb_ioim_get_sgaddr(struct bfad_ioim_s *dio, int sgeid)
sge = (struct scatterlist *)scsi_sglist(cmnd) + sgeid;
addr = (u64) sg_dma_address(sge);

return (*(union bfi_addr_u *) &addr);
return *((union bfi_addr_u *) &addr);
}

static inline u32
Expand Down Expand Up @@ -197,7 +197,7 @@ bfa_cb_ioim_get_cdblen(struct bfad_ioim_s *dio)
{
struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio;

return (cmnd->cmd_len);
return cmnd->cmd_len;
}


Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/bfa/bfa_cee.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ bfa_cee_reset_stats_isr(struct bfa_cee_s *cee, bfa_status_t status)
u32
bfa_cee_meminfo(void)
{
return (bfa_cee_attr_meminfo() + bfa_cee_stats_meminfo());
return bfa_cee_attr_meminfo() + bfa_cee_stats_meminfo();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions drivers/scsi/bfa/bfa_csdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ bfa_q_is_on_q_func(struct list_head *q, struct list_head *qe)
tqe = bfa_q_next(q);
while (tqe != q) {
if (tqe == qe)
return (1);
return 1;
tqe = bfa_q_next(tqe);
if (tqe == NULL)
break;
}
return (0);
return 0;
}


4 changes: 2 additions & 2 deletions drivers/scsi/bfa/bfa_fcpim.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ bfa_fcpim_path_tov_get(struct bfa_s *bfa)
{
struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa);

return (fcpim->path_tov / 1000);
return fcpim->path_tov / 1000;
}

bfa_status_t
Expand Down Expand Up @@ -169,7 +169,7 @@ bfa_fcpim_qdepth_get(struct bfa_s *bfa)
{
struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa);

return (fcpim->q_depth);
return fcpim->q_depth;
}


4 changes: 2 additions & 2 deletions drivers/scsi/bfa/bfa_fcpim_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#define BFA_FCPIM_PATHTOV_MAX (90 * 1000) /* in millisecs */

#define bfa_fcpim_stats(__fcpim, __stats) \
(__fcpim)->stats.__stats ++
((__fcpim)->stats.__stats++)

struct bfa_fcpim_mod_s {
struct bfa_s *bfa;
Expand Down Expand Up @@ -143,7 +143,7 @@ struct bfa_itnim_s {
struct bfa_itnim_hal_stats_s stats;
};

#define bfa_itnim_is_online(_itnim) (_itnim)->is_online
#define bfa_itnim_is_online(_itnim) ((_itnim)->is_online)
#define BFA_FCPIM_MOD(_hal) (&(_hal)->modules.fcpim_mod)
#define BFA_IOIM_FROM_TAG(_fcpim, _iotag) \
(&fcpim->ioim_arr[_iotag])
Expand Down
59 changes: 28 additions & 31 deletions drivers/scsi/bfa/bfa_fcport.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,32 +388,29 @@ bfa_pport_sm_linkup(struct bfa_pport_s *pport, enum bfa_pport_sm_event event)
bfa_pport_callback(pport, BFA_PPORT_LINKDOWN);
bfa_plog_str(pport->bfa->plog, BFA_PL_MID_HAL,
BFA_PL_EID_PORT_ST_CHANGE, 0, "Port Linkdown");
if (BFA_PORT_IS_DISABLED(pport->bfa)) {
if (BFA_PORT_IS_DISABLED(pport->bfa))
bfa_pport_aen_post(pport, BFA_PORT_AEN_OFFLINE);
} else {
else
bfa_pport_aen_post(pport, BFA_PORT_AEN_DISCONNECT);
}
break;

case BFA_PPORT_SM_STOP:
bfa_sm_set_state(pport, bfa_pport_sm_stopped);
bfa_pport_reset_linkinfo(pport);
if (BFA_PORT_IS_DISABLED(pport->bfa)) {
if (BFA_PORT_IS_DISABLED(pport->bfa))
bfa_pport_aen_post(pport, BFA_PORT_AEN_OFFLINE);
} else {
else
bfa_pport_aen_post(pport, BFA_PORT_AEN_DISCONNECT);
}
break;

case BFA_PPORT_SM_HWFAIL:
bfa_sm_set_state(pport, bfa_pport_sm_iocdown);
bfa_pport_reset_linkinfo(pport);
bfa_pport_callback(pport, BFA_PPORT_LINKDOWN);
if (BFA_PORT_IS_DISABLED(pport->bfa)) {
if (BFA_PORT_IS_DISABLED(pport->bfa))
bfa_pport_aen_post(pport, BFA_PORT_AEN_OFFLINE);
} else {
else
bfa_pport_aen_post(pport, BFA_PORT_AEN_DISCONNECT);
}
break;

default:
Expand Down Expand Up @@ -999,10 +996,10 @@ bfa_pport_enable(struct bfa_s *bfa)
struct bfa_pport_s *pport = BFA_PORT_MOD(bfa);

if (pport->diag_busy)
return (BFA_STATUS_DIAG_BUSY);
return BFA_STATUS_DIAG_BUSY;
else if (bfa_sm_cmp_state
(BFA_PORT_MOD(bfa), bfa_pport_sm_disabling_qwait))
return (BFA_STATUS_DEVBUSY);
return BFA_STATUS_DEVBUSY;

bfa_sm_send_event(BFA_PORT_MOD(bfa), BFA_PPORT_SM_ENABLE);
return BFA_STATUS_OK;
Expand Down Expand Up @@ -1032,7 +1029,7 @@ bfa_pport_cfg_speed(struct bfa_s *bfa, enum bfa_pport_speed speed)

pport->cfg.speed = speed;

return (BFA_STATUS_OK);
return BFA_STATUS_OK;
}

/**
Expand Down Expand Up @@ -1068,7 +1065,7 @@ bfa_pport_cfg_topology(struct bfa_s *bfa, enum bfa_pport_topology topology)
}

pport->cfg.topology = topology;
return (BFA_STATUS_OK);
return BFA_STATUS_OK;
}

/**
Expand All @@ -1094,7 +1091,7 @@ bfa_pport_cfg_hardalpa(struct bfa_s *bfa, u8 alpa)
pport->cfg.cfg_hardalpa = BFA_TRUE;
pport->cfg.hardalpa = alpa;

return (BFA_STATUS_OK);
return BFA_STATUS_OK;
}

bfa_status_t
Expand All @@ -1106,7 +1103,7 @@ bfa_pport_clr_hardalpa(struct bfa_s *bfa)
bfa_trc(bfa, pport->cfg.hardalpa);

pport->cfg.cfg_hardalpa = BFA_FALSE;
return (BFA_STATUS_OK);
return BFA_STATUS_OK;
}

bfa_boolean_t
Expand Down Expand Up @@ -1138,16 +1135,16 @@ bfa_pport_cfg_maxfrsize(struct bfa_s *bfa, u16 maxfrsize)
* with in range
*/
if ((maxfrsize > FC_MAX_PDUSZ) || (maxfrsize < FC_MIN_PDUSZ))
return (BFA_STATUS_INVLD_DFSZ);
return BFA_STATUS_INVLD_DFSZ;

/*
* power of 2, if not the max frame size of 2112
*/
if ((maxfrsize != FC_MAX_PDUSZ) && (maxfrsize & (maxfrsize - 1)))
return (BFA_STATUS_INVLD_DFSZ);
return BFA_STATUS_INVLD_DFSZ;

pport->cfg.maxfrsize = maxfrsize;
return (BFA_STATUS_OK);
return BFA_STATUS_OK;
}

u16
Expand Down Expand Up @@ -1415,7 +1412,7 @@ bfa_pport_get_stats(struct bfa_s *bfa, union bfa_pport_stats_u *stats,

if (port->stats_busy) {
bfa_trc(bfa, port->stats_busy);
return (BFA_STATUS_DEVBUSY);
return BFA_STATUS_DEVBUSY;
}

port->stats_busy = BFA_TRUE;
Expand All @@ -1427,7 +1424,7 @@ bfa_pport_get_stats(struct bfa_s *bfa, union bfa_pport_stats_u *stats,

bfa_timer_start(bfa, &port->timer, bfa_port_stats_timeout, port,
BFA_PORT_STATS_TOV);
return (BFA_STATUS_OK);
return BFA_STATUS_OK;
}

bfa_status_t
Expand All @@ -1437,7 +1434,7 @@ bfa_pport_clear_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg)

if (port->stats_busy) {
bfa_trc(bfa, port->stats_busy);
return (BFA_STATUS_DEVBUSY);
return BFA_STATUS_DEVBUSY;
}

port->stats_busy = BFA_TRUE;
Expand All @@ -1448,7 +1445,7 @@ bfa_pport_clear_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg)

bfa_timer_start(bfa, &port->timer, bfa_port_stats_clr_timeout, port,
BFA_PORT_STATS_TOV);
return (BFA_STATUS_OK);
return BFA_STATUS_OK;
}

bfa_status_t
Expand Down Expand Up @@ -1515,7 +1512,7 @@ bfa_pport_get_qos_stats(struct bfa_s *bfa, union bfa_pport_stats_u *stats,
/*
* QoS stats is embedded in port stats
*/
return (bfa_pport_get_stats(bfa, stats, cbfn, cbarg));
return bfa_pport_get_stats(bfa, stats, cbfn, cbarg);
}

bfa_status_t
Expand All @@ -1525,7 +1522,7 @@ bfa_pport_clear_qos_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg)

if (port->stats_busy) {
bfa_trc(bfa, port->stats_busy);
return (BFA_STATUS_DEVBUSY);
return BFA_STATUS_DEVBUSY;
}

port->stats_busy = BFA_TRUE;
Expand All @@ -1536,7 +1533,7 @@ bfa_pport_clear_qos_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg)

bfa_timer_start(bfa, &port->timer, bfa_port_stats_clr_timeout, port,
BFA_PORT_STATS_TOV);
return (BFA_STATUS_OK);
return BFA_STATUS_OK;
}

/**
Expand All @@ -1545,7 +1542,7 @@ bfa_pport_clear_qos_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg)
bfa_status_t
bfa_pport_trunk_disable(struct bfa_s *bfa)
{
return (BFA_STATUS_OK);
return BFA_STATUS_OK;
}

bfa_boolean_t
Expand All @@ -1562,8 +1559,8 @@ bfa_pport_is_disabled(struct bfa_s *bfa)
{
struct bfa_pport_s *port = BFA_PORT_MOD(bfa);

return (bfa_sm_to_state(hal_pport_sm_table, port->sm) ==
BFA_PPORT_ST_DISABLED);
return bfa_sm_to_state(hal_pport_sm_table, port->sm) ==
BFA_PPORT_ST_DISABLED;

}

Expand All @@ -1572,7 +1569,7 @@ bfa_pport_is_ratelim(struct bfa_s *bfa)
{
struct bfa_pport_s *pport = BFA_PORT_MOD(bfa);

return (pport->cfg.ratelimit ? BFA_TRUE : BFA_FALSE);
return pport->cfg.ratelimit ? BFA_TRUE : BFA_FALSE;

}

Expand Down Expand Up @@ -1620,7 +1617,7 @@ bfa_pport_cfg_ratelim_speed(struct bfa_s *bfa, enum bfa_pport_speed speed)

pport->cfg.trl_def_speed = speed;

return (BFA_STATUS_OK);
return BFA_STATUS_OK;
}

/**
Expand All @@ -1632,7 +1629,7 @@ bfa_pport_get_ratelim_speed(struct bfa_s *bfa)
struct bfa_pport_s *pport = BFA_PORT_MOD(bfa);

bfa_trc(bfa, pport->cfg.trl_def_speed);
return (pport->cfg.trl_def_speed);
return pport->cfg.trl_def_speed;

}

Expand Down
11 changes: 5 additions & 6 deletions drivers/scsi/bfa/bfa_fcs_lport.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,10 @@ bfa_fcs_port_offline_actions(struct bfa_fcs_port_s *port)

__port_action[port->fabric->fab_type].offline(port);

if (bfa_fcs_fabric_is_online(port->fabric) == BFA_TRUE) {
if (bfa_fcs_fabric_is_online(port->fabric) == BFA_TRUE)
bfa_fcs_port_aen_post(port, BFA_LPORT_AEN_DISCONNECT);
} else {
else
bfa_fcs_port_aen_post(port, BFA_LPORT_AEN_OFFLINE);
}
bfa_fcb_port_offline(port->fcs->bfad, port->port_cfg.roles,
port->fabric->vf_drv,
(port->vport == NULL) ? NULL : port->vport->vport_drv);
Expand Down Expand Up @@ -777,7 +776,7 @@ bfa_fcs_port_get_rport_by_pwwn(struct bfa_fcs_port_s *port, wwn_t pwwn)
}

bfa_trc(port->fcs, pwwn);
return (NULL);
return NULL;
}

/**
Expand All @@ -796,7 +795,7 @@ bfa_fcs_port_get_rport_by_nwwn(struct bfa_fcs_port_s *port, wwn_t nwwn)
}

bfa_trc(port->fcs, nwwn);
return (NULL);
return NULL;
}

/**
Expand Down Expand Up @@ -870,7 +869,7 @@ bfa_fcs_port_lip(struct bfa_fcs_port_s *port)
bfa_boolean_t
bfa_fcs_port_is_online(struct bfa_fcs_port_s *port)
{
return (bfa_sm_cmp_state(port, bfa_fcs_port_sm_online));
return bfa_sm_cmp_state(port, bfa_fcs_port_sm_online);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions drivers/scsi/bfa/bfa_fcxp.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ bfa_fcxp_get(struct bfa_fcxp_mod_s *fm)
if (fcxp)
list_add_tail(&fcxp->qe, &fm->fcxp_active_q);

return (fcxp);
return fcxp;
}

static void
Expand Down Expand Up @@ -503,7 +503,7 @@ bfa_fcxp_alloc(void *caller, struct bfa_s *bfa, int nreq_sgles,

fcxp = bfa_fcxp_get(BFA_FCXP_MOD(bfa));
if (fcxp == NULL)
return (NULL);
return NULL;

bfa_trc(bfa, fcxp->fcxp_tag);

Expand Down Expand Up @@ -568,7 +568,7 @@ bfa_fcxp_alloc(void *caller, struct bfa_s *bfa, int nreq_sgles,
}
}

return (fcxp);
return fcxp;
}

/**
Expand Down Expand Up @@ -709,7 +709,7 @@ bfa_status_t
bfa_fcxp_abort(struct bfa_fcxp_s *fcxp)
{
bfa_assert(0);
return (BFA_STATUS_OK);
return BFA_STATUS_OK;
}

void
Expand Down
Loading

0 comments on commit f8ceafd

Please sign in to comment.