Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1120663ybh; Sun, 19 Jul 2020 09:08:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzf4moDOFTQY8us8/DAMRgHMqqT1OvOHiEHCz723w7EkzepALxAhkFsWTf8duvJxuxexPF X-Received: by 2002:a17:906:ce43:: with SMTP id se3mr16915536ejb.543.1595174906269; Sun, 19 Jul 2020 09:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595174906; cv=none; d=google.com; s=arc-20160816; b=xd3fiuP7uMyMz8lH66+nv4fHXk2z5NqzzfW73YFPVEc6k9fj0xEE/EMiEMSNyzN/fs Y1fNJ4U3JUMjfpW4nbm4lWEZVc1z69ls55Gkfl5tzd0OfAQLyM/bm8Y7zp4/k8i0Wtkw jnyfN4ICn6xdyRvJ8OhWZnim3ux3naeC6fvdDjenHrlBMOCaO1/T/iHMjFHvoBycR1N4 8/HIZV2sH4fENX22i4gNb2trFxduIdQ8tpqILr26h+rp7DPog1JrxgBnCzbnCxNEYC8T s9r3uJKG0vSy/k/y8u7D7dlwfwAC+e5Cr8UZkzrEFTV03ZRzYYvvJKiPn8Oy67Fltffy F9EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=aIIQFSzXLazfTpidpBno2mwQlZLmrY6HJKhD7GLvkow=; b=Z3cDPHDQvAgniWqZFhljt6sILl7p9xKWOyNYUvEHo+c6jVV3m/iHeR6OJguYI75TUA N9uNus+E+qMq2o8QhpkhTHiKumRThuDgLapCjNm1GiAeBmXT/vcliq2AceaJspa6f9oC rpQLtIWowaO6KJtxjEkQxC75/z1gUWfniHR4TA32+nk9JzGKS1sg29tP6l0yK69CRRDY IxMHmvdEs7krfb/mosMrjB3NFEGY4mz/fhrdm9CNre4oWRqhWfkMDaY/va8NwhNoRVgx UEhDVuT2/ilBgAEz0rF3dVQf5lLCO6c86ShB5V1uZa3XZhJwX1/NumPhUbJxkyfgz8K2 VF0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GmqHxtkW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l7si8817293edr.156.2020.07.19.09.08.03; Sun, 19 Jul 2020 09:08:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GmqHxtkW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726468AbgGSQHs (ORCPT + 99 others); Sun, 19 Jul 2020 12:07:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:37488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726135AbgGSQHs (ORCPT ); Sun, 19 Jul 2020 12:07:48 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-111-31.bvtn.or.frontiernet.net [50.39.111.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DB42920B1F; Sun, 19 Jul 2020 16:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595174867; bh=2BfF/nA6ErAFY5oFLxZej205Ou61k5E8QwnjkOKRk+0=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=GmqHxtkWB4ds/QN/SoElqW7DkCtXZvxM/FlSlXH2lEzzBioNABMrbzVq6YcRDfT8U e8lfW9CsDVg0onGmBK4sVlyfbE0koxvYjRkepb4/3XrocRM3w0337rrOKsQRYdBBUV NGpfUUgDdCdtlCg1UlB/pK0bF0WzSZvdEDwcs2t4= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id BB3A53522960; Sun, 19 Jul 2020 09:07:47 -0700 (PDT) Date: Sun, 19 Jul 2020 09:07:47 -0700 From: "Paul E. McKenney" To: Suraj Upadhyay Cc: josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, joel@joelfernandes.org, madhuparnabhowmik10@gmail.com, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rculist: Silence unused-value warning. Message-ID: <20200719160747.GE9247@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200719105037.GA21010@blackclown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200719105037.GA21010@blackclown> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 19, 2020 at 04:20:37PM +0530, Suraj Upadhyay wrote: > The macro __list_check_srcu is used as a statement inside a for loop. > > __list_check_srcu becomes "true" when CONFIG_PROVE_RCU_LIST is not defined. > This results in compiler warning about an unused value ("true"). > > Silence the compiler warning about the unused value "true" > by replacing it with an empty expression. > > Signed-off-by: Suraj Upadhyay Like this, you mean, give or take whitespace? ;-) https://lore.kernel.org/lkml/20200718001259.GY9247@paulmck-ThinkPad-P72/ May I add your Tested-by? Thanx, Paul > --- > include/linux/rculist.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/rculist.h b/include/linux/rculist.h > index de9385b9158e..8b8e0584c473 100644 > --- a/include/linux/rculist.h > +++ b/include/linux/rculist.h > @@ -73,7 +73,7 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list) > #define __list_check_rcu(dummy, cond, extra...) \ > ({ check_arg_count_one(extra); }) > > -#define __list_check_srcu(cond) true > +#define __list_check_srcu(cond) ({}) > #endif > > /* > -- > 2.17.1 >