From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05E8DC04AAD for ; Mon, 6 May 2019 14:47:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C23C3205ED for ; Mon, 6 May 2019 14:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557154043; bh=b4htW5DfEGMi9hOIptOK6giroC6eysaZT+46tVecKns=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=I5ngT1hZLDPKXkgi8vImDOQvPYbzwqBCRgJsxSBtwLu7Q9tCslr+eQmwb9szB+yMZ M1eThgtfH88h2OZPXBh26moKXgC6phtzIm60qKxuci5YHxsYEth7+Li1g9lleNjjyh 0Ly7pXA9woIrSG3Mcf/ZxhQWpnVa6bm0wmEZZl/0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729301AbfEFOrW (ORCPT ); Mon, 6 May 2019 10:47:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:46388 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728776AbfEFOrV (ORCPT ); Mon, 6 May 2019 10:47:21 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4F32620578; Mon, 6 May 2019 14:47:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557154040; bh=b4htW5DfEGMi9hOIptOK6giroC6eysaZT+46tVecKns=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ILPYOUYghjZetxqdqVBkkiadkrYrlgCvca2jvlZ+RgFTViY+LMoCdflUUztKENw/p J+eH91KDQQLDMMPPNITvoMo82/h+vZxRVeUCIW9eMVYAxfKW6Br+QSzvZqgG7yGvQ2 +FokOwJnEjnSfo2LYgMKChi1w3UHeqBuZRXgxJNM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Andrey Ryabinin , Andrew Morton , Alexander Potapenko , Dmitry Vyukov , Linus Torvalds , Andrey Konovalov Subject: [PATCH 4.9 16/62] kasan: remove redundant initialization of variable real_size Date: Mon, 6 May 2019 16:32:47 +0200 Message-Id: <20190506143052.471187212@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190506143051.102535767@linuxfoundation.org> References: <20190506143051.102535767@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King commit 48c232395431c23d35cf3b4c5a090bd793316578 upstream. 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/20180206144950.32457-1-colin.king@canonical.com Signed-off-by: Colin Ian King Acked-by: Andrey Ryabinin Reviewed-by: Andrew Morton Cc: Alexander Potapenko Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Andrey Konovalov Signed-off-by: Greg Kroah-Hartman --- lib/test_kasan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/lib/test_kasan.c +++ b/lib/test_kasan.c @@ -355,7 +355,7 @@ static noinline void __init kasan_stack_ 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);