All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Moore, Eric Moore" <Eric.Moore@lsil.com>
To: Matt Domsch <Matt_Domsch@dell.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 23:09:00 -0600	[thread overview]
Message-ID: <001a01c58ce9$24e31e60$171015ac@ericmoore> (raw)
In-Reply-To: 20050720031249.GA18042@humbolt.us.dell.com

[-- Attachment #1: Type: text/plain, Size: 875 bytes --]

On Tuesday, July 19, 2005 9:12 PM, 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.
>

No its not compiling for me.
I'm currently building drivers for the DELL DKMS kit.
Trying to add support for SLES9 SP2 support ( -191 kernel).
My driver compiles for SLES9 Base(-97) and SP2(-139) but fails for SP2.
Between SP1 and SP2, they added msleep.

Here is the make.log output that you will find in 
/var/lib/dkms/mptlinux/3.02.52/build
when it fails to compile.

Also attached is linux_compat.h with the changes you have suggested.





[-- Attachment #2: linux_compat.h --]
[-- Type: application/octet-stream, Size: 3477 bytes --]

/* drivers/message/fusion/linux_compat.h */

#ifndef FUSION_LINUX_COMPAT_H
#define FUSION_LINUX_COMPAT_H

#include <linux/version.h>
#include <linux/sched.h>
#include <linux/jiffies.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_cmnd.h>

/* scsi_print_command() came in lk 2.6.8 kernel,
 * prior kernels it was called print_Scsi_Cmnd()
 */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8))
extern void print_Scsi_Cmnd(struct scsi_cmnd *cmd);
#else
extern void scsi_print_command(struct scsi_cmnd *cmd);
#endif
static void inline mptscsih_scsi_print_command(struct scsi_cmnd *cmd){
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8))
	print_Scsi_Cmnd(cmd);
#else
	scsi_print_command(cmd);
#endif
}

/* define scsi_device_online which came in lk 2.6.6,
 * to be backward compatible to older variants of lk 2.6
 */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,6))
static int inline scsi_device_online(struct scsi_device *sdev)
{
	return sdev->online;
}
#endif

/* define msleep, msleep_interruptible which came in lk 2.6.8
 * to be backward compatible to older variants of lk 2.6
 */
#ifndef msecs_to_jiffies
static inline unsigned long msecs_to_jiffies(const unsigned int m)
{
#if HZ <= 1000 && !(1000 % HZ)
        return (m + (1000 / HZ) - 1) / (1000 / HZ);
#elif HZ > 1000 && !(HZ % 1000)
        return m * (HZ / 1000);
#else
        return (m * HZ + 999) / 1000;
#endif
}
#endif

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

/* define __iomem which came in lk 2.6.9
 * to be backward compatible to older variants of lk 2.6
 */
#ifndef __iomem
#define __iomem
#endif

/* define pm_message_t which came in lk 2.6.11
 * to be backward compatible to older variants of lk 2.6
 */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11))
typedef u32 pm_message_t;
#endif

/* exporting of pci_disable_msi which came in lk 2.6.8
 * to be backward compatible to older variants of lk 2.6
 */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8))
static inline void pci_disable_msi(struct pci_dev* dev) {}
#endif

/* defines for SAS controlers, to be eventually added to inlcude/linux/pci_ids.h
 */
#ifndef PCI_DEVICE_ID_LSI_SAS1064
#define PCI_DEVICE_ID_LSI_SAS1064	(0x0050)
#endif

#ifndef PCI_DEVICE_ID_LSI_SAS1066
#define PCI_DEVICE_ID_LSI_SAS1066	(0x005E)
#endif

#ifndef PCI_DEVICE_ID_LSI_SAS1068
#define PCI_DEVICE_ID_LSI_SAS1068	(0x0054)
#endif

#ifndef PCI_DEVICE_ID_LSI_SAS1064A
#define PCI_DEVICE_ID_LSI_SAS1064A	(0x005C)
#endif

#ifndef PCI_DEVICE_ID_LSI_SAS1064E
#define PCI_DEVICE_ID_LSI_SAS1064E	(0x0056)
#endif

#ifndef PCI_DEVICE_ID_LSI_SAS1066E
#define PCI_DEVICE_ID_LSI_SAS1066E	(0x005A)
#endif

#ifndef PCI_DEVICE_ID_LSI_SAS1068E
#define PCI_DEVICE_ID_LSI_SAS1068E	(0x0058)
#endif

#ifndef PCI_DEVICE_ID_LSI_FC939X
#define PCI_DEVICE_ID_LSI_FC939X	(0x0642)
#endif

#ifndef PCI_DEVICE_ID_LSI_FC949X
#define PCI_DEVICE_ID_LSI_FC949X	(0x0640)
#endif

/*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#endif /* _LINUX_COMPAT_H */

[-- Attachment #3: make.log --]
[-- Type: application/octet-stream, Size: 1488 bytes --]

DKMS make.log for mptlinux-3.02.52 for kernel 2.6.5-7.191-smp (i586)
Tue Jul 19 22:42:47 MDT 2005
make: Entering directory `/usr/src/linux-2.6.5-7.191-obj/i386/smp'
make -C /usr/src/linux-2.6.5-7.191 O=/usr/src/linux-2.6.5-7.191-obj/i386/smp modules

WARNING: Symbol version dump /usr/src/linux-2.6.5-7.191-obj/i386/smp/Module.symvers is  missing, modules will have CONFIG_MODVERSIONS disabled.

  CC [M]  /var/lib/dkms/mptlinux/3.02.52/build/mptbase.o
In file included from /var/lib/dkms/mptlinux/3.02.52/build/mptbase.h:58,
                 from /var/lib/dkms/mptlinux/3.02.52/build/mptbase.c:71:
/var/lib/dkms/mptlinux/3.02.52/build/linux_compat.h:45: error: redefinition of `msecs_to_jiffies'
/usr/src/linux-2.6.5-7.191/include/linux/jiffies.h:96: error: `msecs_to_jiffies' previously defined here
/var/lib/dkms/mptlinux/3.02.52/build/linux_compat.h:58: error: conflicting types for `msleep'
/usr/src/linux-2.6.5-7.191/include/linux/delay.h:41: error: previous declaration of `msleep'
/var/lib/dkms/mptlinux/3.02.52/build/linux_compat.h:65: error: conflicting types for `msleep_interruptible'
/usr/src/linux-2.6.5-7.191/include/linux/delay.h:42: error: previous declaration of `msleep_interruptible'
make[3]: *** [/var/lib/dkms/mptlinux/3.02.52/build/mptbase.o] Error 1
make[2]: *** [_module_/var/lib/dkms/mptlinux/3.02.52/build] Error 2
make[1]: *** [modules] Error 2
make: *** [modules] Error 2
make: Leaving directory `/usr/src/linux-2.6.5-7.191-obj/i386/smp'

WARNING: multiple messages have this Message-ID (diff)
From: "Moore, Eric Moore" <Eric.Moore@lsil.com>
To: "Matt Domsch" <Matt_Domsch@dell.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 23:09:00 -0600	[thread overview]
Message-ID: <001a01c58ce9$24e31e60$171015ac@ericmoore> (raw)
In-Reply-To: 20050720031249.GA18042@humbolt.us.dell.com

[-- Attachment #1: Type: text/plain, Size: 875 bytes --]

On Tuesday, July 19, 2005 9:12 PM, 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.
>

No its not compiling for me.
I'm currently building drivers for the DELL DKMS kit.
Trying to add support for SLES9 SP2 support ( -191 kernel).
My driver compiles for SLES9 Base(-97) and SP2(-139) but fails for SP2.
Between SP1 and SP2, they added msleep.

Here is the make.log output that you will find in 
/var/lib/dkms/mptlinux/3.02.52/build
when it fails to compile.

Also attached is linux_compat.h with the changes you have suggested.





[-- Attachment #2: linux_compat.h --]
[-- Type: application/octet-stream, Size: 3477 bytes --]

/* drivers/message/fusion/linux_compat.h */

#ifndef FUSION_LINUX_COMPAT_H
#define FUSION_LINUX_COMPAT_H

#include <linux/version.h>
#include <linux/sched.h>
#include <linux/jiffies.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_cmnd.h>

/* scsi_print_command() came in lk 2.6.8 kernel,
 * prior kernels it was called print_Scsi_Cmnd()
 */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8))
extern void print_Scsi_Cmnd(struct scsi_cmnd *cmd);
#else
extern void scsi_print_command(struct scsi_cmnd *cmd);
#endif
static void inline mptscsih_scsi_print_command(struct scsi_cmnd *cmd){
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8))
	print_Scsi_Cmnd(cmd);
#else
	scsi_print_command(cmd);
#endif
}

/* define scsi_device_online which came in lk 2.6.6,
 * to be backward compatible to older variants of lk 2.6
 */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,6))
static int inline scsi_device_online(struct scsi_device *sdev)
{
	return sdev->online;
}
#endif

/* define msleep, msleep_interruptible which came in lk 2.6.8
 * to be backward compatible to older variants of lk 2.6
 */
#ifndef msecs_to_jiffies
static inline unsigned long msecs_to_jiffies(const unsigned int m)
{
#if HZ <= 1000 && !(1000 % HZ)
        return (m + (1000 / HZ) - 1) / (1000 / HZ);
#elif HZ > 1000 && !(HZ % 1000)
        return m * (HZ / 1000);
#else
        return (m * HZ + 999) / 1000;
#endif
}
#endif

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

/* define __iomem which came in lk 2.6.9
 * to be backward compatible to older variants of lk 2.6
 */
#ifndef __iomem
#define __iomem
#endif

/* define pm_message_t which came in lk 2.6.11
 * to be backward compatible to older variants of lk 2.6
 */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11))
typedef u32 pm_message_t;
#endif

/* exporting of pci_disable_msi which came in lk 2.6.8
 * to be backward compatible to older variants of lk 2.6
 */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8))
static inline void pci_disable_msi(struct pci_dev* dev) {}
#endif

/* defines for SAS controlers, to be eventually added to inlcude/linux/pci_ids.h
 */
#ifndef PCI_DEVICE_ID_LSI_SAS1064
#define PCI_DEVICE_ID_LSI_SAS1064	(0x0050)
#endif

#ifndef PCI_DEVICE_ID_LSI_SAS1066
#define PCI_DEVICE_ID_LSI_SAS1066	(0x005E)
#endif

#ifndef PCI_DEVICE_ID_LSI_SAS1068
#define PCI_DEVICE_ID_LSI_SAS1068	(0x0054)
#endif

#ifndef PCI_DEVICE_ID_LSI_SAS1064A
#define PCI_DEVICE_ID_LSI_SAS1064A	(0x005C)
#endif

#ifndef PCI_DEVICE_ID_LSI_SAS1064E
#define PCI_DEVICE_ID_LSI_SAS1064E	(0x0056)
#endif

#ifndef PCI_DEVICE_ID_LSI_SAS1066E
#define PCI_DEVICE_ID_LSI_SAS1066E	(0x005A)
#endif

#ifndef PCI_DEVICE_ID_LSI_SAS1068E
#define PCI_DEVICE_ID_LSI_SAS1068E	(0x0058)
#endif

#ifndef PCI_DEVICE_ID_LSI_FC939X
#define PCI_DEVICE_ID_LSI_FC939X	(0x0642)
#endif

#ifndef PCI_DEVICE_ID_LSI_FC949X
#define PCI_DEVICE_ID_LSI_FC949X	(0x0640)
#endif

/*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#endif /* _LINUX_COMPAT_H */

[-- Attachment #3: make.log --]
[-- Type: application/octet-stream, Size: 1488 bytes --]

DKMS make.log for mptlinux-3.02.52 for kernel 2.6.5-7.191-smp (i586)
Tue Jul 19 22:42:47 MDT 2005
make: Entering directory `/usr/src/linux-2.6.5-7.191-obj/i386/smp'
make -C /usr/src/linux-2.6.5-7.191 O=/usr/src/linux-2.6.5-7.191-obj/i386/smp modules

WARNING: Symbol version dump /usr/src/linux-2.6.5-7.191-obj/i386/smp/Module.symvers is  missing, modules will have CONFIG_MODVERSIONS disabled.

  CC [M]  /var/lib/dkms/mptlinux/3.02.52/build/mptbase.o
In file included from /var/lib/dkms/mptlinux/3.02.52/build/mptbase.h:58,
                 from /var/lib/dkms/mptlinux/3.02.52/build/mptbase.c:71:
/var/lib/dkms/mptlinux/3.02.52/build/linux_compat.h:45: error: redefinition of `msecs_to_jiffies'
/usr/src/linux-2.6.5-7.191/include/linux/jiffies.h:96: error: `msecs_to_jiffies' previously defined here
/var/lib/dkms/mptlinux/3.02.52/build/linux_compat.h:58: error: conflicting types for `msleep'
/usr/src/linux-2.6.5-7.191/include/linux/delay.h:41: error: previous declaration of `msleep'
/var/lib/dkms/mptlinux/3.02.52/build/linux_compat.h:65: error: conflicting types for `msleep_interruptible'
/usr/src/linux-2.6.5-7.191/include/linux/delay.h:42: error: previous declaration of `msleep_interruptible'
make[3]: *** [/var/lib/dkms/mptlinux/3.02.52/build/mptbase.o] Error 1
make[2]: *** [_module_/var/lib/dkms/mptlinux/3.02.52/build] Error 2
make[1]: *** [modules] Error 2
make: *** [modules] Error 2
make: Leaving directory `/usr/src/linux-2.6.5-7.191-obj/i386/smp'

  parent reply	other threads:[~2005-07-20  5:09 UTC|newest]

Thread overview: 19+ 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
2005-07-20  4:28   ` Stephen Rothwell
2005-07-20  5:09   ` Moore, Eric Moore [this message]
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='001a01c58ce9$24e31e60$171015ac@ericmoore' \
    --to=eric.moore@lsil.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=Matt_Domsch@dell.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.