projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
637241a
)
lib/mpi/mpicoder.c: looping issue, need stop when equal to zero, found by 'EXTRA_FLAG...
author
Chen Gang
<
[email protected]
>
Wed, 12 Jun 2013 21:04:40 +0000
(14:04 -0700)
committer
Linus Torvalds
<
[email protected]
>
Wed, 12 Jun 2013 23:29:44 +0000
(16:29 -0700)
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 <
[email protected]
>
Cc: Rusty Russell <
[email protected]
>
Cc: David Howells <
[email protected]
>
Cc: James Morris <
[email protected]
>
Cc: Andy Shevchenko <
[email protected]
>
Acked-by: David Howells <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
lib/mpi/mpicoder.c
patch
|
blob
|
history
diff --git
a/lib/mpi/mpicoder.c
b/lib/mpi/mpicoder.c
index 5f9c44cdf1f548f5440e6ee86473af3ab5248b32..4cc6442733f49577f29647984db9f310d06a21c4 100644
(file)
--- a/
lib/mpi/mpicoder.c
+++ b/
lib/mpi/mpicoder.c
@@
-37,7
+37,7
@@
MPI mpi_read_raw_data(const void *xbuffer, size_t nbytes)
mpi_limb_t a;
MPI val = NULL;
- while (nbytes >
=
0 && buffer[0] == 0) {
+ while (nbytes > 0 && buffer[0] == 0) {
buffer++;
nbytes--;
}