diff options
author | Niklas Cassel <niklas.cassel@wdc.com> | 2023-05-11 03:13:38 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2023-05-22 23:05:19 +0200 |
commit | 734326937b65cec7ffd00bfbbce0f791ac4aac84 (patch) | |
tree | e9d2399a99fc5ecbacb93ee72968afcebcdfccc0 /drivers/scsi/scsi_priv.h | |
parent | scsi: core: Allow libata to complete successful commands via EH (diff) | |
download | linux-734326937b65cec7ffd00bfbbce0f791ac4aac84.tar.xz linux-734326937b65cec7ffd00bfbbce0f791ac4aac84.zip |
scsi: core: Rename and move get_scsi_ml_byte()
SCSI has two different getters:
- get_XXX_byte() (in scsi_cmnd.h) which takes a struct scsi_cmnd *, and
- XXX_byte() (in scsi.h) which takes a scmd->result.
The proper name for get_scsi_ml_byte() should thus be without the get_
prefix, as it takes a scmd->result. Rename the function to rectify this.
(This change was suggested by Mike Christie.)
Additionally, 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.
Cc: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20230511011356.227789-6-nks@flawful.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_priv.h')
-rw-r--r-- | drivers/scsi/scsi_priv.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index 96284a0e13fe..74324fba4281 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 scsi_ml_byte(int result) +{ + return (result >> 8) & 0xff; +} + /* * Scsi Error Handler Flags */ |