lkml.org 
[lkml]   [2015]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 3/3] irq: Privatize irq_common_data::state_use_accessors
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 <boqun.feng@gmail.com>
> > ---
> > 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.



\
 
 \ /
  Last update: 2015-12-14 11:41    [W:0.059 / U:0.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site