public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Don't export scsi kernel variables in userspace headers.
@ 2009-07-25  2:10 Dave Jones
  2009-07-26 22:14 ` Matthew Wilcox
  2009-07-27  7:44 ` Christoph Hellwig
  0 siblings, 2 replies; 5+ messages in thread
From: Dave Jones @ 2009-07-25  2:10 UTC (permalink / raw)
  To: Linux Kernel; +Cc: linux-scsi

Found with make headers_check

/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: Dave Jones <davej@redhat.com>

diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 084478e..689570e 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -156,7 +156,9 @@ scsi_varlen_cdb_length(const void *hdr)
 	return ((struct scsi_varlen_cdb_hdr *)hdr)->additional_cdb_length + 8;
 }
 
+#ifdef __KERNEL__
 extern const unsigned char scsi_command_size_tbl[8];
+#endif
 #define COMMAND_SIZE(opcode) scsi_command_size_tbl[((opcode) >> 5) & 7]
 
 static inline unsigned
@@ -281,8 +283,10 @@ enum scsi_protocol {
 	SCSI_PROTOCOL_UNSPEC = 0xf, /* No specific protocol */
 };
 
+#ifdef __KERNEL__
 /* Returns a human-readable name for the device */
 extern const char * scsi_device_type(unsigned type);
+#endif
 
 /*
  * standard mode-select header prepended to all mode-select commands

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

end of thread, other threads:[~2009-07-27  8:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-25  2:10 [PATCH] Don't export scsi kernel variables in userspace headers Dave Jones
2009-07-26 22:14 ` Matthew Wilcox
2009-07-27  7:44 ` Christoph Hellwig
2009-07-27  8:26   ` Sam Ravnborg
2009-07-27  8:37     ` Boaz Harrosh

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