Re: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion

2005-07-20 Thread Bernd Petrovitsch
On Tue, 2005-07-19 at 22:12 -0500, Matt Domsch wrote:
 On Tue, Jul 19, 2005 at 06:07:41PM -0600, Moore, Eric Dean wrote:
[...]
  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.

Defined for the preprocessor or the pure C-compiler or both of them?

Bernd
-- 
Firmix Software GmbH   http://www.firmix.at/
mobil: +43 664 4416156 fax: +43 1 7890849-55
  Embedded Linux Development and Services

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion

2005-07-20 Thread Matthew Wilcox
On Tue, Jul 19, 2005 at 10:12:49PM -0500, Matt Domsch wrote:
  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.

uh, not to the preprocessor, they aren't.

-- 
Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception. -- Mark Twain
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion

2005-07-20 Thread Nathan Lynch
Matt Domsch wrote:
 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.
 

$ cat foo.c
static int foo(void) { return 0; }
#ifndef foo
static int foo(void) { return 0; }
#endif

$ gcc -c foo.c
foo.c:3: error: redefinition of 'foo'
foo.c:1: error: previous definition of 'foo' was here

I believe #ifdef/#ifndef can test only preprocessor symbols.

Nathan
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion

2005-07-20 Thread Nish Aravamudan
On 7/19/05, Moore, Eric Dean [EMAIL PROTECTED] 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.
 
 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
 static void inline msleep(unsigned long msecs)
 {
 set_current_state(TASK_UNINTERRUPTIBLE);
 schedule_timeout(msecs_to_jiffies(msecs) + 1);
 }
 #endif

Just an FYI, if you are trying to emulate the actual behavior of
msleep() in the current kernel via this function, then you need to
place the sleep in a while-loop. Please see kernel/timer.c::msleep().
Your version will wake up on wait-queue events, while msleep() in the
current kernel does not.

Thanks,
Nish
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion

2005-07-20 Thread Matt Domsch
On Wed, Jul 20, 2005 at 12:54:09PM -0500, Nathan Lynch wrote:
 Matt Domsch wrote:
  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.
  
 
 $ cat foo.c
 static int foo(void) { return 0; }
 #ifndef foo
 static int foo(void) { return 0; }
 #endif
 
 $ gcc -c foo.c
 foo.c:3: error: redefinition of 'foo'
 foo.c:1: error: previous definition of 'foo' was here
 
 I believe #ifdef/#ifndef can test only preprocessor symbols.


I was mistaken. Christoph explained to me that it worked on 2.4 due to
the way module symbol versions worked, but isn't that way on 2.6
anymore.  My apologies.

-- 
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com  www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion

2005-07-19 Thread Moore, Eric Dean
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.

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
static void inline msleep(unsigned long msecs)
{
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(msecs_to_jiffies(msecs) + 1);
}
#endif



-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion

2005-07-19 Thread Matt Domsch
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
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion

2005-07-19 Thread Stephen Rothwell
On Tue, 19 Jul 2005 22:12:49 -0500 Matt Domsch [EMAIL PROTECTED] wrote:

 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 missed the smiley, right :-)

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/


pgpUM4okjfTer.pgp
Description: PGP signature


Re: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion

2005-07-13 Thread Christoph Hellwig
 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

Even better fusion should stop using this function because doing so
is broken.. We tried that long ago but it got stuck somewhere.

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion

2005-07-13 Thread Moore, Eric Dean
On Wednesday, July 13, 2005 8:38 AM, Christoph Hellwig 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
 
 Even better fusion should stop using this function because doing so
 is broken.. We tried that long ago but it got stuck somewhere.


Christoph - We have already fixed the problem long ago; e.g.
remember when you asked me to kill the timers from the eh threads.  
Thus in todays drivers you will not find scsi_device_online called anywhere
in 
the fusion drivers.

I only objected to killing the linux_compat.h file because its being used
in our internal supported drivers, and it makes it easier upgrade path
for maintaining mainstream drivers if that was left behind in the kernel
tree.
However everybody has ambushed me on this stance, so go ahead and kill it.
We'll manage fine without it.

Eric Moore

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion

2005-07-12 Thread Tom Duffy
On Sun, 2005-07-10 at 18:15 -0600, Moore, Eric Dean wrote:
 I'd rather you not kill linux_compat.h file.
 I use this file for compatibility of driver source 
 across various kernel versions.  I provide our
 customers with driver builds containing single source 
 which needs to compile in kernels 2.6.5( e.g. SLES9),
 2.6.8 (e.g. RHEL4), and 2.6.11 ( e.g. SuSE 9.3 Pro).

It is the general policy that the source in the latest linux kernel only
supports that kernel.  You can certainly keep a compat header for your
customers, but what is in kernel.org should be clean for that version of
the kernel.

 If you look at our 3.02.18 driver source I submitted to SuSE
 for SLES9 SP2, you will see this file is about 3K bytes of
 compatibility.  

Is the 3.02.18 code generally available now?  Can it be cleaned up for
submission to 2.6.13?

-tduffy


signature.asc
Description: This is a digitally signed message part