Staging: rdma: hfi1: rc.c: Fixed coding style issues
Subsystems (2)
PATCH 1/1 Staging: rdma: hfi1: rc.c: Fixed coding style issues
Fixed following checkpatch.pl warnings:
Prefer 'unsigned int' to bare use of 'unsigned'
Prefer READ_ONCE(<FOO>) over ACCESS_ONCE(<FOO>)
--- drivers/staging/rdma/hfi1/rc.c | 12 ++++++------ drivers/staging/rdma/hfi1/ruc.c | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/rdma/hfi1/rc.c +6 -6
@@ -421,7 +421,7 @@ int hfi1_make_rc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps) goto bail;/* We are in the error state, flush the work request. */ smp_read_barrier_depends ();/* see post_one_send() */ -if (qp->s_last ==ACCESS_ONCE (qp->s_head)) +if (qp->s_last ==READ_ONCE (qp->s_head)) goto bail;/* If DMAs are in progress, we can't flush immediately. */ if (iowait_sdma_pending (&priv->s_iowait)) {
@@ -1103,7 +1103,7 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct hfi1_ib_header *hdr)struct hfi1_other_headers *ohdr;struct rvt_swqe *wqe;struct ib_wc wc; -unsigned i; +unsigned int i;u32 opcode;u32 psn;
@@ -1196,7 +1196,7 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp, struct hfi1_ibport *ibp) {struct ib_wc wc; -unsigned i; +unsigned int i;/* * Don't decrement refcount and don't generate a
@@ -1571,7 +1571,7 @@ static void rc_rcv_resp(struct hfi1_ibport *ibp,/* Ignore invalid responses. */ smp_read_barrier_depends ();/* see post_one_send */ -if (cmp_psn (psn,ACCESS_ONCE (qp->s_next_psn)) >=0 ) +if (cmp_psn (psn,READ_ONCE (qp->s_next_psn)) >=0 ) goto ack_done;/* Ignore duplicate responses. */
@@ -1970,9 +1970,9 @@ void hfi1_rc_error(struct rvt_qp *qp, enum ib_wc_status err) } } -static inline void update_ack_queue (struct rvt_qp *qp,unsigned n) +static inline void update_ack_queue (struct rvt_qp *qp,unsigned int n) { -unsigned next; +unsigned int next; next = n +1 ;if (next >HFI1_MAX_RDMA_ATOMIC )
drivers/staging/rdma/hfi1/ruc.c +3 -3
@@ -239,7 +239,7 @@ bail:return ret; } -static __be64 get_sguid (struct hfi1_ibport *ibp,unsigned index) +static __be64 get_sguid (struct hfi1_ibport *ibp,unsigned int index) {if (!index) {struct hfi1_pportdata *ppd =ppd_from_ibp (ibp);
@@ -393,7 +393,7 @@ static void ruc_loopback(struct rvt_qp *sqp) again:smp_read_barrier_depends ();/* see post_one_send() */ -if (sqp->s_last ==ACCESS_ONCE (sqp->s_head)) +if (sqp->s_last ==READ_ONCE (sqp->s_head)) goto clr_busy; wqe =rvt_get_swqe_ptr (sqp, sqp->s_last);
@@ -929,7 +929,7 @@ void hfi1_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe, enum ib_wc_status status) {u32 old_last, last; -unsigned i; +unsigned int i;if (!(ib_rvt_state_ops[qp->state] &RVT_PROCESS_OR_FLUSH_SEND ))return ;
Signature · 1 line
1.9.1
PATCH 1/1 Staging: rdma: hfi1: sdma.c: Fixed coding style issues
Fixed following checkpatch.pl warnings:
Prefer 'unsigned int' to bare use of 'unsigned' Prefer READ_ONCE(<FOO>) over ACCESS_ONCE(<FOO>)
--- drivers/staging/rdma/hfi1/sdma.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/staging/rdma/hfi1/sdma.c +15 -15
@@ -234,7 +234,7 @@ static void sdma_put(struct sdma_state *);static void sdma_set_state (struct sdma_engine *,enum sdma_states );static void sdma_start_hw_clean_up (struct sdma_engine *);static void sdma_sw_clean_up_task (unsigned long ); -static void sdma_sendctrl (struct sdma_engine *,unsigned ); +static void sdma_sendctrl (struct sdma_engine *,unsigned int );static void init_sdma_regs (struct sdma_engine *,u32 ,uint ); static void sdma_process_event( struct sdma_engine *sde,
@@ -244,7 +244,7 @@ static void __sdma_process_event( enum sdma_events event);static void dump_sdma_state (struct sdma_engine *sde);static void sdma_make_progress (struct sdma_engine *sde,u64 status); -static void sdma_desc_avail (struct sdma_engine *sde,unsigned avail); +static void sdma_desc_avail (struct sdma_engine *sde,unsigned int avail);static void sdma_flush_descq (struct sdma_engine *sde);/**
@@ -346,7 +346,7 @@ void sdma_wait(struct hfi1_devdata *dd) } } -static inline void sdma_set_desc_cnt (struct sdma_engine *sde,unsigned cnt) +static inline void sdma_set_desc_cnt (struct sdma_engine *sde,unsigned int cnt) {u64 reg;
@@ -472,7 +472,7 @@ static void sdma_err_halt_wait(struct work_struct *work)static void sdma_err_progress_check_schedule (struct sdma_engine *sde) {if (!is_bx (sde->dd) &&HFI1_CAP_IS_KSET (SDMA_AHG )) { -unsigned index; +unsigned int index;struct hfi1_devdata *dd = sde->dd;for (index =0 ; index < dd->num_sdma; index++) {
@@ -491,7 +491,7 @@ static void sdma_err_progress_check_schedule(struct sdma_engine *sde)static void sdma_err_progress_check (unsigned long data) { -unsigned index; +unsigned int index;struct sdma_engine *sde = (struct sdma_engine *)data;dd_dev_err (sde->dd,"SDE progress check event\n" );
@@ -657,7 +657,7 @@ static void sdma_set_state(struct sdma_engine *sde, {struct sdma_state *ss = &sde->state;const struct sdma_set_state_action *action = sdma_action_table; -unsigned op =0 ; +unsigned int op =0 ; trace_hfi1_sdma_state( sde,
@@ -989,7 +989,7 @@ static void sdma_clean(struct hfi1_devdata *dd, size_t num_engines)*/ int sdma_init (struct hfi1_devdata *dd,u8 port) { -unsigned this_idx; +unsigned int this_idx;struct sdma_engine *sde;u16 descq_cnt;void *curr_head;
@@ -1213,7 +1213,7 @@ void sdma_all_idle(struct hfi1_devdata *dd)*/ void sdma_start (struct hfi1_devdata *dd) { -unsigned i; +unsigned int i;struct sdma_engine *sde;/* kick off the engines state processing */
@@ -1229,7 +1229,7 @@ void sdma_start(struct hfi1_devdata *dd)*/ void sdma_exit (struct hfi1_devdata *dd) { -unsigned this_idx; +unsigned int this_idx;struct sdma_engine *sde; for (this_idx = 0; dd->per_sdma && this_idx < dd->num_sdma;
@@ -1351,7 +1351,7 @@ retry: swhead = sde->descq_head & sde->sdma_mask;/* this code is really bad for cache line trading */ - swtail =ACCESS_ONCE (sde->descq_tail) & sde->sdma_mask; + swtail =READ_ONCE (sde->descq_tail) & sde->sdma_mask; cnt = sde->descq_cnt;if (swhead < swtail)
@@ -1557,7 +1557,7 @@ void sdma_engine_error(struct sdma_engine *sde, u64 status)spin_unlock_irqrestore (&sde->tail_lock, flags); } -static void sdma_sendctrl (struct sdma_engine *sde,unsigned op) +static void sdma_sendctrl (struct sdma_engine *sde,unsigned int op) {u64 set_senddmactrl =0 ;u64 clr_senddmactrl =0 ;
@@ -1736,7 +1736,7 @@ static void init_sdma_regs(void sdma_dumpstate (struct sdma_engine *sde) {u64 csr; -unsigned i; +unsigned int i;sdma_dumpstate_helper (SD (CTRL ));sdma_dumpstate_helper (SD (STATUS ));
@@ -1854,7 +1854,7 @@ void sdma_seqfile_dump_sde(struct seq_file *s, struct sdma_engine *sde)u16 len; head = sde->descq_head & sde->sdma_mask; - tail =ACCESS_ONCE (sde->descq_tail) & sde->sdma_mask; + tail =READ_ONCE (sde->descq_tail) & sde->sdma_mask; seq_printf(s, SDE_FMT, sde->this_idx, sde->cpu, sdma_state_name(sde->state.current_state),
@@ -1999,7 +1999,7 @@ static int sdma_check_progress(return -EAGAIN ;/* pulse the head_lock */ if (wait && wait->sleep) { -unsigned seq; +unsigned int seq; seq =raw_seqcount_begin ( (const seqcount_t *)&sde->head_lock.seqcount);
@@ -2926,7 +2926,7 @@ int sdma_ahg_alloc(struct sdma_engine *sde)return -EINVAL ; }while (1 ) { - nr =ffz (ACCESS_ONCE (sde->ahg_bits)); + nr =ffz (READ_ONCE (sde->ahg_bits));if (nr >31 ) {trace_hfi1_ahg_allocate (sde, -ENOSPC );return -ENOSPC ;
Signature · 1 line
1.9.1
Re: [PATCH 1/1] Staging: rdma: hfi1: sdma.c: Fixed coding style issues
Quoted 3 lines · Shyam Saini
Fixed following checkpatch.pl warnings:
Prefer 'unsigned int' to bare use of 'unsigned' PreferREAD_ONCE(<FOO>)overACCESS_ONCE(<FOO>)
Same response [1] as to your previous patch. If you do spin the READ_ONCE bit please squash the two.
[1] http://marc.info/?l=linux-rdma&m=146400717024632&w=2
-Denny
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 3 lines · Shyam Saini
Fixed following checkpatch.pl warnings:
Prefer 'unsigned int' to bare use of 'unsigned'
PreferREAD_ONCE(<FOO>)overACCESS_ONCE(<FOO>)
In general please don't fix two types of issues in the same patch. Also, as to the unsinged -> unsigned int, the linux-rdma maintainer has already said we don't really want all of the code churn for this [1].
I suggest to respin this patch with just the ACCESS_ONCE->READ_ONCE change so that can be reviewed on it's own.
[1] http://marc.info/?l=linux-rdma&m=146308474205407&w=2
-Denny