From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932237AbbLNKD5 (ORCPT ); Mon, 14 Dec 2015 05:03:57 -0500 Received: from www.linutronix.de ([62.245.132.108]:56949 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932099AbbLNKDz (ORCPT ); Mon, 14 Dec 2015 05:03:55 -0500 Date: Mon, 14 Dec 2015 11:03:03 +0100 (CET) From: Thomas Gleixner To: Peter Zijlstra cc: Boqun Feng , linux-sparse@vger.kernel.org, linux-kernel@vger.kernel.org, Christopher Li , "Paul E . McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Andy Whitcroft , Joe Perches , Jiang Liu , Marc Zyngier , Mika Westerberg , Russell King , Brian Norris Subject: Re: [RFC 3/3] irq: Privatize irq_common_data::state_use_accessors In-Reply-To: <20151214095021.GM6357@twins.programming.kicks-ass.net> Message-ID: References: <1449888962-29348-1-git-send-email-boqun.feng@gmail.com> <1449888962-29348-4-git-send-email-boqun.feng@gmail.com> <20151214095021.GM6357@twins.programming.kicks-ass.net> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 14 Dec 2015, Peter Zijlstra wrote: > On Sat, Dec 12, 2015 at 10:56:02AM +0800, Boqun Feng wrote: > > According to Peter Zijlstra, irq_common_data::state_use_accessors is not > > designed for public use. Therefore make it private so that people who > > write code accessing it directly will get blamed by sparse. > > > > Signed-off-by: Boqun Feng > > --- > > include/linux/irq.h | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/include/linux/irq.h b/include/linux/irq.h > > index 3c1c967..0b8f273 100644 > > --- a/include/linux/irq.h > > +++ b/include/linux/irq.h > > @@ -137,7 +137,7 @@ struct irq_domain; > > * @msi_desc: MSI descriptor > > */ > > struct irq_common_data { > > - unsigned int state_use_accessors; > > + unsigned int __private state_use_accessors; > > #ifdef CONFIG_NUMA > > unsigned int node; > > #endif > > @@ -208,7 +208,7 @@ enum { > > IRQD_FORWARDED_TO_VCPU = (1 << 20), > > }; > > > > -#define __irqd_to_state(d) ((d)->common->state_use_accessors) > > +#define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors) > > > > static inline bool irqd_is_setaffinity_pending(struct irq_data *d) > > { > > We should probably #undef that one once we're done with it.. Thomas? Probably.