Re: [PATCH v5 7/8] cxl/edac: Add CXL memory device memory sparing control feature

Alison Schofield
2025-05-19T21:01:35Z

On Thu, May 15, 2025 at 12:59:23PM +0100, shiju.jose@huawei.com wrote:
> From: Shiju Jose <shiju.jose@huawei.com>
>

snip

> diff --git a/drivers/cxl/core/edac.c b/drivers/cxl/core/edac.c
> index 489c9996bfbc..395d56457931 100644
> --- a/drivers/cxl/core/edac.c
> +++ b/drivers/cxl/core/edac.c
> @@ -21,7 +21,17 @@
> #include "core.h"
> #include "trace.h"
>
> -#define CXL_NR_EDAC_DEV_FEATURES 2
> +#define CXL_NR_EDAC_DEV_FEATURES 6
> +
> +static bool cxl_is_memdev_memory_online(const struct cxl_memdev *cxlmd)
> +{
> + struct cxl_port *port = cxlmd->endpoint;
> +
> + if (port && cxl_num_decoders_committed(port))
> + return true;
> +
> + return false;
> +}
>

Looks like above fcn needs to be inside the below #ifdef.
Smatch is warning this when EDAC_SCRUB is off

drivers/cxl/core/edac.c:27:13: warning: ‘cxl_is_memdev_memory_online’ defined but not used [-Wunused-function]
27 | static bool cxl_is_memdev_memory_online(const struct cxl_memdev *cxlmd)

> #ifdef CONFIG_CXL_EDAC_SCRUB

snip to end.