From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A02A1C433F5 for ; Tue, 22 Mar 2022 01:45:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AC46D6B0072; Mon, 21 Mar 2022 21:45:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A73C56B0073; Mon, 21 Mar 2022 21:45:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 914E86B0074; Mon, 21 Mar 2022 21:45:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0104.hostedemail.com [216.40.44.104]) by kanga.kvack.org (Postfix) with ESMTP id 7F7336B0072 for ; Mon, 21 Mar 2022 21:45:18 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2B591A3EF9 for ; Tue, 22 Mar 2022 01:45:18 +0000 (UTC) X-FDA: 79270329516.17.756C9DA Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by imf27.hostedemail.com (Postfix) with ESMTP id 732B540018 for ; Tue, 22 Mar 2022 01:45:17 +0000 (UTC) Received: by mail-pf1-f180.google.com with SMTP id z16so17010156pfh.3 for ; Mon, 21 Mar 2022 18:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=QIf4Hy84dx7L6X4BNNjvqyd7qQS9lH8gSrCqndVgulg=; b=c1eIS7vo7uHJkChkDX9E8UuibyJlcPj9ny6akRAfhecft5A4sQAAvRT6NWdrwAyYS1 dhaWlwDJJ1cJQ9ZRJHl9EjacUiDF5EHf3CHkOAqMuf0zU49JchE3kIj49+xSipYMpZiR HImhOI6SXmdIbf5Eor+xzxKwjeQIQjsWyx8OU4AT+mnrMtNSqd3W8TbEmgIo7Y1ycTlD rVRjOa0tpXALsViv1QgoVdGtel5P6mOpCoBMe6neh7LZthVINVhnDwPsTLrKPRqvH1Ba hTfFX+3SOKUYmcJb74di86aoahq+yHYqmpEMYLfZnR7rPa1oD6FVpe5eB6p5JxtXIWju iwxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=QIf4Hy84dx7L6X4BNNjvqyd7qQS9lH8gSrCqndVgulg=; b=SjNd8rmBaQeTK8diCtoO+ZSbVlTDEl//zmbKtAdmjO22d/c2UyAkCmehBrwzvwqoYK rujp9lu8jNGNxnZWyS6n8AO2PrZi76PGQWOgpzdOIugkoJtTK+8aAhk9qH96kFR6QnHb MQkGvacE+KYpJv/GyZpYmnetMdQBLG166X1Lw0WNDIqRmQhLdWcI885PzdouYiWY0Uhv arHoWC5f4DZ/iHjFwMnnblONWE7LjPw9gd9fmLVwOpZzN1/omL+QgzhYylDjNvvM//Jb z7ILksjicBonQOqSR57hz3FEs3h2aGdCFBPUwQBPxAPhg3ZuLA1yNBe52VfVDXptwms0 O+ew== X-Gm-Message-State: AOAM533Aj+5khaqinZnwHgd5QXgO6PQ7h44Bsgm4PeY+1QBvU/n/pGay D+6iCFJSWANQL7ayVGrs5xWUdi9btF7RrIPABsBD/g== X-Google-Smtp-Source: ABdhPJzVR8hSV4LYUKgF5NX85hxfFWmgAFFzJsBeUycAZHnf4kgiNP9olDkABVHU+za3VoOGb088WtmKxpJ0jIdi06E= X-Received: by 2002:a63:5c53:0:b0:381:309e:e72c with SMTP id n19-20020a635c53000000b00381309ee72cmr20646280pgm.40.1647913516040; Mon, 21 Mar 2022 18:45:16 -0700 (PDT) MIME-Version: 1.0 References: <20220318114133.113627-1-kjain@linux.ibm.com> <20220318114133.113627-2-kjain@linux.ibm.com> In-Reply-To: From: Dan Williams Date: Mon, 21 Mar 2022 18:45:08 -0700 Message-ID: Subject: Re: [PATCH 2/2] powerpc/papr_scm: Fix build failure when CONFIG_PERF_EVENTS is not set To: Kajol Jain Cc: Michael Ellerman , linuxppc-dev , Linux NVDIMM , Linux Kernel Mailing List , Linux-Next Mailing List , Peter Zijlstra , "Weiny, Ira" , Vishal L Verma , Stephen Rothwell , Santosh Sivaraj , maddy@linux.ibm.com, rnsastry@linux.ibm.com, "Aneesh Kumar K.V" , atrajeev@linux.vnet.ibm.com, Vaibhav Jain , Thomas Gleixner , Linux MM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: iudpmxw9enj7nuiu87es4oswus57rh8d Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=intel-com.20210112.gappssmtp.com header.s=20210112 header.b=c1eIS7vo; spf=none (imf27.hostedemail.com: domain of dan.j.williams@intel.com has no SPF policy when checking 209.85.210.180) smtp.mailfrom=dan.j.williams@intel.com; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=intel.com (policy=none) X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 732B540018 X-HE-Tag: 1647913517-196042 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Mar 21, 2022 at 2:39 PM Dan Williams wro= te: > > On Fri, Mar 18, 2022 at 4:42 AM Kajol Jain wrote: > > > > The following build failure occures when CONFIG_PERF_EVENTS is not set > > as generic pmu functions are not visible in that scenario. > > > > arch/powerpc/platforms/pseries/papr_scm.c:372:35: error: =E2=80=98struc= t perf_event=E2=80=99 has no member named =E2=80=98attr=E2=80=99 > > p->nvdimm_events_map[event->attr.config], > > ^~ > > In file included from ./include/linux/list.h:5, > > from ./include/linux/kobject.h:19, > > from ./include/linux/of.h:17, > > from arch/powerpc/platforms/pseries/papr_scm.c:5: > > arch/powerpc/platforms/pseries/papr_scm.c: In function =E2=80=98papr_sc= m_pmu_event_init=E2=80=99: > > arch/powerpc/platforms/pseries/papr_scm.c:389:49: error: =E2=80=98struc= t perf_event=E2=80=99 has no member named =E2=80=98pmu=E2=80=99 > > struct nvdimm_pmu *nd_pmu =3D to_nvdimm_pmu(event->pmu); > > ^~ > > ./include/linux/container_of.h:18:26: note: in definition of macro =E2= =80=98container_of=E2=80=99 > > void *__mptr =3D (void *)(ptr); \ > > ^~~ > > arch/powerpc/platforms/pseries/papr_scm.c:389:30: note: in expansion of= macro =E2=80=98to_nvdimm_pmu=E2=80=99 > > struct nvdimm_pmu *nd_pmu =3D to_nvdimm_pmu(event->pmu); > > ^~~~~~~~~~~~~ > > In file included from ./include/linux/bits.h:22, > > from ./include/linux/bitops.h:6, > > from ./include/linux/of.h:15, > > from arch/powerpc/platforms/pseries/papr_scm.c:5: > > > > Fix the build issue by adding check for CONFIG_PERF_EVENTS config optio= n > > and disabling the papr_scm perf interface support incase this config > > is not set > > > > Fixes: 4c08d4bbc089 ("powerpc/papr_scm: Add perf interface support") (C= ommit id > > based on linux-next tree) > > Signed-off-by: Kajol Jain > > --- > > arch/powerpc/platforms/pseries/papr_scm.c | 15 +++++++++++++++ > > This is a bit messier than I would have liked mainly because it dumps > a bunch of ifdefery into a C file contrary to coding style, "Wherever > possible, don't use preprocessor conditionals (#if, #ifdef) in .c > files". I would expect this all to move to an organization like: > > arch/powerpc/platforms/pseries/papr_scm/main.c > arch/powerpc/platforms/pseries/papr_scm/perf.c > > ...and a new config symbol like: > > config PAPR_SCM_PERF > depends on PAPR_SCM && PERF_EVENTS > def_bool y > > ...with wrappers in header files to make everything compile away > without any need for main.c to carry an ifdef. > > Can you turn a patch like that in the next couple days? Otherwise, I > think if Linus saw me sending a late breaking compile fix that threw > coding style out the window he'd have cause to just drop the pull > request entirely. Also, please base it on the current state of the libnvdimm-for-next branch as -next includes some of the SMART health changes leading to at least one conflict.