All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Alan Cox <alan@linux.intel.com>
Cc: Michal Simek <monstr@monstr.eu>,
	michal.simek@petalogix.com, Greg Kroah-Hartman <gregkh@suse.de>,
	Ralf Baechle <ralf@linux-mips.org>,
	Manuel Lauss <manuel.lauss@googlemail.com>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] serial: 8250: Initialize pointer to irq_info
Date: Thu, 19 Aug 2010 16:43:54 -0700	[thread overview]
Message-ID: <20100819164354.09e30dc9.akpm@linux-foundation.org> (raw)
In-Reply-To: <20100817091720.56183993@linux.intel.com>

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?


  parent reply	other threads:[~2010-08-19 23:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-17  7:59 [PATCH 1/2] serial: 8250: Initialize pointer to irq_info Michal Simek
2010-08-17  7:59 ` [PATCH 2/2] serial: 8250pci: Recast inb return value Michal Simek
2010-08-17  8:21   ` Alan Cox
2010-08-17 10:04   ` Alan Cox
2010-08-17 10:09     ` Michal Simek
2010-08-17  8:17 ` [PATCH 1/2] serial: 8250: Initialize pointer to irq_info Alan Cox
2010-08-17  8:56   ` Michal Simek
2010-08-19 23:43   ` Andrew Morton [this message]
2010-08-20 10:31     ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100819164354.09e30dc9.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=alan@linux.intel.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=manuel.lauss@googlemail.com \
    --cc=michal.simek@petalogix.com \
    --cc=monstr@monstr.eu \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.