mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: "Leubner, Achim" <Achim_Leubner@adaptec.com>
Cc: arjanv@redhat.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gdth update
Date: Wed, 29 Sep 2004 15:43:01 +0200	[thread overview]
Message-ID: <20040929134301.GB17952@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <B51CDBDEB98C094BB6E1985861F53AF302DE00@nkse2k01.adaptec.com>

On Wed, 29 September 2004 14:15:57 +0200, Leubner, Achim wrote:
>  
> > > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
> > > +static irqreturn_t gdth_interrupt(int irq, void *dev_id, struct
> pt_regs *regs);
> > >  #else
> > > -static void gdth_interrupt(int irq,struct pt_regs *regs);
> > > +static void gdth_interrupt(int irq, void *dev_id, struct pt_regs
> *regs);
> > >  #endif
> > 
> > this really is the wrong way to do such irq prototype compatibility in
> > drivers. *really*
> > 
> So please tell me what the right way should be. It works without any
> problem.

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
#define irqreturn_t void
#define IRQ_NONE
#define IRQ_HANDLED
#endif

static irqreturn_t gdth_interrupt(int irq, void *_dev, struct pt_regs *regs)
{
	if (/*not for me*/)
		return IRQ_NONE;
	/* some work */
	return IRQ_HANDLED;
}

Magically get's converted to old driver code by the macros above.
Point is that all ugly parts are confined to some header and don't
pollute the driver proper.

Jörn

-- 
Do not stop an army on its way home.
-- Sun Tzu

  parent reply	other threads:[~2004-09-29 13:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-29 12:15 Leubner, Achim
2004-09-29 12:41 ` Christoph Hellwig
2004-09-29 13:43 ` Jörn Engel [this message]
2004-09-29 14:21   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2004-09-29 14:28 Leubner, Achim
     [not found] <200409281401.i8SE1dXL006887@hera.kernel.org>
2004-09-29 11:42 ` Arjan van de Ven

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=20040929134301.GB17952@wohnheim.fh-wedel.de \
    --to=joern@wohnheim.fh-wedel.de \
    --cc=Achim_Leubner@adaptec.com \
    --cc=arjanv@redhat.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®