Skip to content

Commit ac01936

Browse files
Jeff GarzikDavid S. Miller
authored andcommitted
[Bluetooth] Eliminate checks for impossible conditions in IRQ handler
Our info structure and info->hdev is always passed to the IRQ handler, so we don't have to worry about these checks in every interrupt. Leave a BUG_ON() just to help unwary programmers, but these could probably be removed as well. Signed-off-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent 166d2f6 commit ac01936

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

drivers/bluetooth/bluecard_cs.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,10 +503,7 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst)
503503
unsigned int iobase;
504504
unsigned char reg;
505505

506-
if (!info || !info->hdev) {
507-
BT_ERR("Call of irq %d for unknown device", irq);
508-
return IRQ_NONE;
509-
}
506+
BUG_ON(!info->hdev);
510507

511508
if (!test_bit(CARD_READY, &(info->hw_state)))
512509
return IRQ_HANDLED;

drivers/bluetooth/bt3c_cs.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,7 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst)
344344
unsigned int iobase;
345345
int iir;
346346

347-
if (!info || !info->hdev) {
348-
BT_ERR("Call of irq %d for unknown device", irq);
349-
return IRQ_NONE;
350-
}
347+
BUG_ON(!info->hdev);
351348

352349
iobase = info->p_dev->io.BasePort1;
353350

drivers/bluetooth/btuart_cs.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,7 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst)
294294
int boguscount = 0;
295295
int iir, lsr;
296296

297-
if (!info || !info->hdev) {
298-
BT_ERR("Call of irq %d for unknown device", irq);
299-
return IRQ_NONE;
300-
}
297+
BUG_ON(!info->hdev);
301298

302299
iobase = info->p_dev->io.BasePort1;
303300

drivers/bluetooth/dtl1_cs.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,7 @@ static irqreturn_t dtl1_interrupt(int irq, void *dev_inst)
298298
int boguscount = 0;
299299
int iir, lsr;
300300

301-
if (!info || !info->hdev) {
302-
BT_ERR("Call of irq %d for unknown device", irq);
303-
return IRQ_NONE;
304-
}
301+
BUG_ON(!info->hdev);
305302

306303
iobase = info->p_dev->io.BasePort1;
307304

0 commit comments

Comments
 (0)