kasan: remove redundant initialization of variable 'real_size'
authorColin Ian King <[email protected]>
Tue, 6 Feb 2018 23:36:48 +0000 (15:36 -0800)
committerLinus Torvalds <[email protected]>
Wed, 7 Feb 2018 02:32:43 +0000 (18:32 -0800)
Variable real_size is initialized with a value that is never read, it is
re-assigned a new value later on, hence the initialization is redundant
and can be removed.

Cleans up clang warning:

  lib/test_kasan.c:422:21: warning: Value stored to 'real_size' during its initialization is never read

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Colin Ian King <[email protected]>
Acked-by: Andrey Ryabinin <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
lib/test_kasan.c

index a808d81b409dd3b212dd6ec0589a9f8c2e772598..98854a64b014dbbf761deb2c4fcda1512a456b68 100644 (file)
@@ -419,7 +419,7 @@ static noinline void __init kasan_stack_oob(void)
 static noinline void __init ksize_unpoisons_memory(void)
 {
        char *ptr;
-       size_t size = 123, real_size = size;
+       size_t size = 123, real_size;
 
        pr_info("ksize() unpoisons the whole allocated chunk\n");
        ptr = kmalloc(size, GFP_KERNEL);