lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 25 Feb 2020 12:13:16 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Chen Zhou <chenzhou10@...wei.com>,
        Gayatri Kammela <gayatri.kammela@...el.com>
Cc:     Rajneesh Bhardwaj <rajneesh.bhardwaj@...el.com>,
        Vishwanath Somayaji <vishwanath.somayaji@...el.com>,
        Darren Hart <dvhart@...radead.org>,
        Andy Shevchenko <andy@...radead.org>,
        Platform Driver <platform-driver-x86@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] platform/x86: intel_pmc_core: fix build error
 without CONFIG_DEBUG_FS

On Thu, Feb 20, 2020 at 5:40 AM Chen Zhou <chenzhou10@...wei.com> wrote:
>
> If CONFIG_DEBUG_FS is n, build fails:
>
> drivers/platform/x86/intel_pmc_core.c: In function pmc_core_resume:
> drivers/platform/x86/intel_pmc_core.c:1327:3: error: implicit declaration of function pmc_core_slps0_display; did you mean pmc_core_is_pc10_failed? [-Werror=implicit-function-declaration]
>    pmc_core_slps0_display(pmcdev, dev, NULL);
>       ^~~~~~~~~~~~~~~~~~~~~~
>
> Function pmc_core_slps0_display() is responsible for displaying debug
> registers, which is under CONFIG_DEBUG_FS.
>
> Providing the static inline stub whenever CONFIG_DEBUG_FS is disabled
> to fix this. Function pmc_core_lpm_display() is the same.

Thank you for the patch, but I think it's not the right approach.
Basically we need to move those functions outside of #if
IS_ENABLED(CONFIG_DEBUG_FS).
(Move them upper).

Also I have noticed another issue in pmc_core_lpm_display(). It uses
tgl_lpm_maps directly. It shouldn't.

Cc: Gayatri.

Gayatri, care to fix?

> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Chen Zhou <chenzhou10@...wei.com>
> ---
>  drivers/platform/x86/intel_pmc_core.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/drivers/platform/x86/intel_pmc_core.c b/drivers/platform/x86/intel_pmc_core.c
> index f4a36fb..939f8e0 100644
> --- a/drivers/platform/x86/intel_pmc_core.c
> +++ b/drivers/platform/x86/intel_pmc_core.c
> @@ -1117,6 +1117,20 @@ static void pmc_core_dbgfs_register(struct pmc_dev *pmcdev)
>         }
>  }
>  #else
> +static inline void pmc_core_slps0_display(struct pmc_dev *pmcdev,
> +                                          struct device *dev,
> +                                          struct seq_file *s)
> +{
> +}
> +
> +static inline void pmc_core_lpm_display(struct pmc_dev *pmcdev,
> +                                        struct device *dev,
> +                                        struct seq_file *s, u32 offset,
> +                                        const char *str,
> +                                        const struct pmc_bit_map **maps)
> +{
> +}
> +
>  static inline void pmc_core_dbgfs_register(struct pmc_dev *pmcdev)
>  {
>  }
> --
> 2.7.4
>


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ