Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1563454rwb; Wed, 28 Sep 2022 21:58:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6xZI9gLR9gXOO6c1D0kfnQhD1gygTMeDG3Df/ZsDrpwGje4EHDbI+elpeGQX0P9256WXKr X-Received: by 2002:a17:902:7281:b0:178:388d:6f50 with SMTP id d1-20020a170902728100b00178388d6f50mr1628687pll.127.1664427510065; Wed, 28 Sep 2022 21:58:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664427510; cv=none; d=google.com; s=arc-20160816; b=xv1vfvRxyccAtmKwXPIZh4kg1zZQGVMP1tYBU14Nli6m91eIc7TStBdbzOqfBx8nUD r05rAMR+sjTKcwnFh53lKKaEySmRs5e9SVzhZJ4kXbwsNxCvi0c++tgliriw3UvfEUC0 J7iYGJNRcX0KPY9r6zTRH4LgArNwXoKM4175jua2Xksfp03ablMl+5ZXcB5DPn8LBY/Q vBq8xXnR9whHYZNKv8o9T95SFtK/WMnRWA6OfTOoHLiydw8ItnnXGCVKxbRs2jbZUv3U TZh09u3yD6e9dtDmGvZOGmCXuLKrMEemRQsd1BROZLgCTyclTQjDRYgmH3jNvyBDOYNW 2ZQA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=X56MXTeL1zgJJtmkM3hVmZyHPkYGCqsYss1h8imBOow=; b=Ai4eryql1ajVmMfKElYoIFIdBN0f/hzuqgJ6th8FmhQTAZ4BoXqrOgniMf7vvwpbAT S1NjAeBKTMYMQkwqTY5DeelChZUT+DY9oNoazwS44q9Shp4Tz02qIZSXqpfcp4McDKTc 3XM91yS3EcLdvv85iTwql218WT+iQZ6wZ2lGWBHCVO+vLercDX0B2r/qmofKazX9YjTW f/b1GV99V21w+seHf5UnOcyupRhL6nVgWxDs7QlGPVsD06iQeVMPELt1C4LAiR0ngvUe ZPaxKU2zqqTRvRKlemiDiX8bTST3hr0c4c4S7mgPGZFrgrWcbrPYhwh+p1XA5iQHrujd e0ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WYyQie4O; 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 e65-20020a636944000000b0044035037d0asi4005409pgc.678.2022.09.28.21.58.17; Wed, 28 Sep 2022 21:58: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=@redhat.com header.s=mimecast20190719 header.b=WYyQie4O; 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 S234692AbiI2EaK (ORCPT + 99 others); Thu, 29 Sep 2022 00:30:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234757AbiI2EaF (ORCPT ); Thu, 29 Sep 2022 00:30:05 -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 ESMTPS id D9B2A5F121 for ; Wed, 28 Sep 2022 21:30:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664425799; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X56MXTeL1zgJJtmkM3hVmZyHPkYGCqsYss1h8imBOow=; b=WYyQie4Oijtl275H8CkEUgHGvmQhxXg81abWNYG7Dv/KoXReEsPy7VC7oWWeIpWCilCbqh iRJXKqh9/f1rbyLLzdLXqMcXksMGDFm0qpOkDqs3uYf8Gwf5GwwnyAoy7C5FAx2LpUYsA2 zeRb0WayJCQn6xerCtiZRhgrf9ikCOE= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-43-BdnAzjN5O3CslsDk2kU_SQ-1; Thu, 29 Sep 2022 00:29:53 -0400 X-MC-Unique: BdnAzjN5O3CslsDk2kU_SQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DD16A380673A; Thu, 29 Sep 2022 04:29:52 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-13-179.pek2.redhat.com [10.72.13.179]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0037A7AE5; Thu, 29 Sep 2022 04:29:48 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org Cc: kexec@lists.infradead.org, ebiederm@xmission.com, ye xingchen , Zeal Robot , Baoquan He Subject: [PATCH RESEND 2/4] kexec: Remove the unneeded result variable Date: Thu, 29 Sep 2022 12:29:34 +0800 Message-Id: <20220929042936.22012-3-bhe@redhat.com> In-Reply-To: <20220929042936.22012-1-bhe@redhat.com> References: <20220929042936.22012-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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 From: ye xingchen Return the value kimage_add_entry() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Acked-by: Baoquan He Signed-off-by: Baoquan He --- kernel/kexec_core.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index acd029b307e4..4d7da1556df8 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -561,23 +561,17 @@ static int kimage_add_entry(struct kimage *image, kimage_entry_t entry) static int kimage_set_destination(struct kimage *image, unsigned long destination) { - int result; - destination &= PAGE_MASK; - result = kimage_add_entry(image, destination | IND_DESTINATION); - return result; + return kimage_add_entry(image, destination | IND_DESTINATION); } static int kimage_add_page(struct kimage *image, unsigned long page) { - int result; - page &= PAGE_MASK; - result = kimage_add_entry(image, page | IND_SOURCE); - return result; + return kimage_add_entry(image, page | IND_SOURCE); } -- 2.34.1