From 4c701096002fff540d9ddb3b21398c551ac3af78 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 4 Oct 2017 23:01:32 +0900 Subject: tree-wide: use IN_SET macro (#6977) --- src/udev/scsi_id/scsi_serial.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/udev/scsi_id/scsi_serial.c') diff --git a/src/udev/scsi_id/scsi_serial.c b/src/udev/scsi_id/scsi_serial.c index f007cc6001..b56a541f78 100644 --- a/src/udev/scsi_id/scsi_serial.c +++ b/src/udev/scsi_id/scsi_serial.c @@ -115,9 +115,8 @@ static int sg_err_category_new(struct udev *udev, 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; @@ -143,9 +142,7 @@ static int sg_err_category_new(struct udev *udev, 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) { @@ -215,7 +212,7 @@ static int scsi_dump_sense(struct udev *udev, 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) { /* @@ -227,7 +224,7 @@ static int scsi_dump_sense(struct udev *udev, } 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]; -- cgit v1.2.1