[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e86dcb38-d00e-d5d8-ca66-9ff4013a786c@virtuozzo.com>
Date: Tue, 6 Feb 2018 23:10:03 +0300
From: Andrey Ryabinin <aryabinin@...tuozzo.com>
To: Colin King <colin.king@...onical.com>,
Alexander Potapenko <glider@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>, kasan-dev@...glegroups.com
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] kasan: remove redundant initialization of variable
'real_size'
On 02/06/2018 05:49 PM, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
>
> 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
>
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
Acked-by: Andrey Ryabinin <aryabinin@...tuozzo.com>
> ---
> lib/test_kasan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/test_kasan.c b/lib/test_kasan.c
> index a808d81b409d..dba0ffd45fd7 100644
> --- a/lib/test_kasan.c
> +++ b/lib/test_kasan.c
> @@ -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);
>
Powered by blists - more mailing lists