Received: by 2002:a05:6a10:5594:0:0:0:0 with SMTP id ee20csp518471pxb; Mon, 25 Apr 2022 15:24:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjZCNesQwjv/EDY3SD0HeJQf1SR+9+DSTKO/cyGH0CmWtU0exPYgIc1vOcsikHv1FVQXsN X-Received: by 2002:a63:115:0:b0:3ab:1c6c:c26b with SMTP id 21-20020a630115000000b003ab1c6cc26bmr8619505pgb.448.1650925470123; Mon, 25 Apr 2022 15:24:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650925470; cv=none; d=google.com; s=arc-20160816; b=TmCHMrTU33Rfxv1y4IoEEhyWXOBTqNOxJQeh3ATb9dYCqLVEs21xk/wWE+cCm1edCG biH3VoF7SyNHHqMG7mPgVP94bgy1k0i2fcoUhd90PdsXTLwkLLXoQHHRJA2LhWlOUxNu qbBciVO/L6WTt446biUXMzpwpMsS0FuogMImV/kc6GAOttW1P4O24hnU7O2zDIDZrh2U rLZfOTqroSL7pvlAPOqRLUZ7/T4UDjVrdW528moz0KNc2Lwcu5hyQWykq957+gKEoJYf sFpg4TuFZxyvjnpmnPzz0KLNivTmmd1p+CNC8Ky4BNX5Wgy4W6m2TpFjwAywDsrz5QFG ox+g== 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=rlTcnUtCD9kwC8NAxm705JWV4lU/pY88fG0RnTfd8/E=; b=BOXP6lL3X6byFUIk9TQczBhpjpDJxWOyuPaC4S0ZvMttz87q/QQcVmr5iNwk87ySiE krrooTFQZenSBPEcSgKYHc/s7dRhNIQREkfs2cABTh2F9aERXs8q2Kg6t8zKZ3r6o1dh olmA7FgS+HgWz49KtOfhNv40wtxE+qZzAFLvf04/hRyRohsmUn/fP6CLA/KfMwUBxh+I oTcUhZumxsFx6zjOkPpf1qpynBxetOtpetTt6KoAnujx+kBXgH/lv4h2j4cdyFxECcdz F9ihyPtYEiDbiuYghupZogyqvaESFS9vshkvVCz8dyWMQG7sG9cor/17ZpX536gU8uL8 KeYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=kYvhE8m4; 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 y2-20020a17090a86c200b001cb774b33b6si414426pjv.142.2022.04.25.15.24.13; Mon, 25 Apr 2022 15:24: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=@163.com header.s=s110527 header.b=kYvhE8m4; 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 S237182AbiDYPnx (ORCPT + 99 others); Mon, 25 Apr 2022 11:43:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232883AbiDYPnv (ORCPT ); Mon, 25 Apr 2022 11:43:51 -0400 Received: from m12-12.163.com (m12-12.163.com [220.181.12.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 820A52CCA0 for ; Mon, 25 Apr 2022 08:40:44 -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=rlTcn UtCD9kwC8NAxm705JWV4lU/pY88fG0RnTfd8/E=; b=kYvhE8m49CWD197s7d1UO LX/ASfKJI4CEMxg/+peYv3GXSG+a6AhIQsXM0ntqbJRvzPOt+H0kBUfcNFJ+ETrp jyJX4+3gBxs851ZGn57g81KdiG6r7dhB7VW7gJOLy8gnSFBfeFs0xEsoBIpLv9Ww 065z5mnJmzHyKuJIfRiCEg= Received: from localhost.localdomain (unknown [120.204.77.149]) by smtp8 (Coremail) with SMTP id DMCowAAn6uuXwGZiZEwODA--.43529S4; Mon, 25 Apr 2022 23:40:03 +0800 (CST) From: lizhe To: bhe@redhat.com, vgoyal@redhat.com, dyoung@redhat.com, prudo@redhat.com, sensor1010@163.com Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] kernel/crash_core.c : Remove redundant checks for ck_cmdline is NULL Date: Mon, 25 Apr 2022 08:38:57 -0700 Message-Id: <20220425153857.21922-1-sensor1010@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: DMCowAAn6uuXwGZiZEwODA--.43529S4 X-Coremail-Antispam: 1Uf129KBjvdXoW5Kry7uryDtry3Cw1kCFy5twb_yoWxXrc_Xw 47KF1vqryrAw1j9r4UAayrWrWUKw4jvFZa9a43trW2va47tryrG343JFn0yrn8C397Ary7 CFnrGrsFyrWrKjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRM5l8UUUUUU== X-Originating-IP: [120.204.77.149] X-CM-SenderInfo: 5vhq20jurqiii6rwjhhfrp/xS2BdBPtq1gi15X2AgAAst X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS 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 only caller of get_last_crashkernel() has already done non-NULL check(see __parse_crashkernel()), so it doesn't make any sense to make a check here 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