aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_error.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2014-10-24 08:26:52 -0400
committerChristoph Hellwig <hch@lst.de>2014-11-12 05:16:01 -0500
commit4753cbc0a1286a60d2f859a7056f8e4873f494c8 (patch)
treee2cc77143603f22653a7fc1c7873f0ab67cc5d42 /drivers/scsi/scsi_error.c
parent15c75f8a6d570e1d22594fe7f1cdb45360651a60 (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.c16
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 */
2427int scsi_normalize_sense(const u8 *sense_buffer, int sb_len, 2427bool 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}
2470EXPORT_SYMBOL(scsi_normalize_sense); 2470EXPORT_SYMBOL(scsi_normalize_sense);
2471 2471
2472int scsi_command_normalize_sense(struct scsi_cmnd *cmd, 2472bool 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);