* [PATCH] srcu: remove never used variable
@ 2018-02-22 6:52 zhouzhouyi
2018-02-22 16:58 ` Paul E. McKenney
0 siblings, 1 reply; 4+ messages in thread
From: zhouzhouyi @ 2018-02-22 6:52 UTC (permalink / raw)
To: paulmck, josh, rostedt, mathieu.desnoyers, jiangshanlai,
linux-kernel
Cc: Zhouyi Zhou
From: Zhouyi Zhou <zhouzhouyi@gmail.com>
In function srcu_gp_end, the variable idxnext is never used after assign,
remove it and its assign statement.
Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
---
kernel/rcu/srcutree.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
index d5cea81..1241715 100644
--- a/kernel/rcu/srcutree.c
+++ b/kernel/rcu/srcutree.c
@@ -531,7 +531,6 @@ static void srcu_gp_end(struct srcu_struct *sp)
unsigned long flags;
unsigned long gpseq;
int idx;
- int idxnext;
unsigned long mask;
struct srcu_data *sdp;
struct srcu_node *snp;
@@ -555,7 +554,6 @@ static void srcu_gp_end(struct srcu_struct *sp)
/* Initiate callback invocation as needed. */
idx = rcu_seq_ctr(gpseq) % ARRAY_SIZE(snp->srcu_have_cbs);
- idxnext = (idx + 1) % ARRAY_SIZE(snp->srcu_have_cbs);
rcu_for_each_node_breadth_first(sp, snp) {
spin_lock_irq_rcu_node(snp);
cbs = false;
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] srcu: remove never used variable
2018-02-22 6:52 [PATCH] srcu: remove never used variable zhouzhouyi
@ 2018-02-22 16:58 ` Paul E. McKenney
[not found] ` <CAABZP2wt0QLuOFndOFTgRACxZw0jqNNeumE91KpjiFQieg14dA@mail.gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Paul E. McKenney @ 2018-02-22 16:58 UTC (permalink / raw)
To: zhouzhouyi; +Cc: josh, rostedt, mathieu.desnoyers, jiangshanlai, linux-kernel
On Thu, Feb 22, 2018 at 06:52:37AM +0000, zhouzhouyi@gmail.com wrote:
> From: Zhouyi Zhou <zhouzhouyi@gmail.com>
>
> In function srcu_gp_end, the variable idxnext is never used after assign,
> remove it and its assign statement.
>
> Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
Good catch, but Byungchul Park beat you to it. Please see commit
a72da917f186 ("srcu: Remove dead code in srcu_gp_end()") in -rcu.
Thanx, Paul
> ---
> kernel/rcu/srcutree.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
> index d5cea81..1241715 100644
> --- a/kernel/rcu/srcutree.c
> +++ b/kernel/rcu/srcutree.c
> @@ -531,7 +531,6 @@ static void srcu_gp_end(struct srcu_struct *sp)
> unsigned long flags;
> unsigned long gpseq;
> int idx;
> - int idxnext;
> unsigned long mask;
> struct srcu_data *sdp;
> struct srcu_node *snp;
> @@ -555,7 +554,6 @@ static void srcu_gp_end(struct srcu_struct *sp)
>
> /* Initiate callback invocation as needed. */
> idx = rcu_seq_ctr(gpseq) % ARRAY_SIZE(snp->srcu_have_cbs);
> - idxnext = (idx + 1) % ARRAY_SIZE(snp->srcu_have_cbs);
> rcu_for_each_node_breadth_first(sp, snp) {
> spin_lock_irq_rcu_node(snp);
> cbs = false;
> --
> 2.1.4
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] srcu: remove never used variable
[not found] ` <CAABZP2wt0QLuOFndOFTgRACxZw0jqNNeumE91KpjiFQieg14dA@mail.gmail.com>
@ 2018-02-23 1:20 ` Paul E. McKenney
2018-02-23 1:58 ` Zhouyi Zhou
0 siblings, 1 reply; 4+ messages in thread
From: Paul E. McKenney @ 2018-02-23 1:20 UTC (permalink / raw)
To: Zhouyi Zhou
Cc: josh@joshtriplett.org, rostedt@goodmis.org,
mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com,
linux-kernel@vger.kernel.org
On Fri, Feb 23, 2018 at 09:04:05AM +0800, Zhouyi Zhou wrote:
> Thanks Paul for reviewing
And thank you for your interest in SRCU! I am pretty sure that other
bugs still remain. ;-)
Thanx, Paul
> Cheers
> Zhouyi
>
> On Friday, February 23, 2018, Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> wrote:
>
> > On Thu, Feb 22, 2018 at 06:52:37AM +0000, zhouzhouyi@gmail.com wrote:
> > > From: Zhouyi Zhou <zhouzhouyi@gmail.com>
> > >
> > > In function srcu_gp_end, the variable idxnext is never used after assign,
> > > remove it and its assign statement.
> > >
> > > Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
> >
> > Good catch, but Byungchul Park beat you to it. Please see commit
> > a72da917f186 ("srcu: Remove dead code in srcu_gp_end()") in -rcu.
> >
> > Thanx, Paul
> >
> > > ---
> > > kernel/rcu/srcutree.c | 2 --
> > > 1 file changed, 2 deletions(-)
> > >
> > > diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
> > > index d5cea81..1241715 100644
> > > --- a/kernel/rcu/srcutree.c
> > > +++ b/kernel/rcu/srcutree.c
> > > @@ -531,7 +531,6 @@ static void srcu_gp_end(struct srcu_struct *sp)
> > > unsigned long flags;
> > > unsigned long gpseq;
> > > int idx;
> > > - int idxnext;
> > > unsigned long mask;
> > > struct srcu_data *sdp;
> > > struct srcu_node *snp;
> > > @@ -555,7 +554,6 @@ static void srcu_gp_end(struct srcu_struct *sp)
> > >
> > > /* Initiate callback invocation as needed. */
> > > idx = rcu_seq_ctr(gpseq) % ARRAY_SIZE(snp->srcu_have_cbs);
> > > - idxnext = (idx + 1) % ARRAY_SIZE(snp->srcu_have_cbs);
> > > rcu_for_each_node_breadth_first(sp, snp) {
> > > spin_lock_irq_rcu_node(snp);
> > > cbs = false;
> > > --
> > > 2.1.4
> > >
> >
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] srcu: remove never used variable
2018-02-23 1:20 ` Paul E. McKenney
@ 2018-02-23 1:58 ` Zhouyi Zhou
0 siblings, 0 replies; 4+ messages in thread
From: Zhouyi Zhou @ 2018-02-23 1:58 UTC (permalink / raw)
To: Paul McKenney
Cc: josh@joshtriplett.org, rostedt@goodmis.org,
mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com,
linux-kernel@vger.kernel.org
Thanks Paul's encouragement, I will keep studying SRCU code.
On Fri, Feb 23, 2018 at 9:20 AM, Paul E. McKenney
<paulmck@linux.vnet.ibm.com> wrote:
> On Fri, Feb 23, 2018 at 09:04:05AM +0800, Zhouyi Zhou wrote:
>> Thanks Paul for reviewing
>
> And thank you for your interest in SRCU! I am pretty sure that other
> bugs still remain. ;-)
>
> Thanx, Paul
>
>> Cheers
>> Zhouyi
>>
>> On Friday, February 23, 2018, Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>> wrote:
>>
>> > On Thu, Feb 22, 2018 at 06:52:37AM +0000, zhouzhouyi@gmail.com wrote:
>> > > From: Zhouyi Zhou <zhouzhouyi@gmail.com>
>> > >
>> > > In function srcu_gp_end, the variable idxnext is never used after assign,
>> > > remove it and its assign statement.
>> > >
>> > > Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
>> >
>> > Good catch, but Byungchul Park beat you to it. Please see commit
>> > a72da917f186 ("srcu: Remove dead code in srcu_gp_end()") in -rcu.
>> >
>> > Thanx, Paul
>> >
>> > > ---
>> > > kernel/rcu/srcutree.c | 2 --
>> > > 1 file changed, 2 deletions(-)
>> > >
>> > > diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
>> > > index d5cea81..1241715 100644
>> > > --- a/kernel/rcu/srcutree.c
>> > > +++ b/kernel/rcu/srcutree.c
>> > > @@ -531,7 +531,6 @@ static void srcu_gp_end(struct srcu_struct *sp)
>> > > unsigned long flags;
>> > > unsigned long gpseq;
>> > > int idx;
>> > > - int idxnext;
>> > > unsigned long mask;
>> > > struct srcu_data *sdp;
>> > > struct srcu_node *snp;
>> > > @@ -555,7 +554,6 @@ static void srcu_gp_end(struct srcu_struct *sp)
>> > >
>> > > /* Initiate callback invocation as needed. */
>> > > idx = rcu_seq_ctr(gpseq) % ARRAY_SIZE(snp->srcu_have_cbs);
>> > > - idxnext = (idx + 1) % ARRAY_SIZE(snp->srcu_have_cbs);
>> > > rcu_for_each_node_breadth_first(sp, snp) {
>> > > spin_lock_irq_rcu_node(snp);
>> > > cbs = false;
>> > > --
>> > > 2.1.4
>> > >
>> >
>> >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-02-23 1:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-22 6:52 [PATCH] srcu: remove never used variable zhouzhouyi
2018-02-22 16:58 ` Paul E. McKenney
[not found] ` <CAABZP2wt0QLuOFndOFTgRACxZw0jqNNeumE91KpjiFQieg14dA@mail.gmail.com>
2018-02-23 1:20 ` Paul E. McKenney
2018-02-23 1:58 ` Zhouyi Zhou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox