Received: by 10.223.176.5 with SMTP id f5csp751486wra; Tue, 6 Feb 2018 06:50:55 -0800 (PST) X-Google-Smtp-Source: AH8x22751udZCZ00/hZc6oFGHhIWTUDGCyZnBxVBoMtWjvmQcFabJMkWQGV5be1iDG5OcxPP78ui X-Received: by 10.99.181.4 with SMTP id y4mr2251519pge.344.1517928655844; Tue, 06 Feb 2018 06:50:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517928655; cv=none; d=google.com; s=arc-20160816; b=Yj0/GH0uShCu7LsPW1P9B/oH52d3qH8RCVRgV+PvH4ZoPdBAS5VNo96sNkH/m4neF+ GtqBwW04nDsHwoJT/7jdUHGOm2AIulZMVv8VtN2yOW3gbWCwIXUmfvxR6M1DDmghWwYi pzm0uGUfj5p0Tv0p5XvO2x5o2dSW8b9pi6pBA+6F2YMynz7KoeI6a4YoZfPLoaz+/Fvu xB+UBEv1Opii0ZDV2jiDZ2E2ZCKGACuIYelbxX3GdocAG52zvBC6TOVLVCU3Q55ZWFRt Rt9E17mCHicOs4tk+RrmoaUve4SSVoCGFMhFFn6y6zmMvyAPbGLxHzC60m+cATXzJ1Rz jlTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:arc-authentication-results; bh=ORa7x81gt9tTNOJi/ZqEOgcwYph4jFwzU2BWUXh1h18=; b=Fqj8c7qpHYLy0FyEttOTdVfuxgfUod+iUYfuaZNOCIW9GcH5ORHXanSQLoD1v03YE8 8t90WH1qItgSgyBwaWeao5OcYGiNKENmXIfFbUGUzoiblYKBLvIG9Yo7YO8ZzD0gtkqS NH5dOtj+llzL6lpcgIg4DGADCBSb1ZjlAdQfFOsIZ/x4M7BXytp491nUXrxwSMJIJsy/ DKG5zNN8DQ9z8vI6AluP6asG1ERmVtHLhJvVKsghUf5bhh+OkbkPNq8dluq+LHz42/pI 8g72bQK4E5mJWqot1YbqyZ7SpakwAmmmiaLIEWwSjTs+8QpZMCt/JLvjKdjDijH0fa63 9N8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w3-v6si1635873plp.625.2018.02.06.06.50.41; Tue, 06 Feb 2018 06:50:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752241AbeBFOt6 (ORCPT + 99 others); Tue, 6 Feb 2018 09:49:58 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:48780 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751424AbeBFOtx (ORCPT ); Tue, 6 Feb 2018 09:49:53 -0500 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1ej4ZC-0006lQ-RD; Tue, 06 Feb 2018 14:49:50 +0000 From: Colin King To: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , kasan-dev@googlegroups.com Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] kasan: remove redundant initialization of variable 'real_size' Date: Tue, 6 Feb 2018 14:49:50 +0000 Message-Id: <20180206144950.32457-1-colin.king@canonical.com> X-Mailer: git-send-email 2.15.1 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 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 --- 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); -- 2.15.1