public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion
@ 2005-07-11  0:15 Moore, Eric Dean
  2005-07-12 20:30 ` Tom Duffy
  2005-07-13  2:16 ` Matt Domsch
  0 siblings, 2 replies; 18+ messages in thread
From: Moore, Eric Dean @ 2005-07-11  0:15 UTC (permalink / raw)
  To: Olaf Hering, Andrew Morton, linux-kernel; +Cc: James Bottomley, linux-scsi

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).

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.  

Eric Moore
LSI Logic Corporation 


On Sunday, July 10, 2005 1:36 PM, Olaf Hering wrote:
> 
> 
> changing CONFIG_LOCALVERSION rebuilds too much, for no 
> appearent reason.
> 
> remove also drivers/message/fusion/linux_compat.h,
> because it is empty after the change
> 
> Signed-off-by: Olaf Hering <olh@suse.de>
> 
> drivers/message/fusion/linux_compat.h |   18 ------------------
> drivers/message/fusion/mptbase.c      |    1 -
> drivers/message/fusion/mptbase.h      |    1 -
> drivers/message/fusion/mptctl.c       |    1 -
> drivers/message/fusion/mptctl.h       |    1 -
> drivers/message/fusion/mptfc.c        |    1 -
> drivers/message/fusion/mptlan.h       |    1 -
> drivers/message/fusion/mptscsih.c     |    1 -
> drivers/message/fusion/mptspi.c       |    1 -
> 9 files changed, 26 deletions(-)
> 
> Index: linux-2.6.13-rc2-mm1/drivers/message/fusion/linux_compat.h
> ===================================================================
> --- linux-2.6.13-rc2-mm1.orig/drivers/message/fusion/linux_compat.h
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -/* drivers/message/fusion/linux_compat.h */
> -
> -#ifndef FUSION_LINUX_COMPAT_H
> -#define FUSION_LINUX_COMPAT_H
> -
> -#include <linux/version.h>
> -#include <scsi/scsi_device.h>
> -
> -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,6))
> -static int inline scsi_device_online(struct scsi_device *sdev)
> -{
> -	return sdev->online;
> -}
> -#endif
> -
> -
> -/*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> -=-=-=-=-=-=-=-=*/
> -#endif /* _LINUX_COMPAT_H */
> Index: linux-2.6.13-rc2-mm1/drivers/message/fusion/mptbase.c
> ===================================================================
> --- linux-2.6.13-rc2-mm1.orig/drivers/message/fusion/mptbase.c
> +++ linux-2.6.13-rc2-mm1/drivers/message/fusion/mptbase.c
> @@ -47,7 +47,6 @@
> /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=-=-=-=-=-=-=*/
> 
> #include <linux/config.h>
> -#include <linux/version.h>
> #include <linux/kernel.h>
> #include <linux/module.h>
> #include <linux/errno.h>
> Index: linux-2.6.13-rc2-mm1/drivers/message/fusion/mptbase.h
> ===================================================================
> --- linux-2.6.13-rc2-mm1.orig/drivers/message/fusion/mptbase.h
> +++ linux-2.6.13-rc2-mm1/drivers/message/fusion/mptbase.h
> @@ -49,7 +49,6 @@
> #define MPTBASE_H_INCLUDED
> /*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=-=-=-=-=-=-=*/
> 
> -#include <linux/version.h>
> #include <linux/config.h>
> #include <linux/kernel.h>
> #include <linux/pci.h>
> Index: linux-2.6.13-rc2-mm1/drivers/message/fusion/mptctl.c
> ===================================================================
> --- linux-2.6.13-rc2-mm1.orig/drivers/message/fusion/mptctl.c
> +++ linux-2.6.13-rc2-mm1/drivers/message/fusion/mptctl.c
> @@ -45,7 +45,6 @@
> */
> /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=-=-=-=-=-=-=*/
> 
> -#include <linux/version.h>
> #include <linux/kernel.h>
> #include <linux/module.h>
> #include <linux/errno.h>
> Index: linux-2.6.13-rc2-mm1/drivers/message/fusion/mptctl.h
> ===================================================================
> --- linux-2.6.13-rc2-mm1.orig/drivers/message/fusion/mptctl.h
> +++ linux-2.6.13-rc2-mm1/drivers/message/fusion/mptctl.h
> @@ -49,7 +49,6 @@
> #define MPTCTL_H_INCLUDED
> /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=-=-=-=-=-=-=*/
> 
> -#include "linux/version.h"
> 
> 
> /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=-=-=-=-=-=-=*/
> Index: linux-2.6.13-rc2-mm1/drivers/message/fusion/mptlan.h
> ===================================================================
> --- linux-2.6.13-rc2-mm1.orig/drivers/message/fusion/mptlan.h
> +++ linux-2.6.13-rc2-mm1/drivers/message/fusion/mptlan.h
> @@ -66,7 +66,6 @@
> #include <linux/slab.h>
> #include <linux/miscdevice.h>
> #include <linux/spinlock.h>
> -#include <linux/version.h>
> #include <linux/workqueue.h>
> #include <linux/delay.h>
> // #include <linux/trdevice.h>
> Index: linux-2.6.13-rc2-mm1/drivers/message/fusion/mptfc.c
> ===================================================================
> --- linux-2.6.13-rc2-mm1.orig/drivers/message/fusion/mptfc.c
> +++ linux-2.6.13-rc2-mm1/drivers/message/fusion/mptfc.c
> @@ -43,7 +43,6 @@
> Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  
> 02111-1307  USA
> */
> /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=-=-=-=-=-=-=*/
> -#include "linux_compat.h"	/* linux-2.6 tweaks */
> #include <linux/module.h>
> #include <linux/kernel.h>
> #include <linux/init.h>
> Index: linux-2.6.13-rc2-mm1/drivers/message/fusion/mptscsih.c
> ===================================================================
> --- linux-2.6.13-rc2-mm1.orig/drivers/message/fusion/mptscsih.c
> +++ linux-2.6.13-rc2-mm1/drivers/message/fusion/mptscsih.c
> @@ -44,7 +44,6 @@
> */
> /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=-=-=-=-=-=-=*/
> 
> -#include "linux_compat.h"	/* linux-2.6 tweaks */
> #include <linux/module.h>
> #include <linux/kernel.h>
> #include <linux/init.h>
> Index: linux-2.6.13-rc2-mm1/drivers/message/fusion/mptspi.c
> ===================================================================
> --- linux-2.6.13-rc2-mm1.orig/drivers/message/fusion/mptspi.c
> +++ linux-2.6.13-rc2-mm1/drivers/message/fusion/mptspi.c
> @@ -44,7 +44,6 @@
> */
> /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=-=-=-=-=-=-=*/
> 
> -#include "linux_compat.h"	/* linux-2.6 tweaks */
> #include <linux/module.h>
> #include <linux/kernel.h>
> #include <linux/init.h>
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion
@ 2005-07-12 20:50 Moore, Eric Dean
  2005-07-12 20:56 ` Tom Duffy
  2005-07-12 22:14 ` David S. Miller
  0 siblings, 2 replies; 18+ messages in thread
From: Moore, Eric Dean @ 2005-07-12 20:50 UTC (permalink / raw)
  To: Tom Duffy
  Cc: Olaf Hering, Andrew Morton, linux-kernel, James Bottomley,
	linux-scsi

> 
> 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.

Thanks for that info. But Id rather have same files in our maintained
driver,
and whats in the kernel tree.

> 
> > 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?
> 


The 3.02.18 driver and the driver in kernel tree are totally different
drivers.
One thing is 3.02.18 has SAS support, and the kernel tree doesn't.    Id
wish
kernel folks would take our SAS drivers.

Eric Moore

^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion
@ 2005-07-12 22:34 Moore, Eric Dean
  0 siblings, 0 replies; 18+ messages in thread
From: Moore, Eric Dean @ 2005-07-12 22:34 UTC (permalink / raw)
  To: David S. Miller
  Cc: tduffy, olh, akpm, linux-kernel, James.Bottomley, linux-scsi

> > But Id rather have same files in our maintained driver,
> > and whats in the kernel tree.
> 
> Just think what a mess we'd have on our hands if we let
> everyone do that.  Sorry, please don't put compat header
> files into the current upstream tree, thanks.
>

Fine. 

^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion
@ 2005-07-13 15:11 Moore, Eric Dean
  0 siblings, 0 replies; 18+ messages in thread
From: Moore, Eric Dean @ 2005-07-13 15:11 UTC (permalink / raw)
  To: Christoph Hellwig, Matt Domsch
  Cc: Moore, Eric Dean, Olaf Hering, Andrew Morton, linux-kernel,
	James Bottomley, linux-scsi

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


^ permalink raw reply	[flat|nested] 18+ messages in thread
* RE: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion
@ 2005-07-20  0:07 Moore, Eric Dean
  2005-07-20  3:12 ` Matt Domsch
  2005-07-20 17:55 ` Nish Aravamudan
  0 siblings, 2 replies; 18+ messages in thread
From: Moore, Eric Dean @ 2005-07-20  0:07 UTC (permalink / raw)
  To: Matt Domsch
  Cc: Olaf Hering, Andrew Morton, linux-kernel, James Bottomley,
	linux-scsi

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




^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2005-07-20 18:22 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-11  0:15 [PATCH 22/82] remove linux/version.h from drivers/message/fus ion Moore, Eric Dean
2005-07-12 20:30 ` Tom Duffy
2005-07-13  2:16 ` Matt Domsch
2005-07-13 14:37   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
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-12 22:34 Moore, Eric Dean
2005-07-13 15:11 Moore, Eric Dean
2005-07-20  0:07 Moore, Eric Dean
2005-07-20  3:12 ` Matt Domsch
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox