RE: [PATCH 12/24] scsi: use 'bool' as return value for scsi_normalize_sense()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Hannes Reinecke [mailto:hare@xxxxxxx]
> Sent: Wednesday, 01 October, 2014 1:23 AM
> To: James Bottomley
> Cc: Christoph Hellwig; linux-scsi@xxxxxxxxxxxxxxx; Elliott, Robert (Server
> Storage); Hannes Reinecke
> Subject: [PATCH 12/24] scsi: use 'bool' as return value for
> scsi_normalize_sense()
> 
> Convert scsi_normalize_sense() and frieds to return 'bool'
> instead of an integer.

frieds should be friends

...
> -int scsi_command_normalize_sense(struct scsi_cmnd *cmd,
> +bool scsi_command_normalize_sense(struct scsi_cmnd *cmd,
>  				 struct scsi_sense_hdr *sshdr)

Add const for *cmd since what it points to is not
modified.  (prototype in scsi_eh.h)

...
> -static inline int scsi_sense_valid(struct scsi_sense_hdr *sshdr)
> +static inline bool scsi_sense_valid(struct scsi_sense_hdr *sshdr)
>  {
>  	if (!sshdr)
> -		return 0;
> +		return false;
> 
>  	return (sshdr->response_code & 0x70) == 0x70;
>  }

Add const to the argument, since what it points to is not
changed by this function:
	const struct scsi_sense_hdr *sshdr


> -static inline int scsi_sense_is_deferred(struct scsi_sense_hdr *sshdr)
> +static inline bool scsi_sense_is_deferred(struct scsi_sense_hdr *sshdr)
>  {
>  	return ((sshdr->response_code >= 0x70) && (sshdr->response_code & 1));
>  }

Add const to the argument, since what it points to is not
changed by this function:
	const struct scsi_sense_hdr *sshdr

(also mentioned in reply to PATCH 4)


---
Rob Elliott    HP Server Storage



--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux