mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
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 13:41:12 +0100	[thread overview]
Message-ID: <20040929134112.B11891@infradead.org> (raw)
In-Reply-To: <B51CDBDEB98C094BB6E1985861F53AF302DE00@nkse2k01.adaptec.com>; from Achim_Leubner@adaptec.com on Wed, Sep 29, 2004 at 02:15:57PM +0200

On Wed, Sep 29, 2004 at 02:15:57PM +0200, Leubner, Achim wrote:
> > C99 initializers work in all kernel versions since it's a property of
> > the C compiler not of the kernel. I wonder why you are putting this
> > ifdef here....
> >
> Agree. If the initializers works also fine with compiler versions in
> older distributions with the 2.4.x and 2.2.x kernels, the ifdef is
> really useless. 

C99 initializes (.foo) are supported at least down to gcc 2.7

> > the rest of your ifdefs are generally quite fishy too
> unfortionately...
> >
> Could you please explain it exactly? I really want to learn what the
> problems are to correct it in the next version.

e.g. you have

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,11)
MODULE_LICENSE("GPL");
#endif


much better would be to put a 

#ifndef MODULE_LICENSE
#define MODULE_LICENSE(name)
#endif

into some header and use it unconditionally later on.

or you have

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    b = virt_ctr ? NUMDATA(scp->device->host)->busnum : scp->device->channel;
    t = scp->device->id;
#else
    b = virt_ctr ? NUMDATA(scp->host)->busnum : scp->channel;
    t = scp->target;
#endif

where the 2.6 branch just works for 2.4 and 2.2 kernels aswell, so you
could get rid of the old branch completely.

In genereal always try to write to the current API and emulate it on
older releases.


  reply	other threads:[~2004-09-29 12:41 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 [this message]
2004-09-29 13:43 ` Jörn Engel
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=20040929134112.B11891@infradead.org \
    --to=hch@infradead.org \
    --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®