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: <Pine.LNX.4.64.1003211206380.7805@ask.diku.dk>
Date:	Sun, 21 Mar 2010 12:08:28 +0100 (CET)
From:	Julia Lawall <julia@...u.dk>
To:	"Eric W. Biederman" <ebiederm@...ssion.com>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Yinghai Lu <yinghai@...nel.org>, Ingo Molnar <mingo@...e.hu>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Suresh Siddha <suresh.b.siddha@...el.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 06/12] genericirq: make irq_chip related function to take
 desc

Another detail is that the type of irq is not always unsigned int.  
Coccinelle will match unsigned int to just unsigned, but there are also 
occurrences of uint32_t and u_int.  I don't know if it is desirable to 
preserve these names, or if it would be just as well to put unsigned int 
everywhere?

julia



On Sat, 20 Mar 2010, Eric W. Biederman wrote:

> 
> I haven't heard anything more on this, but I had reason to play with
> coccinelle http://coccinelle.lip6.fr/ which I think is think think is
> the semantic patcher you referred to.
> 
> In any case I was playing with it and I believe I have managed to whip
> up a fairly robust semantic patch.  The last two hunks are to cleanup
> earlier transforms, by removing unnecessary irq_to_desc chatter, and
> removing unused variables.  I am a big grumpy that I couldn't figure
> out how to add comments to my patch to explain the tricky bits,
> but otherwise I am happy.
> 
> The patch appears to have the limitation that methods that are not in
> the file where struct irq_chip is defined, which is an issue for the
> msi irq_chip helper routines.  Other than that I don't know of any
> issues.
> 
> I would suggest changing as much of the x86 non irq_chip helpers to
> use irq_desc before applying this so it this the conversion can have
> the chance to remove any irq variables.
> 
> Eric
> 
> 
> @ DECL @
> struct irq_chip CHIP;
> identifier METHOD;
> identifier METHOD_NAME;
> @@
>  CHIP.METHOD_NAME = METHOD;
> 
> @ @
> identifier DECL.METHOD;
> identifier IRQ;
> @@
>  METHOD(
> -		unsigned int IRQ
> +		struct irq_desc *unused
>  , ...) {
>  }
> 
> @ @
> identifier DECL.METHOD;
> identifier IRQ;
> identifier DESC;
> @@
>  METHOD(
> -		unsigned int IRQ
> +		struct irq_desc *DESC
>  , ...) {
> +	unsigned int IRQ = DESC->irq;
>  	...
> -	struct irq_desc *DESC = irq_to_desc(IRQ);
> 	...
>  }
> 
> @ @
> identifier DECL.METHOD;
> identifier IRQ;
> identifier DESC;
> @@
>  METHOD(
> -		unsigned int IRQ
> +		struct irq_desc *DESC
>  , ...) {
> +	unsigned int IRQ = DESC->irq;
>  	...
> -	struct irq_desc *DESC;
> 	...
> -	DESC = irq_to_desc(IRQ);
> 	...
>  }
> 
> @ @
> identifier DECL.METHOD;
> identifier IRQ;
> @@
>  METHOD(
> -		unsigned int IRQ
> +		struct irq_desc *desc
>  , ...) {
> +	unsigned int IRQ = desc->irq;
>  ...
>  }
> 
> @ @
> identifier DECL.METHOD;
> identifier FUNC;
> identifier IRQ;
> @@
>  FUNC(...) {
>  <...
> 	METHOD(
> -		IRQ
> +		irq_to_desc(IRQ)
>  		, ... )
>  ...>
>  }
> 
> @ @
> identifier FUNC;
> identifier DESC;
> identifier IRQ;
> @@
>  FUNC(..., struct irq_desc *DESC, ...) {
>  ...
>  	unsigned int IRQ = DESC->irq;
>  <...
> -	irq_to_desc(IRQ)
> +	DESC
>  ...>
>  }
> 
> @ @
> identifier FUNC;
> identifier DESC;
> identifier IRQ;
> @@
>  FUNC(..., struct irq_desc *DESC, ...) {
>  ...
> -	unsigned int IRQ = DESC->irq;
>  ... when != IRQ
>  }
> 
--
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