scsi: use 'bool' as return value for scsi_normalize_sense()

Convert scsi_normalize_sense() and friends to return 'bool'
instead of an integer.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Robert Elliott <elliott@hp.com>
Reviewed-by: Yoshihiro Yunomae <yoshihiro.yunomae.ez@hitachi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Hannes Reinecke
2014-10-24 14:26:52 +02:00
committed by Christoph Hellwig
parent 15c75f8a6d
commit 4753cbc0a1
3 changed files with 16 additions and 16 deletions

View File

@@ -2422,20 +2422,20 @@ EXPORT_SYMBOL(scsi_reset_provider);
* responded to a SCSI command with the CHECK_CONDITION status.
*
* Return value:
* 1 if valid sense data information found, else 0;
* true if valid sense data information found, else false;
*/
int scsi_normalize_sense(const u8 *sense_buffer, int sb_len,
struct scsi_sense_hdr *sshdr)
bool scsi_normalize_sense(const u8 *sense_buffer, int sb_len,
struct scsi_sense_hdr *sshdr)
{
if (!sense_buffer || !sb_len)
return 0;
return false;
memset(sshdr, 0, sizeof(struct scsi_sense_hdr));
sshdr->response_code = (sense_buffer[0] & 0x7f);
if (!scsi_sense_valid(sshdr))
return 0;
return false;
if (sshdr->response_code >= 0x72) {
/*
@@ -2465,12 +2465,12 @@ int scsi_normalize_sense(const u8 *sense_buffer, int sb_len,
}
}
return 1;
return true;
}
EXPORT_SYMBOL(scsi_normalize_sense);
int scsi_command_normalize_sense(struct scsi_cmnd *cmd,
struct scsi_sense_hdr *sshdr)
bool scsi_command_normalize_sense(const struct scsi_cmnd *cmd,
struct scsi_sense_hdr *sshdr)
{
return scsi_normalize_sense(cmd->sense_buffer,
SCSI_SENSE_BUFFERSIZE, sshdr);