Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1887920iob; Thu, 5 May 2022 10:07:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+bD/iFuldn6eCItccr12PXnyOgmhYf6WFMyXs/ZcjKvCoEJJN/wNumSM7FmnBAHiENcBO X-Received: by 2002:a17:90b:4a4e:b0:1dc:55ca:6f33 with SMTP id lb14-20020a17090b4a4e00b001dc55ca6f33mr7383398pjb.4.1651770470716; Thu, 05 May 2022 10:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651770470; cv=none; d=google.com; s=arc-20160816; b=PLvuRd9gIKTwuFbOGfwb86oRXpkcYf62C997sFPExBAQd9Qu/9n/J4dvdOJFhn99IS uHxTVsAr21bYuieT9JeEQaE7sbZ7g+Q8KMAgUwfrUJDGGrEqhl2eO87i7dGHUPsZgOch aNAxUsIePwc6uByWIYxJhZ9f7+7/ExETPJgzk7m4qDQeRSTZIPsQd8deXeBqByU56D16 qi9A10iZLyJ9C79yNXpvv8I/lyt2EXBs1YTAOFAEdn668IM4kuv3/DILOeiY+t2BNert +YfFr4DtlRH94jwxzYLlxUwRTK3me0Kx2vXb4t2VTmRCCW4hQG9W7w20z7woqgJIhmN9 Wejg== 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=0j/hvWPupqrJGaOCk9faAVdYLcHHclCHbuBk/wL09eE=; b=o3Pes6qfnpdoypY3ixZkQ7tFwlc/G4YpX1VvOEaPSGRBiUaZXbKP9GX6vz2Vu+T5zg lwPa6SSZwM29uNYjNSvjHNHI+3uq9ue1TMNHsquc5eK83dMBOrkTwYqLAUsYQ+XM11S+ ub4FRTICt2OXhhKKfvVhfG6BCTRfN2trhwOoA0yRJZZXIKRZiL2nRXL8fv6qzEkxqO36 CCuQ7MNlq4Du/ksICsGTz88joOQr/BE+buZ1Efd/QvbDLEM02gKnXO11kGBl7RJh/JGg t2JkjTgT9+B52KJcMsUTnDPz1ZYjoDoB+5Lc2FGWDScdT1OvLQGYp1vIu8UilQ4BxufN 71Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=XKXx2GJz; 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=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lx15-20020a17090b4b0f00b001bf691f3264si2780675pjb.19.2022.05.05.10.07.30; Thu, 05 May 2022 10:07:50 -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=@163.com header.s=s110527 header.b=XKXx2GJz; 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=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349872AbiEDM4N (ORCPT + 99 others); Wed, 4 May 2022 08:56:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237921AbiEDM4L (ORCPT ); Wed, 4 May 2022 08:56:11 -0400 X-Greylist: delayed 901 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 04 May 2022 05:52:35 PDT Received: from m12-18.163.com (m12-18.163.com [220.181.12.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 25F452AE12 for ; Wed, 4 May 2022 05:52:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=0j/hv WPupqrJGaOCk9faAVdYLcHHclCHbuBk/wL09eE=; b=XKXx2GJzfal9rxPRPgbfQ 1/robgERR1lNwK3ndSt6c+kbjEqn6m8tyRqe8yKVCAUPSu4wQ6drHUVyos7whsxy 3AFuhqCosXFTwzcqmjn1GnW0km6lUAiKXIe+nUNDrOcpD0reS/lfvJSmxaaMWmg7 kwyM6ZWcBsB0ThHHG8xkHs= Received: from localhost.localdomain (unknown [120.204.77.149]) by smtp14 (Coremail) with SMTP id EsCowABnJ_tKc3JikTI+Aw--.4038S4; Wed, 04 May 2022 20:37:05 +0800 (CST) From: lizhe To: bhe@redhat.com, vgoyal@redhat.com, dyoung@redhat.com, prudo@redhat.com Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org, lizhe Subject: [PATCH] kernel/crash_core.c : Remove redundant checks for ck_cmdline is NULL Date: Wed, 4 May 2022 05:36:23 -0700 Message-Id: <20220504123623.36852-1-sensor1010@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: EsCowABnJ_tKc3JikTI+Aw--.4038S4 X-Coremail-Antispam: 1Uf129KBjvdXoW5Kr1rCw4xCrWxArWUXFW7CFg_yoWxXrX_W3 y7Krn2qr15Aw1j9r18ZayfWrWUKa10va9a9a43trW2va47trn5G343JFn0yrnxC397Cr17 Gws7Jrnrt3yakjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xR_sqWUUUUUU== X-Originating-IP: [120.204.77.149] X-CM-SenderInfo: 5vhq20jurqiii6rwjhhfrp/xtbBohH2q1aEEK-VzAAAsa X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,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 When ck_cmdline is NULL. The last three lines of this function(get_last_crashkernel()) are equivalent to : if (!NULL) return NULL; return NULL; This is obviously a redundant check Signed-off-by: lizhe --- kernel/crash_core.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/kernel/crash_core.c b/kernel/crash_core.c index 256cf6db573c..c232f01a2c54 100644 --- a/kernel/crash_core.c +++ b/kernel/crash_core.c @@ -222,9 +222,6 @@ static __init char *get_last_crashkernel(char *cmdline, p = strstr(p+1, name); } - if (!ck_cmdline) - return NULL; - return ck_cmdline; } -- 2.25.1