scsi: core: Add 'set_status_byte()' accessor
authorHannes Reinecke <hare@suse.de>
Wed, 13 Jan 2021 09:04:52 +0000 (10:04 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 23 Jan 2021 02:14:11 +0000 (21:14 -0500)
Add the missing 'set_status_byte()' accessor function.

Link: https://lore.kernel.org/r/20210113090500.129644-28-hare@suse.de
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
include/scsi/scsi_cmnd.h

index 69ade4f..ace15b5 100644 (file)
@@ -308,6 +308,11 @@ static inline struct scsi_data_buffer *scsi_prot(struct scsi_cmnd *cmd)
 #define scsi_for_each_prot_sg(cmd, sg, nseg, __i)              \
        for_each_sg(scsi_prot_sglist(cmd), sg, nseg, __i)
 
+static inline void set_status_byte(struct scsi_cmnd *cmd, char status)
+{
+       cmd->result = (cmd->result & 0xffffff00) | status;
+}
+
 static inline void set_msg_byte(struct scsi_cmnd *cmd, char status)
 {
        cmd->result = (cmd->result & 0xffff00ff) | (status << 8);