From: Dave Jones <davej@redhat.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH] Don't export scsi kernel variables in userspace headers.
Date: Fri, 24 Jul 2009 22:10:26 -0400 [thread overview]
Message-ID: <20090725021026.GA6942@redhat.com> (raw)
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
next reply other threads:[~2009-07-25 2:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-25 2:10 Dave Jones [this message]
2009-07-26 22:14 ` [PATCH] Don't export scsi kernel variables in userspace headers Matthew Wilcox
2009-07-27 7:44 ` Christoph Hellwig
2009-07-27 8:26 ` Sam Ravnborg
2009-07-27 8:37 ` Boaz Harrosh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090725021026.GA6942@redhat.com \
--to=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.