public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matt Domsch <Matt_Domsch@dell.com>
To: "Moore, Eric Dean" <Eric.Moore@lsil.com>
Cc: Olaf Hering <olh@suse.de>, Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org,
	James Bottomley <James.Bottomley@SteelEye.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion
Date: Tue, 19 Jul 2005 22:12:49 -0500	[thread overview]
Message-ID: <20050720031249.GA18042@humbolt.us.dell.com> (raw)
In-Reply-To: <91888D455306F94EBD4D168954A9457C03281EB4@nacos172.co.lsil.com>

On Tue, Jul 19, 2005 at 06:07:41PM -0600, Moore, Eric Dean wrote:
> On Tuesday, July 12, 2005 8:17 PM, Matt Domsch wrote:
> > In general, this construct:
> > 
> > > > -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,6))
> > > > -static int inline scsi_device_online(struct scsi_device *sdev)
> > > > -{
> > > > -	return sdev->online;
> > > > -}
> > > > -#endif
> > 
> > is better tested as:
> > 
> > #ifndef scsi_device_inline
> > static int inline scsi_device_online(struct scsi_device *sdev)
> > {
> >     return sdev->online;
> > }
> > #endif
> > 
> > when you can.  It cleanly eliminates the version test, and tests for
> > exactly what you're looking for - is this function defined.
> > 
> 
> What you illustrated above is not going to work.
> If your doing #ifndef around a function, such as scsi_device_online, it's
> not going to compile
> when scsi_device_online is already implemented in the kernel tree.
> The routine scsi_device_online is a function, not a define.  For a define
> this would work.

Sure it does, function names are defined symbols.

I'm doing exactly this in my backport of the openipmi drivers to RHEL4
and SLES9.

> I'm trying your example around msleep, msleep_interruptible, and
> msecs_to_jiffies, and 
> my code simply won't compile in SLES9 SP2(-191).  In SLES9 SP1(-139), these
> three routines were not implemented and
> your suggestion works.  I won't be able to to a linux version check as this
> change occurred between service packs
> of the 2.6.5 kernel suse tree.   Anybody on the linux forums have any ideas?
> 
> Example:
> 
> #ifdef msleep

#ifndef  you mean.

> static void inline msleep(unsigned long msecs)
> {
>         set_current_state(TASK_UNINTERRUPTIBLE);
>         schedule_timeout(msecs_to_jiffies(msecs) + 1);
> }
> #endif


Thanks,
Matt

-- 
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

  reply	other threads:[~2005-07-20  3:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-20  0:07 [PATCH 22/82] remove linux/version.h from drivers/message/fus ion Moore, Eric Dean
2005-07-20  3:12 ` Matt Domsch [this message]
2005-07-20  4:28   ` Stephen Rothwell
2005-07-20  5:09   ` Moore, Eric Moore
2005-07-20  8:30   ` Bernd Petrovitsch
2005-07-20 12:48   ` Matthew Wilcox
2005-07-20 17:54   ` Nathan Lynch
2005-07-20 18:22     ` Matt Domsch
2005-07-20 17:55 ` Nish Aravamudan
  -- strict thread matches above, loose matches on Subject: below --
2005-07-13 15:11 Moore, Eric Dean
2005-07-12 22:34 Moore, Eric Dean
2005-07-12 20:50 Moore, Eric Dean
2005-07-12 20:56 ` Tom Duffy
2005-07-12 22:14 ` David S. Miller
2005-07-11  0:15 Moore, Eric Dean
2005-07-12 20:30 ` Tom Duffy
2005-07-13  2:16 ` Matt Domsch
2005-07-13 14:37   ` Christoph Hellwig

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=20050720031249.GA18042@humbolt.us.dell.com \
    --to=matt_domsch@dell.com \
    --cc=Eric.Moore@lsil.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=olh@suse.de \
    /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