All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jeff Garzik <jgarzik@pobox.com>,
	Ash Willis <ashwillis@programmer.net>,
	linux-pcmcia@lists.infradead.org
Subject: [PATCH 1/3] Improve type handling in interrupt handlers
Date: Sat, 19 Jan 2008 07:22:25 +1100	[thread overview]
Message-ID: <200801190722.26154.rusty@rustcorp.com.au> (raw)

This improves typechecking of interrupt handlers by removing
unnecessary (void *) casts and storing handlers in correctly-typed
variables.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Ash Willis <ashwillis@programmer.net>
Cc: linux-pcmcia@lists.infradead.org
---
 drivers/net/e1000/e1000_main.c |    2 +-
 drivers/net/e1000e/netdev.c    |    2 +-
 drivers/net/eth16i.c           |    2 +-
 drivers/net/ewrk3.c            |    2 +-
 drivers/net/skfp/skfddi.c      |    2 +-
 include/pcmcia/cs.h            |    2 +-
 sound/pci/als300.c             |    2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff -r 0fe1a980708b drivers/net/eth16i.c
--- a/drivers/net/eth16i.c	Thu Jan 17 14:48:56 2008 +1100
+++ b/drivers/net/eth16i.c	Thu Jan 17 15:42:00 2008 +1100
@@ -529,7 +529,7 @@ static int __init eth16i_probe1(struct n
 
 	/* Try to obtain interrupt vector */
 
-	if ((retval = request_irq(dev->irq, (void *)&eth16i_interrupt, 0, cardname, dev))) {
+	if ((retval = request_irq(dev->irq, eth16i_interrupt, 0, cardname, dev))) {
 		printk(KERN_WARNING "%s at %#3x, but is unusable due to conflicting IRQ %d.\n",
 		       cardname, ioaddr, dev->irq);
 		goto out;
diff -r 0fe1a980708b drivers/net/ewrk3.c
--- a/drivers/net/ewrk3.c	Thu Jan 17 14:48:56 2008 +1100
+++ b/drivers/net/ewrk3.c	Thu Jan 17 15:42:00 2008 +1100
@@ -635,7 +635,7 @@ static int ewrk3_open(struct net_device 
 	STOP_EWRK3;
 
 	if (!lp->hard_strapped) {
-		if (request_irq(dev->irq, (void *) ewrk3_interrupt, 0, "ewrk3", dev)) {
+		if (request_irq(dev->irq, ewrk3_interrupt, 0, "ewrk3", dev)) {
 			printk("ewrk3_open(): Requested IRQ%d is busy\n", dev->irq);
 			status = -EAGAIN;
 		} else {
diff -r 0fe1a980708b drivers/net/skfp/skfddi.c
--- a/drivers/net/skfp/skfddi.c	Thu Jan 17 14:48:56 2008 +1100
+++ b/drivers/net/skfp/skfddi.c	Thu Jan 17 15:42:00 2008 +1100
@@ -495,7 +495,7 @@ static int skfp_open(struct net_device *
 
 	PRINTK(KERN_INFO "entering skfp_open\n");
 	/* Register IRQ - support shared interrupts by passing device ptr */
-	err = request_irq(dev->irq, (void *) skfp_interrupt, IRQF_SHARED,
+	err = request_irq(dev->irq, skfp_interrupt, IRQF_SHARED,
 			  dev->name, dev);
 	if (err)
 		return err;
diff -r 0fe1a980708b include/pcmcia/cs.h
--- a/include/pcmcia/cs.h	Thu Jan 17 14:48:56 2008 +1100
+++ b/include/pcmcia/cs.h	Thu Jan 17 15:42:01 2008 +1100
@@ -170,7 +170,7 @@ typedef struct irq_req_t {
     u_int	Attributes;
     u_int	AssignedIRQ;
     u_int	IRQInfo1, IRQInfo2; /* IRQInfo2 is ignored */
-    void	*Handler;
+    int		(*Handler)(int, void *);
     void	*Instance;
 } irq_req_t;
 
diff -r 0fe1a980708b sound/pci/als300.c
--- a/sound/pci/als300.c	Thu Jan 17 14:48:56 2008 +1100
+++ b/sound/pci/als300.c	Thu Jan 17 15:42:01 2008 +1100
@@ -678,7 +678,7 @@ static int __devinit snd_als300_create(s
 				       struct snd_als300 **rchip)
 {
 	struct snd_als300 *chip;
-	void *irq_handler;
+	int (*irq_handler)(int, void *);
 	int err;
 
 	static struct snd_device_ops ops = {
diff -r 0fe1a980708b drivers/net/e1000e/netdev.c
--- a/drivers/net/e1000e/netdev.c	Thu Jan 17 14:48:56 2008 +1100
+++ b/drivers/net/e1000e/netdev.c	Thu Jan 17 15:42:00 2008 +1100
@@ -935,7 +935,7 @@ static int e1000_request_irq(struct e100
 static int e1000_request_irq(struct e1000_adapter *adapter)
 {
 	struct net_device *netdev = adapter->netdev;
-	void (*handler) = &e1000_intr;
+	int (*handler)(int, void *) = &e1000_intr;
 	int irq_flags = IRQF_SHARED;
 	int err;
 
diff -r 0fe1a980708b drivers/net/e1000/e1000_main.c
--- a/drivers/net/e1000/e1000_main.c	Thu Jan 17 14:48:56 2008 +1100
+++ b/drivers/net/e1000/e1000_main.c	Thu Jan 17 15:42:00 2008 +1100
@@ -299,7 +299,7 @@ static int e1000_request_irq(struct e100
 static int e1000_request_irq(struct e1000_adapter *adapter)
 {
 	struct net_device *netdev = adapter->netdev;
-	void (*handler) = &e1000_intr;
+	irqreturn_t (*handler)(int, void *) = &e1000_intr;
 	int irq_flags = IRQF_SHARED;
 	int err;
 

             reply	other threads:[~2008-01-18 20:23 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-18 20:22 Rusty Russell [this message]
2008-01-18 20:25 ` [PATCH 2/3] Make IRQ handlers typesafe Rusty Russell
2008-01-18 20:25 ` Rusty Russell
2008-01-18 20:27   ` [PATCH 3/3] Makes lguest's irq handler typesafe Rusty Russell
2008-01-18 20:45     ` Jeff Garzik
2008-01-18 22:17       ` Rusty Russell
2008-01-18 22:17       ` Rusty Russell
2008-01-18 20:45     ` Jeff Garzik
2008-01-18 23:12     ` Tejun Heo
2008-01-19  1:28       ` Rusty Russell
2008-01-19  1:28       ` Rusty Russell
2008-01-19  1:40         ` Tejun Heo
2008-01-19  1:40         ` Tejun Heo
2008-01-19  1:44           ` Tejun Heo
2008-01-19  3:59             ` Rusty Russell
2008-01-19  3:59             ` Rusty Russell
2008-01-19  4:08               ` Tejun Heo
2008-01-19 23:27                 ` Rusty Russell
2008-01-19 23:27                 ` Rusty Russell
2008-01-19  4:08               ` Tejun Heo
2008-01-19  1:44           ` Tejun Heo
2008-01-18 23:12     ` Tejun Heo
2008-01-18 20:27   ` Rusty Russell
2008-01-18 20:43   ` [PATCH 2/3] Make IRQ handlers typesafe Jeff Garzik
2008-01-18 20:43   ` Jeff Garzik
2008-01-18 20:41 ` [PATCH 1/3] Improve type handling in interrupt handlers Jeff Garzik
2008-01-18 22:11   ` Rusty Russell
2008-01-18 22:54     ` Jeff Garzik
2008-01-19  1:29   ` Rusty Russell

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=200801190722.26154.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=akpm@linux-foundation.org \
    --cc=ashwillis@programmer.net \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pcmcia@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.