From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968916AbdDSSP4 (ORCPT ); Wed, 19 Apr 2017 14:15:56 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:35073 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968872AbdDSSPx (ORCPT ); Wed, 19 Apr 2017 14:15:53 -0400 Date: Wed, 19 Apr 2017 11:15:48 -0700 From: "Paul E. McKenney" To: Arnd Bergmann Cc: Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Wei Yongjun , Ingo Molnar , Boqun Feng , SeongJae Park , linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcuperf: fix duplicate struct initializer Reply-To: paulmck@linux.vnet.ibm.com References: <20170419171459.3250665-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170419171459.3250665-1-arnd@arndb.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17041918-0008-0000-0000-000001FBD943 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006940; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000208; SDB=6.00849708; UDB=6.00419599; IPR=6.00628342; BA=6.00005304; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015095; XFM=3.00000013; UTC=2017-04-19 18:15:51 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17041918-0009-0000-0000-000034C55D51 Message-Id: <20170419181548.GV3956@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-19_15:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1704190151 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 19, 2017 at 07:14:34PM +0200, Arnd Bergmann wrote: > Building with "make W=1" shows a set of new warnings in the rcuperf code: > > kernel/rcu/rcuperf.c:282:11: error: initialized field overwritten [-Werror=override-init] > .async = srcu_call_rcu, > kernel/rcu/rcuperf.c:282:11: note: (near initialization for 'sched_ops.async') > kernel/rcu/rcuperf.c:283:16: error: initialized field overwritten [-Werror=override-init] > .gp_barrier = srcu_rcu_barrier, > kernel/rcu/rcuperf.c:283:16: note: (near initialization for 'sched_ops.gp_barrier') > kernel/rcu/rcuperf.c:313:11: error: initialized field overwritten [-Werror=override-init] > .async = call_rcu_tasks, > kernel/rcu/rcuperf.c:313:11: note: (near initialization for 'tasks_ops.async') > kernel/rcu/rcuperf.c:314:16: error: initialized field overwritten [-Werror=override-init] > .gp_barrier = rcu_barrier_tasks, > kernel/rcu/rcuperf.c:314:16: note: (near initialization for 'tasks_ops.gp_barrier') > > This appears to be a copy-paste bug, so we can remove the extranous copy. > > Fixes: f743d20f2cc6 ("rcuperf: Add ability to performance-test call_rcu() and friends") > Signed-off-by: Arnd Bergmann For those times when you want to be -really- sure that the field is in fact initialized! ;-) Good catch!!! I merged this into the original commit with attribution: [ paulmck: Removed the redundant initialization noted by Arnd Bergmann. ] Thanx, Paul > --- > kernel/rcu/rcuperf.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/kernel/rcu/rcuperf.c b/kernel/rcu/rcuperf.c > index 329010a41f30..e1ce97bead94 100644 > --- a/kernel/rcu/rcuperf.c > +++ b/kernel/rcu/rcuperf.c > @@ -279,8 +279,6 @@ static struct rcu_perf_ops sched_ops = { > .exp_completed = rcu_exp_batches_completed_sched, > .async = call_rcu_sched, > .gp_barrier = rcu_barrier_sched, > - .async = srcu_call_rcu, > - .gp_barrier = srcu_rcu_barrier, > .sync = synchronize_sched, > .exp_sync = synchronize_sched_expedited, > .name = "sched" > @@ -310,8 +308,6 @@ static struct rcu_perf_ops tasks_ops = { > .completed = rcu_no_completed, > .async = call_rcu_tasks, > .gp_barrier = rcu_barrier_tasks, > - .async = call_rcu_tasks, > - .gp_barrier = rcu_barrier_tasks, > .sync = synchronize_rcu_tasks, > .exp_sync = synchronize_rcu_tasks, > .name = "tasks" > -- > 2.9.0 >