Re: [ofa-general] [PATCH] drivers/infiniband: fix comparsion between unsigned and negative

2007-05-30 Thread Roland Dreier
I just went through this patch, and all the changes are of the form of removing the < 0 test from code like if (x < 0 || x > MAX) return -ERROR; which Linus said we don't change in the email that Satyam just pointed out. So I'll dro

Re: dealing with gcc 'comparison is always false' warnings (was: [PATCH] drivers/infiniband: fix comparsion between unsigned and negative)

2007-05-30 Thread Satyam Sharma
Hi Bill, On 5/31/07, Bill Nottingham <[EMAIL PROTECTED]> wrote: Satyam Sharma ([EMAIL PROTECTED]) said: > But yes, the kind of "fixes" you pointed out that _remove_ these conditions > are definitely *not* what we would want to do. I can see that - but I think it should be at least be brought up

Re: dealing with gcc 'comparison is always false' warnings (was: [PATCH] drivers/infiniband: fix comparsion between unsigned and negative)

2007-05-30 Thread Bill Nottingham
Satyam Sharma ([EMAIL PROTECTED]) said: > But yes, the kind of "fixes" you pointed out that _remove_ these conditions > are definitely *not* what we would want to do. I can see that - but I think it should be at least be brought up for each warning, to determine either: 1) if it should be ignore

Re: dealing with gcc 'comparison is always false' warnings (was: [PATCH] drivers/infiniband: fix comparsion between unsigned and negative)

2007-05-30 Thread Satyam Sharma
On 5/30/07, Satyam Sharma <[EMAIL PROTECTED]> wrote: On 5/30/07, Roland Dreier <[EMAIL PROTECTED]> wrote: > thanks... I'm wondering if there's a consensus among kernel hackers > about changes like: > > > -if (hdr.cmd < 0 || hdr.cmd >= ARRAY_SIZE(ucma_cmd_table)) > > +if (hdr.cmd >= ARRA

Re: dealing with gcc 'comparison is always false' warnings (was: [PATCH] drivers/infiniband: fix comparsion between unsigned and negative)

2007-05-30 Thread Satyam Sharma
On 5/30/07, Roland Dreier <[EMAIL PROTECTED]> wrote: thanks... I'm wondering if there's a consensus among kernel hackers about changes like: > -if (hdr.cmd < 0 || hdr.cmd >= ARRAY_SIZE(ucma_cmd_table)) > +if (hdr.cmd >= ARRAY_SIZE(ucma_cmd_table)) > return -EINVAL; I und

dealing with gcc 'comparison is always false' warnings (was: [PATCH] drivers/infiniband: fix comparsion between unsigned and negative)

2007-05-30 Thread Roland Dreier
thanks... I'm wondering if there's a consensus among kernel hackers about changes like: > -if (hdr.cmd < 0 || hdr.cmd >= ARRAY_SIZE(ucma_cmd_table)) > +if (hdr.cmd >= ARRAY_SIZE(ucma_cmd_table)) > return -EINVAL; I understand that new gcc sees that hdr.cmd is unsigned and

[PATCH] drivers/infiniband: fix comparsion between unsigned and negative

2007-05-30 Thread Bill Nottingham
Recent gcc versions emit warnings when unsigned variables are compared < 0 or >= 0. Signed-off-by: Bill Nottingham <[EMAIL PROTECTED]> --- core/sysfs.c |2 +- core/ucm.c |2 +- core/ucma.c|2 +- core/user_mad.c|5 ++--- core/uverbs_main.c |3 +-- co