Re: [resend][PATCH] avoid signed vs unsigned comparison inefi_range_is_wc()

From: Andrew Morton
Date: Thu Jun 16 2005 - 15:48:18 EST


Jesper Juhl <juhl-lkml@xxxxxx> wrote:
>
> I send in the patch below a while back but never recieved any response.
> Now I'm resending it in the hope that it might be added to -mm.

There are surely many warnings in the tree, hence I'm not really interested
in patches which only fix `gcc -W' warnings.

How many are there?

> It looks to me like a significantly large 'len' passed in could cause the
> loop to never end. Isn't it safer to make 'i' an unsigned long as well?

Nope. All operations which mix signed and unsigned types promote the
signed type to unsigned.

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