lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100820113125.6d7b498f@lxorguk.ukuu.org.uk>
Date:	Fri, 20 Aug 2010 11:31:25 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Alan Cox <alan@...ux.intel.com>, Michal Simek <monstr@...str.eu>,
	michal.simek@...alogix.com, Greg Kroah-Hartman <gregkh@...e.de>,
	Ralf Baechle <ralf@...ux-mips.org>,
	Manuel Lauss <manuel.lauss@...glemail.com>,
	linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] serial: 8250: Initialize pointer to irq_info

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ