Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Jeff Garzik and committed by
David S. Miller
ac019360 166d2f6a

+4 -16
+1 -4
drivers/bluetooth/bluecard_cs.c
··· 503 503 unsigned int iobase; 504 504 unsigned char reg; 505 505 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); 510 507 511 508 if (!test_bit(CARD_READY, &(info->hw_state))) 512 509 return IRQ_HANDLED;
+1 -4
drivers/bluetooth/bt3c_cs.c
··· 344 344 unsigned int iobase; 345 345 int iir; 346 346 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); 351 348 352 349 iobase = info->p_dev->io.BasePort1; 353 350
+1 -4
drivers/bluetooth/btuart_cs.c
··· 294 294 int boguscount = 0; 295 295 int iir, lsr; 296 296 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); 301 298 302 299 iobase = info->p_dev->io.BasePort1; 303 300
+1 -4
drivers/bluetooth/dtl1_cs.c
··· 298 298 int boguscount = 0; 299 299 int iir, lsr; 300 300 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); 305 302 306 303 iobase = info->p_dev->io.BasePort1; 307 304