lkml.org 
[lkml]   [2010]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] serial: 8250: Initialize pointer to irq_info
On Tue, 17 Aug 2010 09:17:20 +0100
Alan Cox <alan@linux.intel.com> wrote:

> On Tue, 17 Aug 2010 09:59:06 +0200
> Michal Simek <monstr@monstr.eu> wrote:
>
> > Initialize "i" irq_info pointer in serial_unlink_irq_chain.
> >
> > Compilation warning:
> > CC drivers/serial/8250.o
> > drivers/serial/8250.c: In function 'serial8250_shutdown':
> > drivers/serial/8250.c:1701: warning: 'i' may be used uninitialized in
> > this function
>
> NAK (again)
>
> Use a newer compiler - modern ones get this right.

: 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?



\
 
 \ /
  Last update: 2010-08-20 01:47    [W:0.102 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site