Commit b354286e authored by Boqun Feng's avatar Boqun Feng Committed by Paul E. McKenney

irq: Privatize irq_common_data::state_use_accessors

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. Also #undef the macro
__irqd_to_state after used in header files, so that the macro can't be
misused.
Signed-off-by: default avatarBoqun Feng <boqun.feng@gmail.com>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent 67c583a7
...@@ -137,7 +137,7 @@ struct irq_domain; ...@@ -137,7 +137,7 @@ struct irq_domain;
* @msi_desc: MSI descriptor * @msi_desc: MSI descriptor
*/ */
struct irq_common_data { struct irq_common_data {
unsigned int state_use_accessors; unsigned int __private state_use_accessors;
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
unsigned int node; unsigned int node;
#endif #endif
...@@ -208,7 +208,7 @@ enum { ...@@ -208,7 +208,7 @@ enum {
IRQD_FORWARDED_TO_VCPU = (1 << 20), 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) static inline bool irqd_is_setaffinity_pending(struct irq_data *d)
{ {
...@@ -299,6 +299,8 @@ static inline void irqd_clr_forwarded_to_vcpu(struct irq_data *d) ...@@ -299,6 +299,8 @@ static inline void irqd_clr_forwarded_to_vcpu(struct irq_data *d)
__irqd_to_state(d) &= ~IRQD_FORWARDED_TO_VCPU; __irqd_to_state(d) &= ~IRQD_FORWARDED_TO_VCPU;
} }
#undef __irqd_to_state
static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d)
{ {
return d->hwirq; return d->hwirq;
......
...@@ -160,6 +160,8 @@ irq_put_desc_unlock(struct irq_desc *desc, unsigned long flags) ...@@ -160,6 +160,8 @@ irq_put_desc_unlock(struct irq_desc *desc, unsigned long flags)
__irq_put_desc_unlock(desc, flags, false); __irq_put_desc_unlock(desc, flags, false);
} }
#define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors)
/* /*
* Manipulation functions for irq_data.state * Manipulation functions for irq_data.state
*/ */
...@@ -188,6 +190,8 @@ static inline bool irqd_has_set(struct irq_data *d, unsigned int mask) ...@@ -188,6 +190,8 @@ static inline bool irqd_has_set(struct irq_data *d, unsigned int mask)
return __irqd_to_state(d) & mask; return __irqd_to_state(d) & mask;
} }
#undef __irqd_to_state
static inline void kstat_incr_irqs_this_cpu(struct irq_desc *desc) static inline void kstat_incr_irqs_this_cpu(struct irq_desc *desc)
{ {
__this_cpu_inc(*desc->kstat_irqs); __this_cpu_inc(*desc->kstat_irqs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment