linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* (no subject)
@ 2005-06-28  9:18 d binderman
  2005-06-28 11:03 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: d binderman @ 2005-06-28  9:18 UTC (permalink / raw)
  To: linux-kernel


Hello there,

I just tried to compile the Linux Kernel version 2.6.11.12
with the gcc 4.0 compiler. The compiler said

drivers/net/depca.c:1829: warning: operation on 'i' may be undefined

The source code is

for (i = entry; i != end; i = (++i) & lp->txRingMask) {

I agree with the compiler. Better code is

for (i = entry; i != end; i = (i + 1) & lp->txRingMask) {

Regards

David Binderman

_________________________________________________________________
Be the first to hear what's new at MSN - sign up to our free newsletters! 
http://www.msn.co.uk/newsletters


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re:
  2005-06-28  9:18 d binderman
@ 2005-06-28 11:03 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2005-06-28 11:03 UTC (permalink / raw)
  To: d binderman; +Cc: linux-kernel

"d binderman" <dcb314@hotmail.com> wrote:
>
> 
> Hello there,
> 
> I just tried to compile the Linux Kernel version 2.6.11.12
> with the gcc 4.0 compiler. The compiler said
> 
> drivers/net/depca.c:1829: warning: operation on 'i' may be undefined
> 
> The source code is
> 
> for (i = entry; i != end; i = (++i) & lp->txRingMask) {
> 
> I agree with the compiler. Better code is
> 
> for (i = entry; i != end; i = (i + 1) & lp->txRingMask) {
> 

Someone already fixed it.

		/* set up the buffer descriptors */
		len = (skb->len < ETH_ZLEN) ? ETH_ZLEN : skb->len;
		for (i = entry; i != end; i = (i+1) & lp->txRingMask) {


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-06-28 11:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-28  9:18 d binderman
2005-06-28 11:03 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).