Re: [PATCH 1/2] serial: 8250: Initialize pointer to irq_info

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Thursday, August 19, 2010 - 4:43 pm

On Tue, 17 Aug 2010 09:17:20 +0100
Alan Cox <alan@linux.intel.com> wrote:


: static void serial_unlink_irq_chain(struct uart_8250_port *up)
: {
: 	struct irq_info *i;
: 	struct hlist_node *n;
: 	struct hlist_head *h;
: 
: 	mutex_lock(&hash_mutex);
: 
: 	h = &irq_lists[up->port.irq % NR_IRQ_HASH];
: 
: 	hlist_for_each(n, h) {
: 		i = hlist_entry(n, struct irq_info, node);
: 		if (i->irq == up->port.irq)
: 			break;
: 	}
: 
: 	BUG_ON(n == NULL);
: 	BUG_ON(i->head == NULL);

How can any compiler possibly determine that the hlist_for_each() is
never executed zero times?

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/2] serial: 8250: Initialize pointer to irq_info, Michal Simek, (Tue Aug 17, 12:59 am)
[PATCH 2/2] serial: 8250pci: Recast inb return value, Michal Simek, (Tue Aug 17, 12:59 am)
Re: [PATCH 1/2] serial: 8250: Initialize pointer to irq_info, Andrew Morton, (Thu Aug 19, 4:43 pm)