diff options
author | Hannes Reinecke <hare@suse.de> | 2014-10-24 08:26:52 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-12 05:16:01 -0500 |
commit | 4753cbc0a1286a60d2f859a7056f8e4873f494c8 (patch) | |
tree | e2cc77143603f22653a7fc1c7873f0ab67cc5d42 /drivers/scsi/scsi_error.c | |
parent | 15c75f8a6d570e1d22594fe7f1cdb45360651a60 (diff) |
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>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r-- | drivers/scsi/scsi_error.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 0084f0b21a91..ab570f5cb6bb 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -2422,20 +2422,20 @@ EXPORT_SYMBOL(scsi_reset_provider); | |||
2422 | * responded to a SCSI command with the CHECK_CONDITION status. | 2422 | * responded to a SCSI command with the CHECK_CONDITION status. |
2423 | * | 2423 | * |
2424 | * Return value: | 2424 | * Return value: |
2425 | * 1 if valid sense data information found, else 0; | 2425 | * true if valid sense data information found, else false; |
2426 | */ | 2426 | */ |
2427 | int scsi_normalize_sense(const u8 *sense_buffer, int sb_len, | 2427 | bool scsi_normalize_sense(const u8 *sense_buffer, int sb_len, |
2428 | struct scsi_sense_hdr *sshdr) | 2428 | struct scsi_sense_hdr *sshdr) |
2429 | { | 2429 | { |
2430 | if (!sense_buffer || !sb_len) | 2430 | if (!sense_buffer || !sb_len) |
2431 | return 0; | 2431 | return false; |
2432 | 2432 | ||
2433 | memset(sshdr, 0, sizeof(struct scsi_sense_hdr)); | 2433 | memset(sshdr, 0, sizeof(struct scsi_sense_hdr)); |
2434 | 2434 | ||
2435 | sshdr->response_code = (sense_buffer[0] & 0x7f); | 2435 | sshdr->response_code = (sense_buffer[0] & 0x7f); |
2436 | 2436 | ||
2437 | if (!scsi_sense_valid(sshdr)) | 2437 | if (!scsi_sense_valid(sshdr)) |
2438 | return 0; | 2438 | return false; |
2439 | 2439 | ||
2440 | if (sshdr->response_code >= 0x72) { | 2440 | if (sshdr->response_code >= 0x72) { |
2441 | /* | 2441 | /* |
@@ -2465,12 +2465,12 @@ int scsi_normalize_sense(const u8 *sense_buffer, int sb_len, | |||
2465 | } | 2465 | } |
2466 | } | 2466 | } |
2467 | 2467 | ||
2468 | return 1; | 2468 | return true; |
2469 | } | 2469 | } |
2470 | EXPORT_SYMBOL(scsi_normalize_sense); | 2470 | EXPORT_SYMBOL(scsi_normalize_sense); |
2471 | 2471 | ||
2472 | int scsi_command_normalize_sense(struct scsi_cmnd *cmd, | 2472 | bool scsi_command_normalize_sense(const struct scsi_cmnd *cmd, |
2473 | struct scsi_sense_hdr *sshdr) | 2473 | struct scsi_sense_hdr *sshdr) |
2474 | { | 2474 | { |
2475 | return scsi_normalize_sense(cmd->sense_buffer, | 2475 | return scsi_normalize_sense(cmd->sense_buffer, |
2476 | SCSI_SENSE_BUFFERSIZE, sshdr); | 2476 | SCSI_SENSE_BUFFERSIZE, sshdr); |