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: <m1eije71et.fsf@fess.ebiederm.org>
Date:	Sat, 20 Mar 2010 21:18:34 -0700
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	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>, Julia Lawall <julia@...u.dk>
Subject: Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc


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