scsi/scsi.h protect scsi_to_u32 function by ifdef __KERNEL__
PATCH 1/1 scsi/scsi.h protect scsi_to_u32 function by ifdef __KERNEL__
Hi,
include/scsi/scsi.h defines scsi_to_u32 function like this:
static inline u32 scsi_to_u32(u8 *ptr)
But the definition of u8 is protected by ifdef __KERNEL__ in asm/types.h hence this whole function should be procted as well. This fixes compilation of cdrtools with latest kernel-headers GIT tree.
Signed-off-by Ismail Donmez <[email protected]>
include/scsi/scsi.h +2 -0
@@ -429,10 +429,12 @@ #define SCSI_IOCTL_GET_BUS_NUMBER 0x5386/* Used to obtain the PCI location of a device */ #define SCSI_IOCTL_GET_PCI 0x5387 +#ifdef __KERNEL__/* Pull a u32 out of a SCSI message (using BE SCSI conventions) */ static inline u32 scsi_to_u32 (u8 *ptr) {return (ptr[0 ]<<24 ) + (ptr[1 ]<<16 ) + (ptr[2 ]<<8 ) + ptr[3 ]; } +#endif #endif /* _SCSI_SCSI_H */
Forgot to cc linux-scsi list.
21 Eki 2006 Cts 13:02 tarihinde şunları yazmıştınız:
Quoted 11 lines
Hi,
include/scsi/scsi.hdefinesscsi_to_u32function like this:static inline u32
scsi_to_u32(u8 *ptr)But the definition of u8 is protected by ifdef
__KERNEL__inasm/types.hhence this whole function should be procted as well. This fixes compilation of cdrtools with latest kernel-headers GIT tree.Signed-off-by Ismail Donmez <[email protected]>
include/scsi/scsi.h +2 -0
@@ -429,10 +429,12 @@ #define SCSI_IOCTL_GET_BUS_NUMBER 0x5386/* Used to obtain the PCI location of a device */ #define SCSI_IOCTL_GET_PCI 0x5387 +#ifdef __KERNEL__/* Pull a u32 out of a SCSI message (using BE SCSI conventions) */ static inline u32 scsi_to_u32 (u8 *ptr) {return (ptr[0 ]<<24 ) + (ptr[1 ]<<16 ) + (ptr[2 ]<<8 ) + ptr[3 ]; } +#endif #endif /* _SCSI_SCSI_H */