lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151214095021.GM6357@twins.programming.kicks-ass.net>
Date:	Mon, 14 Dec 2015 10:50:21 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Boqun Feng <boqun.feng@...il.com>
Cc:	linux-sparse@...r.kernel.org, linux-kernel@...r.kernel.org,
	Christopher Li <sparse@...isli.org>,
	"Paul E . McKenney" <paulmck@...ux.vnet.ibm.com>,
	Josh Triplett <josh@...htriplett.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
	Lai Jiangshan <jiangshanlai@...il.com>,
	Andy Whitcroft <apw@...onical.com>,
	Joe Perches <joe@...ches.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Jiang Liu <jiang.liu@...ux.intel.com>,
	Marc Zyngier <marc.zyngier@....com>,
	Mika Westerberg <mika.westerberg@...ux.intel.com>,
	Russell King <rmk+kernel@....linux.org.uk>,
	Brian Norris <computersforpeace@...il.com>
Subject: Re: [RFC 3/3] irq: Privatize irq_common_data::state_use_accessors

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@...il.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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ