Skip to contentSkip to conversation

comedi: remove useless else if

PATCH New Jiapeng Chong 1 participant 1 message Feb 7, 2022 Comedi drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 comedi: remove useless else if

Eliminate the follow coccicheck warning:

./drivers/comedi/drivers/das1800.c:1300:8-10: WARNING: possible condition with no effect (if == else).

---
 drivers/comedi/drivers/das1800.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/comedi/drivers/das1800.c +2 -3
index f09608c0f4ff..c4b6c68f3551 100644
@@ -1297,14 +1297,13 @@ static int das1800_attach(struct comedi_device *dev,
 			outb(DAC(i), dev->iobase + DAS1800_SELECT);
 			outw(0, dev->iobase + DAS1800_DAC);
 		}
-	} else if (board->id == DAS1800_ID_AO) {
+	} else {
 		/*
+		 * the branch includes (board->id == DAS1800_ID_AO).
 		 * 'ao' boards have waveform analog outputs that are not
 		 * currently supported.
 		 */
 		s->type		= COMEDI_SUBD_UNUSED;
-	} else {
-		s->type		= COMEDI_SUBD_UNUSED;
 	}
 
 	/* Digital Input subdevice */
Signature · 1 line
2.20.1.7.g153144c