From nobody Wed Dec 17 10:54:30 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28117C4167B for ; Tue, 28 Nov 2023 05:53:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343619AbjK1FxG (ORCPT ); Tue, 28 Nov 2023 00:53:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343576AbjK1Fwx (ORCPT ); Tue, 28 Nov 2023 00:52:53 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF4A3E6 for ; Mon, 27 Nov 2023 21:52:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701150779; 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; bh=gMr7SNIGWG+LCt67HL84oAYmHREAbz0FAtMx7hLa0hk=; b=fczUNevm9+5D8wo6vXI2sBt/Ihcs5Y22w8K4SO9qU8Ob9yDe44CSEJ4Rmj4xDwZzfM7FCx FHpWKqxv2pIYR7sBNEOCekPOonuYyEMgbAKh5UQ17kfkAzMjvmKBbRmKImRKmkGm+pE8EF vLkuiwvx1ENZAFz3sn/16xH2At94RpQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-664-QrJwYi1qPxyK5xc4SEBPyQ-1; Tue, 28 Nov 2023 00:52:55 -0500 X-MC-Unique: QrJwYi1qPxyK5xc4SEBPyQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C6CCE85A5BD; Tue, 28 Nov 2023 05:52:54 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.112.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2E725028; Tue, 28 Nov 2023 05:52:51 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: kexec@lists.infradead.org, x86@kernel.org, akpm@linux-foundation.org, eric_devolder@yahoo.com, ignat@cloudflare.com, agordeev@linux.ibm.com, Baoquan He Subject: [PATCH v2] drivers/base/cpu: crash data showing should depends on KEXEC_CORE Date: Tue, 28 Nov 2023 13:52:48 +0800 Message-ID: <20231128055248.659808-1-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After commit 88a6f8994421 ("crash: memory and CPU hotplug sysfs attributes"), on x86_64, if only below kernel configs related to kdump are set, compiling error are triggered. Tested-by: Alexander Gordeev Tested-by: Ignat Korchagin # compile-time only ---- CONFIG_CRASH_CORE=3Dy CONFIG_KEXEC_CORE=3Dy CONFIG_CRASH_DUMP=3Dy CONFIG_CRASH_HOTPLUG=3Dy ------ ------------------------------------------------------ drivers/base/cpu.c: In function =E2=80=98crash_hotplug_show=E2=80=99: drivers/base/cpu.c:309:40: error: implicit declaration of function =E2=80= =98crash_hotplug_cpu_support=E2=80=99; did you mean =E2=80=98crash_hotplug_= show=E2=80=99? [-Werror=3Dimplicit-function-declaration] 309 | return sysfs_emit(buf, "%d\n", crash_hotplug_cpu_support()); | ^~~~~~~~~~~~~~~~~~~~~~~~~ | crash_hotplug_show cc1: some warnings being treated as errors ------------------------------------------------------ CONFIG_KEXEC is used to enable kexec_load interface, the crash_notes/crash_notes_size/crash_hotplug showing depends on CONFIG_KEXEC is incorrect. It should depend on KEXEC_CORE instead. Fix it now. Fixes: commit 88a6f8994421 ("crash: memory and CPU hotplug sysfs attributes= ") Signed-off-by: Baoquan He --- drivers/base/cpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 9ea22e165acd..548491de818e 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -144,7 +144,7 @@ static DEVICE_ATTR(release, S_IWUSR, NULL, cpu_release_= store); #endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */ #endif /* CONFIG_HOTPLUG_CPU */ =20 -#ifdef CONFIG_KEXEC +#ifdef CONFIG_KEXEC_CORE #include =20 static ssize_t crash_notes_show(struct device *dev, @@ -189,14 +189,14 @@ static const struct attribute_group crash_note_cpu_at= tr_group =3D { #endif =20 static const struct attribute_group *common_cpu_attr_groups[] =3D { -#ifdef CONFIG_KEXEC +#ifdef CONFIG_KEXEC_CORE &crash_note_cpu_attr_group, #endif NULL }; =20 static const struct attribute_group *hotplugable_cpu_attr_groups[] =3D { -#ifdef CONFIG_KEXEC +#ifdef CONFIG_KEXEC_CORE &crash_note_cpu_attr_group, #endif NULL --=20 2.41.0