From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Alan Cox <alan@linux.intel.com>, 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: Fri, 20 Aug 2010 11:31:25 +0100 [thread overview]
Message-ID: <20100820113125.6d7b498f@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <20100819164354.09e30dc9.akpm@linux-foundation.org>
> > 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?
We had this argument was it two years ago ?
Modern gcc is capable of at least working out it can't work it out and
doesn't emit a spurious warning.
prev parent reply other threads:[~2010-08-20 10:16 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
2010-08-20 10:31 ` Alan Cox [this message]
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=20100820113125.6d7b498f@lxorguk.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox