linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Make scsi.h nominally userspace-clean
@ 2004-08-09 17:24 Noah Misch
  2004-08-09 17:52 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Noah Misch @ 2004-08-09 17:24 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-kernel, linux-scsi, axboe, schilling

As Joerg Schilling, the author of cdrecord, has noted in threads such as

http://www.ussg.iu.edu/hypermail/linux/kernel/0309.3/1355.html and
http://www.ussg.iu.edu/hypermail/linux/kernel/0408.0/0799.html,

scsi/scsi.h does not compile cleanly in userspace programs due to its use of
``u8''.  I have confirmed this bug and prepared and tested a fix that simply
changes all such uses to ``__u8''.  Please consider for inclusion.

I do not argue that including this header file in a program is appropriate, but
other kernel headers already take as many precautions as this patch introduces.
I chose __u8 over uint8_t as more in the style of the kernel generally.

Please keep me on cc:; I do not subscribe to the lists.

Signed-off-by: Noah Misch <noah@cs.caltech.edu>
--- pristine-linux-2.6.8-rc3/include/scsi/scsi.h	2004-06-16 01:20:25.000000000 -0400
+++ zlibstack-linux-2.6.8-rc3/include/scsi/scsi.h	2004-08-09 13:03:27.386545874 -0400
@@ -214,25 +214,25 @@
  */
 
 struct ccs_modesel_head {
-	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;
+	__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;
 };
 
 /*
  * ScsiLun: 8 byte LUN.
  */
 struct scsi_lun {
-	u8 scsi_lun[8];
+	__u8 scsi_lun[8];
 };
 
 /*

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

* Re: [PATCH] Make scsi.h nominally userspace-clean
  2004-08-09 17:24 [PATCH] Make scsi.h nominally userspace-clean Noah Misch
@ 2004-08-09 17:52 ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2004-08-09 17:52 UTC (permalink / raw)
  To: Noah Misch; +Cc: James.Bottomley, linux-kernel, linux-scsi, schilling

On Mon, Aug 09 2004, Noah Misch wrote:
> As Joerg Schilling, the author of cdrecord, has noted in threads such as
> 
> http://www.ussg.iu.edu/hypermail/linux/kernel/0309.3/1355.html and
> http://www.ussg.iu.edu/hypermail/linux/kernel/0408.0/0799.html,
> 
> scsi/scsi.h does not compile cleanly in userspace programs due to its
> use of ``u8''.  I have confirmed this bug and prepared and tested a
> fix that simply changes all such uses to ``__u8''.  Please consider
> for inclusion.
> 
> I do not argue that including this header file in a program is
> appropriate, but other kernel headers already take as many precautions
> as this patch introduces.  I chose __u8 over uint8_t as more in the
> style of the kernel generally.
> 
> Please keep me on cc:; I do not subscribe to the lists.

I already sent such a patch to Linus.

-- 
Jens Axboe


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

* Re: [PATCH] Make scsi.h nominally userspace-clean
@ 2004-08-09 17:53 Joerg Schilling
  2004-08-09 17:56 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Joerg Schilling @ 2004-08-09 17:53 UTC (permalink / raw)
  To: axboe, noah; +Cc: James.Bottomley, linux-kernel, linux-scsi, schilling

>From axboe@suse.de  Mon Aug  9 19:52:11 2004

>> scsi/scsi.h does not compile cleanly in userspace programs due to its
>> use of ``u8''.  I have confirmed this bug and prepared and tested a
>> fix that simply changes all such uses to ``__u8''.  Please consider
>> for inclusion.
>> 
>> I do not argue that including this header file in a program is
>> appropriate, but other kernel headers already take as many precautions
>> as this patch introduces.  I chose __u8 over uint8_t as more in the
>> style of the kernel generally.
>> 
>> Please keep me on cc:; I do not subscribe to the lists.

>I already sent such a patch to Linus.

thank you! Did you also send a patch for sg.h to include linux/compiler.h?

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de		(uni)  If you don't have iso-8859-1
       schilling@fokus.fraunhofer.de	(work) chars I am J"org Schilling
 URL:  http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] Make scsi.h nominally userspace-clean
  2004-08-09 17:53 Joerg Schilling
@ 2004-08-09 17:56 ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2004-08-09 17:56 UTC (permalink / raw)
  To: Joerg Schilling; +Cc: noah, James.Bottomley, linux-kernel, linux-scsi

On Mon, Aug 09 2004, Joerg Schilling wrote:
> >From axboe@suse.de  Mon Aug  9 19:52:11 2004
> 
> >> scsi/scsi.h does not compile cleanly in userspace programs due to its
> >> use of ``u8''.  I have confirmed this bug and prepared and tested a
> >> fix that simply changes all such uses to ``__u8''.  Please consider
> >> for inclusion.
> >> 
> >> I do not argue that including this header file in a program is
> >> appropriate, but other kernel headers already take as many precautions
> >> as this patch introduces.  I chose __u8 over uint8_t as more in the
> >> style of the kernel generally.
> >> 
> >> Please keep me on cc:; I do not subscribe to the lists.
> 
> >I already sent such a patch to Linus.
> 
> thank you! Did you also send a patch for sg.h to include linux/compiler.h?

Yes I did.

-- 
Jens Axboe


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

end of thread, other threads:[~2004-08-09 17:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-09 17:24 [PATCH] Make scsi.h nominally userspace-clean Noah Misch
2004-08-09 17:52 ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2004-08-09 17:53 Joerg Schilling
2004-08-09 17:56 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).