Re: [PATCH 11/25] scsi: move get_scsi_ml_byte() to scsi_priv.h

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

 



On 12/8/22 4:59 AM, Niklas Cassel wrote:
> Move get_scsi_ml_byte() to scsi_priv.h since both scsi_lib.c and
> scsi_error.c will need to use this helper in a follow-up patch.
> 
> Signed-off-by: Niklas Cassel <niklas.cassel@xxxxxxx>
> ---
>  drivers/scsi/scsi_lib.c  | 5 -----
>  drivers/scsi/scsi_priv.h | 5 +++++
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index 9ed1ebcb7443..d243ebc5ad54 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -579,11 +579,6 @@ static bool scsi_end_request(struct request *req, blk_status_t error,
>  	return false;
>  }
>  
> -static inline u8 get_scsi_ml_byte(int result)
> -{
> -	return (result >> 8) & 0xff;
> -}
> -
>  /**
>   * scsi_result_to_blk_status - translate a SCSI result code into blk_status_t
>   * @result:	scsi error code
> diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
> index 96284a0e13fe..4f97e126c6fb 100644
> --- a/drivers/scsi/scsi_priv.h
> +++ b/drivers/scsi/scsi_priv.h
> @@ -29,6 +29,11 @@ enum scsi_ml_status {
>  	SCSIML_STAT_TGT_FAILURE		= 0x04,	/* Permanent target failure */
>  };
>  
> +static inline u8 get_scsi_ml_byte(int result)
> +{
> +	return (result >> 8) & 0xff;
> +}
> +

I made a mistake in the naming of this function. The get_* functions take a
scsi_cmnd. The ones without the "get_" prefix take the scsi_cmnd->result.

Could you rename it to scsi_ml_byte() when you move it so the mistake does not
get used in multiple places?






[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