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 C5C88C04A6B for ; Mon, 6 May 2019 14:43:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F13D21479 for ; Mon, 6 May 2019 14:43:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153834; bh=eWrxKa5mruWpD72si73uMiQaXjLDj/Ihgq8FAilg64g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=D9rG0eC2KOh6Yoc7Bt+qYBppTaU7rjZMrkqOjwr6V4SeUgsB2oO3OZcXmnhW8qTYX VvggO8/olE/j59Kak0StymZ1piEsR0GB/UPHxjz2Ox2XJnmNLf7LWDxgOc3qqGxPq2 8XcpckNnuRj/7PVc314TF9Qoo4BMr60z5rg4JsaI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728020AbfEFOnw (ORCPT ); Mon, 6 May 2019 10:43:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:39682 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727165AbfEFOnt (ORCPT ); Mon, 6 May 2019 10:43:49 -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 F017921479; Mon, 6 May 2019 14:43:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153828; bh=eWrxKa5mruWpD72si73uMiQaXjLDj/Ihgq8FAilg64g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ayp0yk7PkP7ShVWzh8BmbrBmqeP3iisEHiT7Q6zv/badwGUNLw3QCySqdC3A6WVf7 VvzCXAwyWB5h/+9WCSrmAqUxwGLGHLIaFZ85cTdt7RxaBBKzTKIF02dm9g4/dUHOVx UqSj1jFftoW6nHgeoVNeQQ4XfLKY2rp+kjsZuGkI= 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.14 12/75] kasan: remove redundant initialization of variable real_size Date: Mon, 6 May 2019 16:32:20 +0200 Message-Id: <20190506143054.307788749@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190506143053.287515952@linuxfoundation.org> References: <20190506143053.287515952@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 @@ -389,7 +389,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);