[rds-devel] [PATCH 6/9] RDS: Fix ordering in a conditional

Roland Dreier rdreier at cisco.com
Mon Mar 30 21:27:53 PDT 2009


 > -	if (0 <= ret && (unsigned) ret < nr_pages) {
 > +	if (ret > 0 && (unsigned) ret < nr_pages) {

This is not an equivalent transformation -- the original code is true if
ret == 0, while the new code is false.

Also it seems you don't need the unsigned cast here, since the clause
before just checked that ret is positive?

 - R.



More information about the rds-devel mailing list