diff options
author | Bart Van Assche <bvanassche@acm.org> | 2019-08-08 20:02:14 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-08-12 21:34:09 -0400 |
commit | 724361921f65a40ae5b80641dc1e92c0ff314d89 (patch) | |
tree | fe3b84c6525370760dab2895a2549ac58104cec9 /drivers/scsi/qla2xxx/qla_def.h | |
parent | 1a20719e074ada3e6d06ee065afd527779a6793b (diff) |
scsi: qla2xxx: Report invalid mailbox status codes
It is easy to mix up the QLA_* and the MBS_* status codes. Complain loudly
if that happens.
Cc: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_def.h')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 527b2a2708a1..556376ce0259 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -990,6 +990,11 @@ struct mbx_cmd_32 { #define MBS_LINK_DOWN_ERROR 0x400B #define MBS_DIAG_ECHO_TEST_ERROR 0x400C +static inline bool qla2xxx_is_valid_mbs(unsigned int mbs) +{ + return MBS_COMMAND_COMPLETE <= mbs && mbs <= MBS_DIAG_ECHO_TEST_ERROR; +} + /* * ISP mailbox asynchronous event status codes */ |