Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4726975iob; Sun, 8 May 2022 23:26:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGhFUTtSshKSDwByapsVp+q4kpXwp3QiRFHFFVXVJhBQ4XGn5uzwjfdcWVaHHI0WbBvKaT X-Received: by 2002:a17:90a:6a45:b0:1dd:11e4:b8e8 with SMTP id d5-20020a17090a6a4500b001dd11e4b8e8mr5391325pjm.89.1652077572719; Sun, 08 May 2022 23:26:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652077572; cv=none; d=google.com; s=arc-20160816; b=JRgDUjMfmMx8Vj7ARCWzu3n+QrbFXufxHyPse474jukAkt6hllTHOfGnmJgArALFXc 1izB/zd97cC+br8CksNxdJvYnBp3FSUZOCrRZ2vZF5+jy6bNSNrd/h0UhCOac4Xo13s3 WKoXOYtVqw++9u3rOHxTXP2Mc8gu1sZTUoQMgN01m+edG0pJ7MRQteNIPEN0F7fA044g 3UQUW86IX0br/USdtR8PkIFNEvzDlDxj+zC75HwEOczcxZkWq5/LMZdb6fQYP+U57aQl Syw26ei5DU/NIx6W59BYTUvgkRQG+ROH5Q79W51sUgDJueS2dDYEnEqpF8sgAAfQNPN8 T6PQ== 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=ItiPDp2je/Kp/U+WrNcavPKDbIiJIWhg9WRpKTS0IW0=; b=BGy1VmRtVLcXjsnL+6Oj9HIXk2qocA78J9fRh1d7xkr/z4esUn5Xqso+e+poFBQ33G 15TFQlt8AQmuzEu6TbTj27TsTfvxLewpI6PudwE5pw4IB5VbImcSw/cF6/CFjkmCBVsd anyJcFYn+K3R27JDH0gYfGvGm9PqhvrpYzlGnsYy0fU6kGQ0vPdgGwdoIfEJ4kIvePLM vMnUHxDba4KF9He/nLyhcKJqBHOAP0bwz8X2dTznvEkZuMSqjc2/tN93ZjNwNJ6wwkCb Hytemcy6VAWAQfEcasHALfKC/XjS3VLO1QavC8LJHeVFcBqhiRoGJdeGiw2ZXxbVyMXV J7qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="ByOWqq9/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o6-20020a634106000000b003816043eecesi12931291pga.195.2022.05.08.23.26.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 23:26:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="ByOWqq9/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A754417B619; Sun, 8 May 2022 23:25:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386676AbiEEXXI (ORCPT + 99 others); Thu, 5 May 2022 19:23:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386686AbiEEXXA (ORCPT ); Thu, 5 May 2022 19:23:00 -0400 Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [170.10.129.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5A844606E5 for ; Thu, 5 May 2022 16:19:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651792755; 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=ItiPDp2je/Kp/U+WrNcavPKDbIiJIWhg9WRpKTS0IW0=; b=ByOWqq9/lUTKl32JtxPshFoXfI3ATyxzMzM6CJPrZhqIwOPL+GgtjCnvx3LCmwxNl49CKu twKhCY/a4Vj2Z2kfHrZAq8IJee+4KBGmcS49wR1XRgJ9gbqWgF5xDwPjwFuBQ+TXpMKHKK jbYRCm7I86mwPJZp/fTTQ2R/wflBIak= 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-167-6goZ4s7XN1uYhsB4BTmkZA-1; Thu, 05 May 2022 19:19:12 -0400 X-MC-Unique: 6goZ4s7XN1uYhsB4BTmkZA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5006B811E75; Thu, 5 May 2022 23:19:12 +0000 (UTC) Received: from localhost (ovpn-12-55.pek2.redhat.com [10.72.12.55]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 782D4400DFA2; Thu, 5 May 2022 23:19:11 +0000 (UTC) Date: Fri, 6 May 2022 07:19:07 +0800 From: Baoquan He To: lizhe Cc: vgoyal@redhat.com, dyoung@redhat.com, prudo@redhat.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kernel/crash_core.c : Remove redundant checks for ck_cmdline is NULL Message-ID: <20220505231907.GB2331@MiWiFi-R3L-srv> References: <20220504123623.36852-1-sensor1010@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220504123623.36852-1-sensor1010@163.com> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 05/04/22 at 05:36am, lizhe wrote: > 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 Now the patch log correctly reflects the code change, even though the log is a little redundant. While it's far far better than a wrong log which will definitely confuse, even mislead people. I would go with: ====== kernel/crash_core.c : remove redundant check of ck_cmdline At the end of get_last_crashkernel(), the judgement of ck_cmdline is obviously unnecessary and causes redundance, let's clean it up. ====== And the patch version is missing. If you agree on the above log rephrasing, please post v4 with the updated log, and can add my ack: Acked-by: Baoquan He Thanks Baoquan > > 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 >