diff options
author | Richard Leitner <dev@g0hl1n.net> | 2016-05-21 01:58:33 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-21 02:58:30 +0200 |
commit | cd33a76b0f2805fb0d6a05a2d53933f3817ccc9b (patch) | |
tree | ec001711de1e1490cf2bfd289cfe627f9fd4ca0b /mm | |
parent | z3fold: the 3-fold allocator for compressed pages (diff) | |
download | linux-cd33a76b0f2805fb0d6a05a2d53933f3817ccc9b.tar.xz linux-cd33a76b0f2805fb0d6a05a2d53933f3817ccc9b.zip |
mm/memblock.c: remove unnecessary always-true comparison
Comparing an u64 variable to >= 0 returns always true and can therefore
be removed. This issue was detected using the -Wtype-limits gcc flag.
This patch fixes following type-limits warning:
mm/memblock.c: In function `__next_reserved_mem_region':
mm/memblock.c:843:11: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
if (*idx >= 0 && *idx < type->cnt) {
Link: http://lkml.kernel.org/r/20160510103625.3a7f8f32@g0hl1n.net
Signed-off-by: Richard Leitner <dev@g0hl1n.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memblock.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memblock.c b/mm/memblock.c index 3b93daa46fc5..ac1248933b31 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -824,7 +824,7 @@ void __init_memblock __next_reserved_mem_region(u64 *idx, { struct memblock_type *type = &memblock.reserved; - if (*idx >= 0 && *idx < type->cnt) { + if (*idx < type->cnt) { struct memblock_region *r = &type->regions[*idx]; phys_addr_t base = r->base; phys_addr_t size = r->size; |