public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SCSI: userspace cannot use scsi_command_size_tbl, COMMAND_SIZE and scsi_device_type
@ 2009-06-27 17:05 Jaswinder Singh Rajput
  2009-06-27 17:27 ` James Bottomley
  2009-06-28  7:56 ` Boaz Harrosh
  0 siblings, 2 replies; 12+ messages in thread
From: Jaswinder Singh Rajput @ 2009-06-27 17:05 UTC (permalink / raw)
  To: James Bottomley, Sam Ravnborg, Boaz Harrosh, Benny Halevy, LKML


userspace cannot use scsi_command_size_tbl, COMMAND_SIZE
and scsi_device_type defined in kernel

fix the following 'make headers_check' warnings:

  usr/include/scsi/scsi.h:159: userspace cannot call function or variable defined in the kernel
  usr/include/scsi/scsi.h:285: userspace cannot call function or variable defined in the kernel

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
 include/scsi/scsi.h |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 084478e..7ba5acf 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -156,9 +156,6 @@ scsi_varlen_cdb_length(const void *hdr)
 	return ((struct scsi_varlen_cdb_hdr *)hdr)->additional_cdb_length + 8;
 }
 
-extern const unsigned char scsi_command_size_tbl[8];
-#define COMMAND_SIZE(opcode) scsi_command_size_tbl[((opcode) >> 5) & 7]
-
 static inline unsigned
 scsi_command_size(const unsigned char *cmnd)
 {
@@ -166,6 +163,13 @@ scsi_command_size(const unsigned char *cmnd)
 		scsi_varlen_cdb_length(cmnd) : COMMAND_SIZE(cmnd[0]);
 }
 
+#ifdef __KERNEL__
+extern const unsigned char scsi_command_size_tbl[8];
+#define COMMAND_SIZE(opcode) scsi_command_size_tbl[((opcode) >> 5) & 7]
+
+/* Returns a human-readable name for the device */
+extern const char * scsi_device_type(unsigned type);
+#endif
 /*
  *  SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft
  *  T10/1561-D Revision 4 Draft dated 7th November 2002.
@@ -281,9 +285,6 @@ enum scsi_protocol {
 	SCSI_PROTOCOL_UNSPEC = 0xf, /* No specific protocol */
 };
 
-/* Returns a human-readable name for the device */
-extern const char * scsi_device_type(unsigned type);
-
 /*
  * standard mode-select header prepended to all mode-select commands
  */
-- 
1.6.0.6




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

end of thread, other threads:[~2009-07-02 14:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-27 17:05 [PATCH] SCSI: userspace cannot use scsi_command_size_tbl, COMMAND_SIZE and scsi_device_type Jaswinder Singh Rajput
2009-06-27 17:27 ` James Bottomley
2009-06-27 17:56   ` Jaswinder Singh Rajput
2009-06-27 18:28     ` Matthew Wilcox
2009-06-27 18:40       ` Jaswinder Singh Rajput
2009-06-28 13:52         ` James Bottomley
2009-06-28 14:09           ` Boaz Harrosh
2009-07-02 14:41     ` Jaswinder Singh Rajput
2009-06-28  7:56 ` Boaz Harrosh
2009-06-28 14:32   ` James Smart
2009-06-28 14:44     ` James Bottomley
2009-06-28 16:00     ` Boaz Harrosh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox