Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3522467pxb; Sat, 26 Mar 2022 22:17:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwq8W/Puz0wXyGBDSyvxiMcsTG+nRNtfcO8T8jVZa+h+xsCwXSd6GoZoG/8HdPHOe1LjRt7 X-Received: by 2002:a17:902:7002:b0:14d:76b9:2303 with SMTP id y2-20020a170902700200b0014d76b92303mr20423159plk.155.1648358250983; Sat, 26 Mar 2022 22:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648358250; cv=none; d=google.com; s=arc-20160816; b=OxshsNvQWHV6guG38qALbye0hhdXjuo0CU3ynYYhlMDba5dzbYj3pFFjyIpdrsbTMU LMdynqJjHr8foznka3o/5edmKO+lk4bO93VbY+D4l37wu5+4ZkIHFzHHN2i/St8ZMNM2 YoICZd30qhCBr1OekMNc9tc8fvHRaY9IxB28HAfpDyX+M8O9sqxqiT2eHRLQUun0QHi2 R0BvgdjrfmTQ9mMG4Wyw06RUo8Kvlmh6QFHLVFR0z1m+9fSlvJz7Q+91p35DQyADAfiw twbfH1FGyqzTUmE1iYYOaM2lwx5c6UukABxPMOxBmga8mlRXOeo2QUxV1wkgZZ0KPCXe D+lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=9m5Rd6cbLT+02hkj1gkPPi+4zyoAG3SHfMbdx9sHaQQ=; b=Ugw0Jbv4dx1/oIb+GY2aZfGvpqbyLPmnbCwARj6HeXYG61aWmLwT7tVCGV0NBcey4X 3f3OzKUSBoOveoueiGnoryqULZn4iUIk8slYHlGleYKLD5hi7YT96B0ckcpB/PYEC0Qz GDPORATocghEeCiXnbt61xo6cvd4PuMx4Vpa8/2hH03nUgFBzG5zIwvcDc84jz44+QVp ZJAkm3VnxqZ5QFs3GapfSkP8/LgRJHFqlmdQYni5tC5Dme5veubjszH2z0Vfu9kNc3wC xthg5ZDnJLFsUz4lGaVHqNY7PmNQ55OBn5Q1c8zxqs7PoLHdTCppOgiWygLd7Wmmk4oN yXvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lpZ2SUYF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j22-20020a632316000000b003816043f05dsi7820561pgj.594.2022.03.26.22.17.00; Sat, 26 Mar 2022 22:17:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lpZ2SUYF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234413AbiCZSLh (ORCPT + 99 others); Sat, 26 Mar 2022 14:11:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234415AbiCZSLg (ORCPT ); Sat, 26 Mar 2022 14:11:36 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91C4862D9 for ; Sat, 26 Mar 2022 11:09:59 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id d5so18356230lfj.9 for ; Sat, 26 Mar 2022 11:09:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9m5Rd6cbLT+02hkj1gkPPi+4zyoAG3SHfMbdx9sHaQQ=; b=lpZ2SUYFArgTTFpWmMDS0iV0G4tege7cbfpCXfu15B1Gnaq5SS0Ay2VePEdR3uuMYv l3rVH0/ihLQ7tVB6GopPEGOjIwy9NLmzsrJbbRs55MLd5bNSoup3bJfVOAxw1wT/Grja V3ZwQRdqj1siq1/Lb5yoE1EuEpUvGnSPSNgtUub9ZRaLWoT0wJDp14ypa/vk9lnozu+j 1gvdo5lLYz+m2Wqq7yZRhHOmjyz3TaNCEosDoJrk2mPJkP4ntOSBw+6KnC/n3FQax1nI j8ss++ttpnhGeV8GOkkKhm0XrGO09BusemrSQjN7lCDuc3NU1BT1zi9kh41V4KWQvtNq d2TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9m5Rd6cbLT+02hkj1gkPPi+4zyoAG3SHfMbdx9sHaQQ=; b=4iso2R5Uh3e5o3zJIEVLbItJrGFASV5IVl/86jE83NG3Yl/E2a+xOBxeBNQOZJO+Dq FWD6Xc1LyHlBKwBx92UtsBlxEUyqewfnlK21hfwZdupDy4xTpqma9UnTyp+3/FTAsqIf uZB2K+JdQKbkrL34LVUrQVWMQltN9w4V/egU07tNESX9vh86YIy2EKroMf0iujYNPh7z Y7N4Lx2dzJ9lbGJKYOm+lgHU5yEKKId+C6vL1Q4GdAs8cBE5JzhCn8y6h7c3Sx1yc65S ibtX0TkZuw6uXGiFzNY7gR64F+KyWJePKKTvPsevQjoBpN4sNBN1/AD6VHogCHVlKEs0 09KA== X-Gm-Message-State: AOAM531PeSAoWpDwmMkIlGKknTJMi+BD4mUJexDFrLZ7qb90aJFmb9dz JtsnFmbcf8tj46bysFlafG0= X-Received: by 2002:a05:6512:1382:b0:445:9536:903 with SMTP id p2-20020a056512138200b0044595360903mr12926829lfa.89.1648318197835; Sat, 26 Mar 2022 11:09:57 -0700 (PDT) Received: from morzel-asus.lan (static-91-225-135-18.devs.futuro.pl. [91.225.135.18]) by smtp.gmail.com with ESMTPSA id h2-20020a05651c124200b002492835aa87sm1107591ljh.118.2022.03.26.11.09.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Mar 2022 11:09:57 -0700 (PDT) From: Michal Orzel To: Eric Biederman , Nathan Chancellor , Nick Desaulniers Cc: Michal Orzel , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] kexec: Remove redundant assignments Date: Sat, 26 Mar 2022 19:09:47 +0100 Message-Id: <20220326180948.192154-1-michalorzel.eng@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Get rid of redundant assignments which end up in values not being read either because they are overwritten or the function ends. Reported by clang-tidy [deadcode.DeadStores] Signed-off-by: Michal Orzel --- kernel/kexec_core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index 68480f731192..d08904a27362 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -768,7 +768,6 @@ static struct page *kimage_alloc_page(struct kimage *image, kimage_free_pages(old_page); continue; } - addr = old_addr; page = old_page; break; } @@ -788,7 +787,6 @@ static int kimage_load_normal_segment(struct kimage *image, unsigned char __user *buf = NULL; unsigned char *kbuf = NULL; - result = 0; if (image->file_mode) kbuf = segment->kbuf; else -- 2.25.1