scsi.h uses "u8" which doesn't seem to be defined.
Better use u_char.
--- linux/include/scsi/scsi.h 2003-08-17 14:36:02.000000000 +0200
+++ /tmp/scsi.h 2003-08-17 14:39:42.000000000 +0200
@@ -226,7 +226,7 @@
* ScsiLun: 8 byte LUN.
*/
typedef struct scsi_lun {
- u_char scsi_lun[8];
+ u8 scsi_lun[8];
} ScsiLun;
/*
Dominik
On Sun, Aug 17, 2003 at 02:42:20PM +0200, Dominik Strasser wrote:
> scsi.h uses "u8" which doesn't seem to be defined.
> Better use u_char.
It's defined in <linux/types.h> as is u_char. But we generally prefer
explicitly sized types in Linux - and u_char is a BSDism, the right
not explicitly sized type would be unsigned char.
On Sun, Aug 17, 2003 at 02:42:20PM +0200, Dominik Strasser wrote:
> scsi.h uses "u8" which doesn't seem to be defined.
> Better use u_char.
>
> --- linux/include/scsi/scsi.h 2003-08-17 14:36:02.000000000 +0200
> +++ /tmp/scsi.h 2003-08-17 14:39:42.000000000 +0200
> @@ -226,7 +226,7 @@
> * ScsiLun: 8 byte LUN.
> */
> typedef struct scsi_lun {
> - u_char scsi_lun[8];
> + u8 scsi_lun[8];
> } ScsiLun;
IMO, it's more correct to include <linux/types.h> in scsi.h, which
will bring in u8 and make scsi.h compilable on its own (provided
__KERNEL__ is defined, as it should be).
Index: include/scsi/scsi.h
===================================================================
RCS file: /home/cvs/linux-2.5/include/scsi/scsi.h,v
retrieving revision 1.10
diff -u -r1.10 scsi.h
--- include/scsi/scsi.h 13 May 2003 06:20:05 -0000 1.10
+++ include/scsi/scsi.h 17 Aug 2003 11:23:01 -0000
@@ -14,6 +14,8 @@
*/
+#include <linux/types.h>
+
/*
* SCSI command lengths
*/
--
Muli Ben-Yehuda
http://www.mulix.org
On Sun, Aug 17, 2003 at 03:08:55PM +0200, Dominik Strasser wrote:
> I am sorry, in 2.6.0-test3 (which I should have mentioned), there is no
> u8 in liux/types.h. Just a __u8.
linux/types.h brings in asm/types.h, which (at least on x86) defines
u8, ifndef __ASSEMBLY__.
--
Muli Ben-Yehuda
http://www.mulix.org
Christoph Hellwig wrote:
> On Sun, Aug 17, 2003 at 02:42:20PM +0200, Dominik Strasser wrote:
>
>>scsi.h uses "u8" which doesn't seem to be defined.
>>Better use u_char.
>
>
> It's defined in <linux/types.h> as is u_char. But we generally prefer
> explicitly sized types in Linux - and u_char is a BSDism, the right
> not explicitly sized type would be unsigned char.
I am sorry, in 2.6.0-test3 (which I should have mentioned), there is no
u8 in liux/types.h. Just a __u8.
Nevertheless there is a mixture in scsi.h, some lines above, u_char is
used. This is why I chose to use it.
Dominik
On Sun, Aug 17, 2003 at 03:08:55PM +0200, Dominik Strasser wrote:
> I am sorry, in 2.6.0-test3 (which I should have mentioned), there is no
> u8 in liux/types.h.
u8 is defined in asm/types.h but the proper way to include asm/types.h
is through linux/types.h.
> Just a __u8.
> Nevertheless there is a mixture in scsi.h, some lines above, u_char is
> used. This is why I chose to use it.
If you want consistency please convert all u_char to u8 (similar
for u_short -> u16 and u_int -> u32)
Christoph Hellwig wrote:
> On Sun, Aug 17, 2003 at 03:08:55PM +0200, Dominik Strasser wrote:
>
>>I am sorry, in 2.6.0-test3 (which I should have mentioned), there is no
>>u8 in liux/types.h.
>
>
> u8 is defined in asm/types.h but the proper way to include asm/types.h
> is through linux/types.h.
>
>
>>Just a __u8.
>>Nevertheless there is a mixture in scsi.h, some lines above, u_char is
>>used. This is why I chose to use it.
>
>
> If you want consistency please convert all u_char to u8 (similar
> for u_short -> u16 and u_int -> u32)
>
>
OK, here we go:
--- /tmp/scsi.h 2003-08-17 14:39:42.000000000 +0200
+++ include/scsi/scsi.h 2003-08-17 15:46:27.000000000 +0200
@@ -6,6 +6,8 @@
* the scsi code for linux.
*/
+#include <linux/types.h>
+
/*
$Header: /usr/src/linux/include/linux/RCS/scsi.h,v 1.3 1993/09/24
12:20:33 drew Exp $
@@ -208,18 +210,18 @@
struct ccs_modesel_head
{
- u_char _r1; /* reserved */
- u_char medium; /* device-specific medium type */
- u_char _r2; /* reserved */
- u_char block_desc_length; /* block descriptor length */
- u_char density; /* device-specific density code */
- u_char number_blocks_hi; /* number of blocks in this block desc */
- u_char number_blocks_med;
- u_char number_blocks_lo;
- u_char _r3;
- u_char block_length_hi; /* block length for blocks in this desc */
- u_char block_length_med;
- u_char block_length_lo;
+ u8 _r1; /* reserved */
+ u8 medium; /* device-specific medium type */
+ u8 _r2; /* reserved */
+ u8 block_desc_length; /* block descriptor length */
+ u8 density; /* device-specific density code */
+ u8 number_blocks_hi; /* number of blocks in this block desc */
+ u8 number_blocks_med;
+ u8 number_blocks_lo;
+ u8 _r3;
+ u8 block_length_hi; /* block length for blocks in this desc */
+ u8 block_length_med;
+ u8 block_length_lo;
};
/*