Received: by 10.223.185.116 with SMTP id b49csp119639wrg; Thu, 22 Feb 2018 17:59:53 -0800 (PST) X-Google-Smtp-Source: AH8x225Ub9UH8i6xY9Umggz5+Ej36zBzElSeL1rVt6RTXGTVF9ORCPo4VVhqkChhpLf8YVrNIzYO X-Received: by 2002:a17:902:a512:: with SMTP id s18-v6mr74023plq.296.1519351193570; Thu, 22 Feb 2018 17:59:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519351193; cv=none; d=google.com; s=arc-20160816; b=ueCEoDLHnYTvImDMhXrqIlT4C0qCyZqYKYy3HPCJ3PZNbAvuE+xP+nB4oj0lnPYXpt pJ0YtRr1En8/zkGFLqEaAzJ3TZDZqQJbKLyGty+2O9Pkz/6zjfmCpLhFPu/24JX/JJws rxFRQ1yzS44rYKfG9kULSWW0t2FLkeEXj19tvxw3FkZXFjZ3hDbcAkXCZmRzc+Duj6jL C/FE4eCpcEMqlRUqpHfMSe1hZMK4Dhze0QHFcbU0P90d66t108o3tiHqFc3B1Y7umNDa c4rjIdXBfhOOZSML2v0th/ymJG5Afo4nQ61Z1G2Y+QuiKtS/LcXeYG6jyvvCSK7bvIab ImoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=hICIPKv7gJKQz5WnTM97Jx0M8/2yfPC23f/rNZ4PGhw=; b=lU9ogiYSROX7YftoQx10qKatv2ZI8SlfqV/McMghRv+K72AwKtHJR3lZ2vFJbtUyjh YA3o5IEwxjMwL1M7ijQ1JT49hRxQsPcA3FUQPza0AQhu/zKpk0S+1DfhvHQvhuMy0QwD HJA5WCmlu9LND1EaWy1RaenSDSh9OYVUWopu6WE/fd/mRFOuibkX241SVBdo2BiLyNYh rr94sgZdtpnaCSOKMOr7IjOySTZvoLoqNBzP5JqgHWpqQ34gtWFMdK49jrX7w9rTLlPO MvV81pBxwNh0XFFSYt8HmcrGfB6kdxQkaE9ZCre+85VgK8jd0dbMwn/1/UtLRLxIIxt6 DC2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LVtFVLI7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si809656pgv.163.2018.02.22.17.59.36; Thu, 22 Feb 2018 17:59:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LVtFVLI7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751367AbeBWB6v (ORCPT + 99 others); Thu, 22 Feb 2018 20:58:51 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:52225 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751274AbeBWB6u (ORCPT ); Thu, 22 Feb 2018 20:58:50 -0500 Received: by mail-it0-f66.google.com with SMTP id o13so1313512ito.2 for ; Thu, 22 Feb 2018 17:58:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=hICIPKv7gJKQz5WnTM97Jx0M8/2yfPC23f/rNZ4PGhw=; b=LVtFVLI7jFxBaSUMgTu07kHta+LJiS/ShMOX7CXr61E3HkMFDD0uBpg1qz3Olg0xPZ pj1MSYMCmwO6QG4xl30wzbuSObyUaElxdPETOH6NVPE2ShUcphoqiuqC0OlBRgTDgj1g h2opvmdBUnPVXx0OeL0aF7u9H1bfWPp775GqqnnkMLywg+6yzl6ZJ7g5jvc8HLwtIUpB 3upVR6wWa1oyfEJAeNZs2Xfk6ilmaTa2IrDfTs3856hYNc/SSr3WrMTknKxUSHpQ5gnQ wGfu16eLkKV7kp9TJyM+2xdjPNIR5isuNxGcWWQYeAgukwvBLdcjVmvzhH4vDBObe1iu QaIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=hICIPKv7gJKQz5WnTM97Jx0M8/2yfPC23f/rNZ4PGhw=; b=pJKYijyfy+UiWhLP/cNM8gpdOS1a2tHjZvDtAthpM1Ypk+nf6iV9KpILC68Z6PnCBC Wa82rdrsYDTqzmLCyRswCjm1mvGA0EU8jKmsuOuxFdhXTHXWjcDZgbKyGQ8GY4ioESmL 0sbkniyqOswT7+accryRZoMmNJgosdHQwn6KZHGtBn++ze4F29xS3iUe+rjx4kS9WZeN 4efaAoD20GCFUd8AnBSrfYjXOKNV4f2i+1eybWVQ06MTBAMOasHzhDK9KYEHvcgw+zTa OTzNyYLuehri64Abyvr9Uo0UosNftXCVfH6zPm0WJMV/767L15BwEXtsE0vSrvXd9t25 3IFw== X-Gm-Message-State: APf1xPCgb0fXtXhKvD7reZXjN5BsS7ESlk95NoEacEvfwRaf6j6yhY+5 ddZP8AoKgANnUY3JW6XfYJoiLCWT0va54uZN2Oo= X-Received: by 10.36.39.129 with SMTP id g123mr536767ita.91.1519351129786; Thu, 22 Feb 2018 17:58:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.102.25 with HTTP; Thu, 22 Feb 2018 17:58:49 -0800 (PST) In-Reply-To: <20180223012057.GO2855@linux.vnet.ibm.com> References: <1519282357-17983-1-git-send-email-zhouzhouyi@gmail.com> <20180222165803.GF2855@linux.vnet.ibm.com> <20180223012057.GO2855@linux.vnet.ibm.com> From: Zhouyi Zhou Date: Fri, 23 Feb 2018 09:58:49 +0800 Message-ID: Subject: Re: [PATCH] srcu: remove never used variable To: Paul McKenney Cc: "josh@joshtriplett.org" , "rostedt@goodmis.org" , "mathieu.desnoyers@efficios.com" , "jiangshanlai@gmail.com" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: 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 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 >> wrote: >> >> > On Thu, Feb 22, 2018 at 06:52:37AM +0000, zhouzhouyi@gmail.com wrote: >> > > From: Zhouyi Zhou >> > > >> > > In function srcu_gp_end, the variable idxnext is never used after assign, >> > > remove it and its assign statement. >> > > >> > > Signed-off-by: Zhouyi Zhou >> > >> > 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 >> > > >> > >> > >