Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1233383pxb; Fri, 1 Apr 2022 08:03:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6zG42Y+C647Erlv0XUrxePBxfrD5qvSWruQE5ZP432wG3bNFFxedokrFWkNNr7xDaypQQ X-Received: by 2002:adf:e108:0:b0:1ef:97ad:5372 with SMTP id t8-20020adfe108000000b001ef97ad5372mr7804364wrz.658.1648825417451; Fri, 01 Apr 2022 08:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648825417; cv=none; d=google.com; s=arc-20160816; b=WrlkGuiLHf4rLc4ItCH1/C/gAJwYH9W/2ncEj4BEy/Oi3NlxnGUELqm8xClEY2SP0L rWKkigTnFpYhq20H9qFYfk2ZMIHD6+u21PrKJkU5RIdsWTW2wiMKSj6zqn3JEKnhrPOq OBA8lZrBh6AMnvsNdeDxQBmGicN8WGlpNs8nGjmdfezJuheMyf9goc9W2ZKUEwF38UB9 qdR/l99UUAZTQgf8lqNLXhLXecV03iETX5lgQSdcyG4pCbcX15gNIRTdhyDxlywz7LC2 HZ7OUocCSh5VdkzLfPThFJo/CBDYzcVt0coJuH+hcgQEqw7KAuoCLEDRWTcB6oPD6V+K wOJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oNP1A1QI6ELQhIr06lqyOR8+E3R+/itvgmLbp3dg+co=; b=ndwhyjwqSlW8Ue9c6CADoGNJnIcOKa3E3de7tDjSzVtoDmJK6/38CufbSsiF0RNiNI 2JoTh3eELC4CIBVlOD4MlvgcmKz5nfZkXkJhyUgQ4Un485Pgm/guxqH6E7Vv35EzxKYd zrTrkB0wo+FBGeXcwoTN5yreiP+Bi9UHXKmrEEytIeY7LCO5ybAqwK4IU+pARwNd2cfX 6c6q+ZMfFg2DxSVqHYlsin/DF1fzpormk7QYfjLuUQ5qLsWfjGsjb8jgIflplQd7e/97 4rKowL4WZ3YnwsGp8w4uH011iesqQ7Q/buYHJ7KcOfGn6hxSPUVgAygSr9fvYDmqOxs0 yTpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d975+l6+; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dz18-20020a0564021d5200b00419311e75f1si2149995edb.20.2022.04.01.08.03.06; Fri, 01 Apr 2022 08:03:37 -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=@redhat.com header.s=mimecast20190719 header.b=d975+l6+; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235068AbiCaLYj (ORCPT + 99 others); Thu, 31 Mar 2022 07:24:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232341AbiCaLYi (ORCPT ); Thu, 31 Mar 2022 07:24:38 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 235D3206EE2 for ; Thu, 31 Mar 2022 04:22:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648725770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oNP1A1QI6ELQhIr06lqyOR8+E3R+/itvgmLbp3dg+co=; b=d975+l6+sZ8md30KkZiftaWZO+LKIrWyIWQAJRpyrpa7OJSDZ3jD2af/k6SCnEeI7nEo2k F6CYuOG1Fxo8qLzFoTiyVz8IquL5wAuz3HVgh/89nXd8skG11pPHdY6+GQqoiM4NW6cc4q zJAZ3GpBu22K4g2WeTzmXEBiUIrIe4o= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-383-okBLcBc1ODKjgqyhnc311A-1; Thu, 31 Mar 2022 07:22:48 -0400 X-MC-Unique: okBLcBc1ODKjgqyhnc311A-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F2ABE85A5BE; Thu, 31 Mar 2022 11:22:47 +0000 (UTC) Received: from localhost (ovpn-13-26.pek2.redhat.com [10.72.13.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 24BB740146E; Thu, 31 Mar 2022 11:22:46 +0000 (UTC) Date: Thu, 31 Mar 2022 19:22:43 +0800 From: Baoquan He To: Michal Orzel , akpm@linux-foundation.org Cc: Eric Biederman , Nathan Chancellor , Nick Desaulniers , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] kexec: Remove redundant assignments Message-ID: References: <20220326180948.192154-1-michalorzel.eng@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220326180948.192154-1-michalorzel.eng@gmail.com> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 On 03/26/22 at 07:09pm, Michal Orzel wrote: > 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 LGTM, thx Acked-by: Baoquan He