Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4604720pxj; Tue, 25 May 2021 11:45:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnvEohuP+vMr1d1ir056blfpBA5yedu1iVc5LjxadZRmOH3C6DJzw646kAihHBcBPxI3Hh X-Received: by 2002:a05:6638:344e:: with SMTP id q14mr34573664jav.47.1621968349644; Tue, 25 May 2021 11:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621968349; cv=none; d=google.com; s=arc-20160816; b=cdIcSbZkrICXAmuDc1AfVdugYFd7MokPIopVNTZggZbkKOktv7OHq4cx47/JA6RDZv w8qFRE6xhMwmvHbkzdnctb6v+LrPH9eMSMvhovC2U+c3qzsb2rub0DdbV2s084FNP3n3 kq3Ol+KxoaB1Qq6Q8cxyp+96mMKkW02Gz/6AKNP3jmcjSEX4BGAPJFfFXTda9wkP7qBz R1GjNGnpOyW6xjqowiXW4zXfatdenMyKRDdPLthoPyF4/5QYbaELdIRFoeTCtzjR/7IB oZdPNXSLuCol45MkLsnilttTHYj+NhvQcUIC53qJQ4RQqrlAz2QjSc1wXtYk9i9cZhOz +Kyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:user-agent:from:references:in-reply-to:mime-version :dkim-signature; bh=rJ15/M9nlVKr6ZEwr5KeSZUGRGIjK4uwwMnv6h7U550=; b=n6CI+9FqGPkAsjBH9ym2FopM1LW0lZFswY/4yAVYF1ZF/pS2WLXd8cj4lrBGBqzEeJ 6wVNMjq/fdLHpI/XC/rGoS3chqmtyPOf47VrHaDYGVmkCggWdJI00tFw6tXK9mY+TN6m CzyuWghGjHq5alDHqqRYrC0oItlnEARQnMn6FrZTv3Ozgg5S+1z3k74PH0rlgIGvN+mI 8zxdvIBrbQXPU/rz1VYqgXUUn3U9LBxMk2944sdHCg+IZbbmti4dhA+VvvyOtexT9ZDM X5JtD9NKsMtpJpRCvKYuH6Wiivk8jIt3xwE4jQmKxZ52Bas/py0Pd+7iyhmBNdZsEB70 INFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=R1crsP+s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j20si17075138ilo.56.2021.05.25.11.45.33; Tue, 25 May 2021 11:45:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=R1crsP+s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232226AbhEYSXc (ORCPT + 99 others); Tue, 25 May 2021 14:23:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231707AbhEYSX2 (ORCPT ); Tue, 25 May 2021 14:23:28 -0400 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77F0AC061574 for ; Tue, 25 May 2021 11:21:56 -0700 (PDT) Received: by mail-ot1-x335.google.com with SMTP id 80-20020a9d08560000b0290333e9d2b247so18935787oty.7 for ; Tue, 25 May 2021 11:21:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc:content-transfer-encoding; bh=rJ15/M9nlVKr6ZEwr5KeSZUGRGIjK4uwwMnv6h7U550=; b=R1crsP+shdHhiuseCe6QdWzpIsPvxDthEh9r+eshbiydRyuQnGQfkwsJN8pgFBh0/U T1zZGxTJDkgH3aXyrLrwiCe/lRugtgvUphoVbQVxE6hEF6WOaNASL+wtiAA2EItf05Sw mU9z3JMZASewA3k9Izo1mrzUwPnQ4qoA3ECAM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc:content-transfer-encoding; bh=rJ15/M9nlVKr6ZEwr5KeSZUGRGIjK4uwwMnv6h7U550=; b=cpr1Usd6gWAvdgBEszyPZP8YoG49vxsoWdgMMAI9aRXA/XWfeOCoHFI0R5NBGVloGP YYyvCQxq6FMsO50sb5ScMyIckdV71T313pmHjIGHHaNyk5orqkRhH4Naeom6NhrDGvSj LDzHIylXa0eXgL3w6Zlg4OriuJWprGQFTFcAB9simw+9rVD/OKsrV7Ng1J1nbccCsPS7 /8Qve9r9mJd/W4rxUMJdD7vEl6w3MRl7lN5vOC+LJW6EGvC46J7Nm7KybsW0rJo/9JaD an0UMgtirspoPo9ZVYA9E4rv9myZnNzg1k3rQB4/Qq4xRXznMiko0wml8olArYe8ilYJ QbLw== X-Gm-Message-State: AOAM531ptyhzTMX85weegdwjLdWp000KlQh+NlyjgOeF6h3Li20CyYX7 DDxGuHaIkquui3UQ09Z/HFAdWcWpqfdIkgbPSqHOsA== X-Received: by 2002:a05:6830:1556:: with SMTP id l22mr24015712otp.34.1621966915846; Tue, 25 May 2021 11:21:55 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 25 May 2021 14:21:55 -0400 MIME-Version: 1.0 In-Reply-To: <20210525105049.34804-1-cuibixuan@huawei.com> References: <20210525105049.34804-1-cuibixuan@huawei.com> From: Stephen Boyd User-Agent: alot/0.9.1 Date: Tue, 25 May 2021 14:21:55 -0400 Message-ID: Subject: Re: [PATCH -next v2] module: fix build error when CONFIG_SYSFS is disabled To: Bixuan Cui , jeyu@kernel.org Cc: sfr@canb.auug.org.au, akpm@linux-foundation.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Bixuan Cui (2021-05-25 03:50:49) > Fix build error when disable CONFIG_SYSFS: > kernel/module.c:2805:8: error: implicit declaration of function =EF=BF=BD= =EF=BF=BD=EF=BF=BDsect_empty=EF=BF=BD=EF=BF=BD=EF=BF=BD; did you mean =EF= =BF=BD=EF=BF=BD=EF=BF=BDdesc_empty=EF=BF=BD=EF=BF=BD=EF=BF=BD? [-Werror=3Di= mplicit-function-declaration] > 2805 | if (!sect_empty(sechdr) && sechdr->sh_type =3D=3D SHT_NOTE && > > Fixes: 9ee6682aa528 ("module: add printk formats to add module build ID t= o stacktraces") > Reported-by: Hulk Robot > Signed-off-by: Bixuan Cui > Signed-off-by: Stephen Boyd Ok. The SoB chain is wrong but you may have my SoB. > --- > Changes from v2: > Put the sect_empty() definition outside of #ifdef CONFIG_SYSFS. > > kernel/module.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/kernel/module.c b/kernel/module.c > index decf4601e943..0543b44db81d 100644 > --- a/kernel/module.c > +++ b/kernel/module.c > @@ -1462,6 +1462,13 @@ resolve_symbol_wait(struct module *mod, > return ksym; > } > > +#ifdef CONFIG_KALLSYMS > +static inline bool sect_empty(const Elf_Shdr *sect) > +{ > + return !(sect->sh_flags & SHF_ALLOC) || sect->sh_size =3D=3D 0; > +} > +#endif > + > /* > * /sys/module/foo/sections stuff > * J. Corbet > @@ -1469,11 +1476,6 @@ resolve_symbol_wait(struct module *mod, > #ifdef CONFIG_SYSFS > > #ifdef CONFIG_KALLSYMS > -static inline bool sect_empty(const Elf_Shdr *sect) > -{ > - return !(sect->sh_flags & SHF_ALLOC) || sect->sh_size =3D=3D 0; > -} > - > struct module_sect_attr { > struct bin_attribute battr; > unsigned long address; > -- > 2.17.1 >