2023-05-17 09:01:45

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 1/1] cdx: Rename MCDI_LOGGING to CDX_MCDI_LOGGING

On Wed, May 17, 2023 at 02:14:03PM +0530, Abhijit Gangurde wrote:
> MCDI_LOGGING is too generic considering other MCDI users
> SFC_MCDI_LOGGING and SFC_SIENA_MCDI_LOGGING. Rename it to
> CDX_MCDI_LOGGING makes it more domain specific.
>
> Signed-off-by: Abhijit Gangurde <[email protected]>
> Suggested-by: Geert Uytterhoeven <[email protected]>
> ---
> drivers/cdx/controller/Kconfig | 2 +-
> drivers/cdx/controller/mcdi.c | 16 ++++++++--------
> drivers/cdx/controller/mcdi.h | 2 +-
> 3 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/cdx/controller/Kconfig b/drivers/cdx/controller/Kconfig
> index c3e3b9ff8dfe..e7014e9819ea 100644
> --- a/drivers/cdx/controller/Kconfig
> +++ b/drivers/cdx/controller/Kconfig
> @@ -18,7 +18,7 @@ config CDX_CONTROLLER
>
> If unsure, say N.
>
> -config MCDI_LOGGING
> +config CDX_MCDI_LOGGING

This is fine, but:

> bool "MCDI Logging for the CDX controller"
> depends on CDX_CONTROLLER
> help
> diff --git a/drivers/cdx/controller/mcdi.c b/drivers/cdx/controller/mcdi.c
> index a211a2ca762e..3a1fbc3d409e 100644
> --- a/drivers/cdx/controller/mcdi.c
> +++ b/drivers/cdx/controller/mcdi.c
> @@ -31,7 +31,7 @@ struct cdx_mcdi_copy_buffer {
> struct cdx_dword buffer[DIV_ROUND_UP(MCDI_CTL_SDU_LEN_MAX, 4)];
> };
>
> -#ifdef CONFIG_MCDI_LOGGING
> +#ifdef CONFIG_CDX_MCDI_LOGGING
> #define LOG_LINE_MAX (1024 - 32)
> #endif
>
> @@ -119,7 +119,7 @@ int cdx_mcdi_init(struct cdx_mcdi *cdx)
> mcdi = cdx_mcdi_if(cdx);
> mcdi->cdx = cdx;
>
> -#ifdef CONFIG_MCDI_LOGGING
> +#ifdef CONFIG_CDX_MCDI_LOGGING
> mcdi->logging_buffer = kmalloc(LOG_LINE_MAX, GFP_KERNEL);
> if (!mcdi->logging_buffer)
> goto fail2;

This mess of #ifdef in the .c files is not ok.

Please move all of this "logging" stuff out into proper .h definitions
so that it's not in the .c code at all.

thanks,

greg k-h


2023-05-24 07:17:18

by Gangurde, Abhijit

[permalink] [raw]
Subject: RE: [PATCH 1/1] cdx: Rename MCDI_LOGGING to CDX_MCDI_LOGGING

Hi Greg,

<snip>
> >
> > -#ifdef CONFIG_MCDI_LOGGING
> > +#ifdef CONFIG_CDX_MCDI_LOGGING
> > mcdi->logging_buffer = kmalloc(LOG_LINE_MAX, GFP_KERNEL);
> > if (!mcdi->logging_buffer)
> > goto fail2;
>
> This mess of #ifdef in the .c files is not ok.
>
> Please move all of this "logging" stuff out into proper .h definitions
> so that it's not in the .c code at all.
>

Sure, will cleanup the #ifdefs in c file.
Will also update logging to be controlled by sysfs in next spin.

> thanks,
>
> greg k-h