* [PATCH 1/1] Staging: rdma: hfi1: rc.c: Fixed coding style issues @ 2016-05-23 6:36 Shyam Saini 2016-05-23 6:36 ` [PATCH 1/1] Staging: rdma: hfi1: sdma.c: " Shyam Saini 2016-05-23 12:39 ` [PATCH 1/1] Staging: rdma: hfi1: rc.c: " Dennis Dalessandro 0 siblings, 2 replies; 4+ messages in thread From: Shyam Saini @ 2016-05-23 6:36 UTC (permalink / raw) To: gregkh Cc: infinipath, dledford, sean.hefty, linux-rdma, devel, linux-kernel, Shyam Saini Fixed following checkpatch.pl warnings: Prefer 'unsigned int' to bare use of 'unsigned' Prefer READ_ONCE(<FOO>) over ACCESS_ONCE(<FOO>) Signed-off-by: Shyam Saini <mayhs11saini@gmail.com> --- drivers/staging/rdma/hfi1/rc.c | 12 ++++++------ drivers/staging/rdma/hfi1/ruc.c | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rdma/hfi1/rc.c b/drivers/staging/rdma/hfi1/rc.c index 792f15e..fb3a6c1 100644 --- a/drivers/staging/rdma/hfi1/rc.c +++ b/drivers/staging/rdma/hfi1/rc.c @@ -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) diff --git a/drivers/staging/rdma/hfi1/ruc.c b/drivers/staging/rdma/hfi1/ruc.c index a659aec..cb64c80 100644 --- a/drivers/staging/rdma/hfi1/ruc.c +++ b/drivers/staging/rdma/hfi1/ruc.c @@ -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; -- 1.9.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 1/1] Staging: rdma: hfi1: sdma.c: Fixed coding style issues 2016-05-23 6:36 [PATCH 1/1] Staging: rdma: hfi1: rc.c: Fixed coding style issues Shyam Saini @ 2016-05-23 6:36 ` Shyam Saini 2016-05-23 12:43 ` Dennis Dalessandro 2016-05-23 12:39 ` [PATCH 1/1] Staging: rdma: hfi1: rc.c: " Dennis Dalessandro 1 sibling, 1 reply; 4+ messages in thread From: Shyam Saini @ 2016-05-23 6:36 UTC (permalink / raw) To: gregkh Cc: infinipath, dledford, sean.hefty, linux-rdma, devel, linux-kernel, Shyam Saini Fixed following checkpatch.pl warnings: Prefer 'unsigned int' to bare use of 'unsigned' Prefer READ_ONCE(<FOO>) over ACCESS_ONCE(<FOO>) Signed-off-by: Shyam Saini <mayhs11saini@gmail.com> --- drivers/staging/rdma/hfi1/sdma.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/rdma/hfi1/sdma.c b/drivers/staging/rdma/hfi1/sdma.c index abb8ebc..c2e2856 100644 --- a/drivers/staging/rdma/hfi1/sdma.c +++ b/drivers/staging/rdma/hfi1/sdma.c @@ -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; -- 1.9.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] Staging: rdma: hfi1: sdma.c: Fixed coding style issues 2016-05-23 6:36 ` [PATCH 1/1] Staging: rdma: hfi1: sdma.c: " Shyam Saini @ 2016-05-23 12:43 ` Dennis Dalessandro 0 siblings, 0 replies; 4+ messages in thread From: Dennis Dalessandro @ 2016-05-23 12:43 UTC (permalink / raw) To: Shyam Saini Cc: gregkh, infinipath, dledford, sean.hefty, linux-rdma, devel, linux-kernel On Mon, May 23, 2016 at 12:06:02PM +0530, Shyam Saini wrote: >Fixed following checkpatch.pl warnings: > Prefer 'unsigned int' to bare use of 'unsigned' > Prefer READ_ONCE(<FOO>) over ACCESS_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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] Staging: rdma: hfi1: rc.c: Fixed coding style issues 2016-05-23 6:36 [PATCH 1/1] Staging: rdma: hfi1: rc.c: Fixed coding style issues Shyam Saini 2016-05-23 6:36 ` [PATCH 1/1] Staging: rdma: hfi1: sdma.c: " Shyam Saini @ 2016-05-23 12:39 ` Dennis Dalessandro 1 sibling, 0 replies; 4+ messages in thread From: Dennis Dalessandro @ 2016-05-23 12:39 UTC (permalink / raw) To: Shyam Saini Cc: gregkh, infinipath, dledford, sean.hefty, linux-rdma, devel, linux-kernel On Mon, May 23, 2016 at 12:06:01PM +0530, Shyam Saini wrote: >Fixed following checkpatch.pl warnings: > Prefer 'unsigned int' to bare use of 'unsigned' > Prefer READ_ONCE(<FOO>) over ACCESS_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 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-05-23 12:43 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-05-23 6:36 [PATCH 1/1] Staging: rdma: hfi1: rc.c: Fixed coding style issues Shyam Saini 2016-05-23 6:36 ` [PATCH 1/1] Staging: rdma: hfi1: sdma.c: " Shyam Saini 2016-05-23 12:43 ` Dennis Dalessandro 2016-05-23 12:39 ` [PATCH 1/1] Staging: rdma: hfi1: rc.c: " Dennis Dalessandro
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox