Re: [PATCH 15/39] scsi: add get_{status,host}_byte() accessor function

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

 



On 4/23/21 4:39 AM, Hannes Reinecke wrote:
> +static inline unsigned char get_status_byte(struct scsi_cmnd *cmd)
> +{
> +	return cmd->result & 0xff;
> +}
> +
>  static inline void set_msg_byte(struct scsi_cmnd *cmd, char status)
>  {
>  	cmd->result = (cmd->result & 0xffff00ff) | (status << 8);
> @@ -326,6 +331,11 @@ static inline void set_host_byte(struct scsi_cmnd *cmd, char status)
>  	cmd->result = (cmd->result & 0xff00ffff) | (status << 16);
>  }
>  
> +static inline unsigned char get_host_byte(struct scsi_cmnd *cmd)
> +{
> +	return (cmd->result >> 16) & 0xff;
> +}

How about using 'u8' instead of 'unsigned char' to make it more clear
that the returned value is an integer instead of a character? Anyway:

Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>



[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