diff mbox series

[10/24] scsi: introduce set_status_byte()

Message ID 20191031110452.73463-11-hare@suse.de (mailing list archive)
State Superseded
Headers show
Series Revamp SCSI result values | expand

Commit Message

Hannes Reinecke Oct. 31, 2019, 11:04 a.m. UTC
To be in-line with the other set_XX_byte() functions.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 include/scsi/scsi_cmnd.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Bart Van Assche Nov. 1, 2019, 4:36 p.m. UTC | #1
On 10/31/19 4:04 AM, Hannes Reinecke wrote:
> To be in-line with the other set_XX_byte() functions.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
diff mbox series

Patch

diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 91bd749a02f7..6932d91472d5 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -307,6 +307,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);