* [PATCH] scsi.h uses "u8" which isn't defined.
@ 2003-08-17 12:42 Dominik Strasser
2003-08-17 12:46 ` Christoph Hellwig
2003-08-17 12:55 ` Muli Ben-Yehuda
0 siblings, 2 replies; 7+ messages in thread
From: Dominik Strasser @ 2003-08-17 12:42 UTC (permalink / raw)
To: linux-kernel
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi.h uses "u8" which isn't defined.
2003-08-17 12:42 [PATCH] scsi.h uses "u8" which isn't defined Dominik Strasser
@ 2003-08-17 12:46 ` Christoph Hellwig
2003-08-17 13:08 ` Dominik Strasser
2003-08-17 12:55 ` Muli Ben-Yehuda
1 sibling, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2003-08-17 12:46 UTC (permalink / raw)
To: Dominik Strasser; +Cc: linux-kernel
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi.h uses "u8" which isn't defined.
2003-08-17 12:42 [PATCH] scsi.h uses "u8" which isn't defined Dominik Strasser
2003-08-17 12:46 ` Christoph Hellwig
@ 2003-08-17 12:55 ` Muli Ben-Yehuda
1 sibling, 0 replies; 7+ messages in thread
From: Muli Ben-Yehuda @ 2003-08-17 12:55 UTC (permalink / raw)
To: Dominik Strasser; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]
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
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi.h uses "u8" which isn't defined.
2003-08-17 13:08 ` Dominik Strasser
@ 2003-08-17 13:07 ` Christoph Hellwig
2003-08-17 13:50 ` Dominik Strasser
2003-08-17 13:07 ` Muli Ben-Yehuda
1 sibling, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2003-08-17 13:07 UTC (permalink / raw)
To: Dominik Strasser; +Cc: linux-kernel
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)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi.h uses "u8" which isn't defined.
2003-08-17 13:08 ` Dominik Strasser
2003-08-17 13:07 ` Christoph Hellwig
@ 2003-08-17 13:07 ` Muli Ben-Yehuda
1 sibling, 0 replies; 7+ messages in thread
From: Muli Ben-Yehuda @ 2003-08-17 13:07 UTC (permalink / raw)
To: Dominik Strasser; +Cc: Christoph Hellwig, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 326 bytes --]
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
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi.h uses "u8" which isn't defined.
2003-08-17 12:46 ` Christoph Hellwig
@ 2003-08-17 13:08 ` Dominik Strasser
2003-08-17 13:07 ` Christoph Hellwig
2003-08-17 13:07 ` Muli Ben-Yehuda
0 siblings, 2 replies; 7+ messages in thread
From: Dominik Strasser @ 2003-08-17 13:08 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-kernel
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi.h uses "u8" which isn't defined.
2003-08-17 13:07 ` Christoph Hellwig
@ 2003-08-17 13:50 ` Dominik Strasser
0 siblings, 0 replies; 7+ messages in thread
From: Dominik Strasser @ 2003-08-17 13:50 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-kernel, Linus Torvalds
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;
};
/*
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-08-17 13:43 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-17 12:42 [PATCH] scsi.h uses "u8" which isn't defined Dominik Strasser
2003-08-17 12:46 ` Christoph Hellwig
2003-08-17 13:08 ` Dominik Strasser
2003-08-17 13:07 ` Christoph Hellwig
2003-08-17 13:50 ` Dominik Strasser
2003-08-17 13:07 ` Muli Ben-Yehuda
2003-08-17 12:55 ` Muli Ben-Yehuda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox