: Fix userspace warning in /usr/include/scsi/scsi.h
PATCH 1/1 : Fix userspace warning in /usr/include/scsi/scsi.h
Fixes warning:
/usr/include/scsi/scsi.h:168: userspace cannot call function or variable defined in the kernel
Signed-off-by Prarit Bhargava <[email protected]>
include/scsi/scsi.h +4 -0
@@ -165,6 +165,7 @@ 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 ];#define COMMAND_SIZE (opcode) scsi_command_size_tbl[((opcode) >> 5) & 7]
@@ -174,6 +175,7 @@ scsi_command_size(const unsigned char *cmnd)return (cmnd[0 ] ==VARIABLE_LENGTH_CMD ) ? scsi_varlen_cdb_length(cmnd) : COMMAND_SIZE(cmnd[0]); } +#endif /* __KERNEL__ */ /* * SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft
@@ -290,8 +292,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 /* __KERNEL__ */ /* * standard mode-select header prepended to all mode-select commands