]> git.karo-electronics.de Git - karo-tx-linux.git/commit
lib/mpi/mpicoder.c: looping issue, need stop when equal to zero, found by 'EXTRA_FLAG...
authorChen Gang <gang.chen@asianux.com>
Fri, 7 Jun 2013 00:07:02 +0000 (10:07 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 7 Jun 2013 05:41:44 +0000 (15:41 +1000)
commit0dcdbe5a75fed57ec96b74eceb46b293768dd66b
tree67cdfb7c69e939a8e59a9233e18ca55154289172
parent0c929121ba3575bc88791c13f7a3e8265d764510
lib/mpi/mpicoder.c: looping issue, need stop when equal to zero, found by 'EXTRA_FLAGS=-W'.

For 'while' looping, need stop when 'nbytes == 0', or will cause issue.
('nbytes' is size_t which is always bigger or equal than zero).

The related warning: (with EXTRA_CFLAGS=-W)
  lib/mpi/mpicoder.c:40:2: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: David Howells <dhowells@redhat.com>
Cc: James Morris <james.l.morris@oracle.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/mpi/mpicoder.c