public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	rmk@arm.linux.org.uk
Subject: Re: [git patch] free_irq() fixes
Date: Tue, 22 Apr 2008 19:49:02 -0400	[thread overview]
Message-ID: <480E796E.4070001@garzik.org> (raw)
In-Reply-To: <alpine.LFD.1.10.0804221616280.2779@woody.linux-foundation.org>

Linus Torvalds wrote:
> 
> On Tue, 22 Apr 2008, Jeff Garzik wrote:
>> (note, for mwave I couldn't use pSettings, since that might fail the ambiguity
>> test)
> 
> Ok, so using the pointer to inside a specific pSettings field is fine.
> 
> But can you also explain to me why that insane driver does this:
> 
> 	 static irqreturn_t UartInterrupt(int irq, void *dev_id)
> 	 {
> 	-       int irqno = (int)(unsigned long) dev_id;
> 	+       unsigned short *irqno = dev_id;
> 		...
> 		*irqno, dev_id);
> 
> instead of just ignoring "dev_id" entirely, and then just using that "irq" 
> argument directly?

That was noted briefly in the push email:

> In my review of every single interrupt handler in the Linux, while
> working on another project (jgarzik/misc-2.6.git#irq-remove), I've
[...]
> Since the #irq-remove project involves removal of the 'irq' argument
> from interrupt handlers (unused 99.8% of the time),
[...]

After going over every irq handler (read: almost every driver in the 
kernel, plus arch code), my #irq-remove branch has confirmed what my gut 
already knew -- the 'irq' argument is completely unused for almost every 
driver.  So I was taking that line of thought as far as it went.

I found less than 10 cases (out of ~1100) that actually did something 
useful with the value _and_ did not have the value already stashed 
somewhere in a reached data structure.

Those cases are easily handled a la pt_regs change -- via a 
get_irqfunc_irq() -- as a quick fix, or the preferred cleanup would be 
to pass info properly via the standard method for passing info to irq 
handlers:  dev_id

	Jeff




  reply	other threads:[~2008-04-22 23:49 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-22 22:17 [git patch] free_irq() fixes Jeff Garzik
2008-04-22 22:25 ` Linus Torvalds
2008-04-22 22:59   ` Jeff Garzik
2008-04-22 23:20     ` Linus Torvalds
2008-04-22 23:49       ` Jeff Garzik [this message]
2008-04-22 23:52         ` Linus Torvalds
2008-04-23  0:05           ` Adrian Bunk
2008-04-23  0:16             ` Linus Torvalds
2008-04-23 13:51               ` Rene Herman
2008-04-24  2:10                 ` Jeff Garzik
2008-04-24  2:19                   ` Linus Torvalds
2008-04-24  5:59                     ` Eric W. Biederman
2008-04-24 10:53                       ` Jeff Garzik
2008-04-24 15:16                         ` Linus Torvalds
2008-04-24 15:40                           ` Jeff Garzik
2008-04-24 15:55                             ` Linus Torvalds
2008-04-24 15:37                               ` Alan Cox
2008-04-24 16:20                                 ` Jeff Garzik
2008-04-24 16:16                               ` Jeff Garzik
2008-04-24 16:48                               ` Eric W. Biederman
2008-04-24 16:58                                 ` Linus Torvalds
2008-04-24 18:15                                   ` Eric W. Biederman
2008-04-24 17:30                                 ` Jeff Garzik
2008-04-25  2:53                                   ` Eric W. Biederman
2008-04-25  3:33                                     ` MSI, fun for the whole family (was Re: [git patch] free_irq() fixes) Jeff Garzik
2008-04-25  3:57                                       ` MSI, fun for the whole family Roland Dreier
2008-04-25  4:19                                         ` David Miller
2008-04-25  4:35                                         ` Jeff Garzik
2008-04-25  5:48                                           ` Eric W. Biederman
2008-04-25 22:44                                           ` Roland Dreier
2008-04-25  5:08                                       ` Eric W. Biederman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=480E796E.4070001@garzik.org \
    --to=jeff@garzik.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox