if (!scsi_status && !host_status && !driver_status)
return SG_ERR_CAT_CLEAN;
- if ((scsi_status == SCSI_CHECK_CONDITION) ||
- (scsi_status == SCSI_COMMAND_TERMINATED) ||
- ((driver_status & 0xf) == DRIVER_SENSE)) {
+ if (IN_SET(scsi_status, SCSI_CHECK_CONDITION, SCSI_COMMAND_TERMINATED) ||
+ (driver_status & 0xf) == DRIVER_SENSE) {
if (sense_buffer && (sb_len > 2)) {
int sense_key;
unsigned char asc;
return SG_ERR_CAT_SENSE;
}
if (host_status) {
- if ((host_status == DID_NO_CONNECT) ||
- (host_status == DID_BUS_BUSY) ||
- (host_status == DID_TIME_OUT))
+ if (IN_SET(host_status, DID_NO_CONNECT, DID_BUS_BUSY, DID_TIME_OUT))
return SG_ERR_CAT_TIMEOUT;
}
if (driver_status) {
dev_scsi->kernel, sb_len, s - sb_len);
return -1;
}
- if ((code == 0x0) || (code == 0x1)) {
+ if (IN_SET(code, 0x0, 0x1)) {
sense_key = sense_buffer[2] & 0xf;
if (s < 14) {
/*
}
asc = sense_buffer[12];
ascq = sense_buffer[13];
- } else if ((code == 0x2) || (code == 0x3)) {
+ } else if (IN_SET(code, 0x2, 0x3)) {
sense_key = sense_buffer[1] & 0xf;
asc = sense_buffer[2];
ascq = sense_buffer[3];