Re: [PATCH 3/8] cxl/memfeature: Add CXL memory device ECS control feature
From: Alison Schofield
Date: Fri Mar 07 2025 - 20:48:30 EST
On Thu, Feb 27, 2025 at 10:38:10PM +0000, shiju.jose@xxxxxxxxxx wrote:
> From: Shiju Jose <shiju.jose@xxxxxxxxxx>
snip
Next 2 macros have line continuation chars at 81 and 89.
Please pull into column 80 or less.
>
> +#define CXL_ECS_GET_ATTR(attrib) \
> +static int cxl_ecs_get_##attrib(struct device *dev, void *drv_data, \
> + int fru_id, u32 *val) \
> +{ \
> + struct cxl_ecs_context *ctx = drv_data; \
> + struct cxl_ecs_params params; \
> + int ret; \
> + \
> + ret = cxl_mem_ecs_get_attrs(dev, ctx, fru_id, ¶ms); \
> + if (ret) \
> + return ret; \
> + \
> + *val = params.attrib; \
> + \
> + return 0; \
> +}
> +
> +CXL_ECS_GET_ATTR(log_entry_type)
> +CXL_ECS_GET_ATTR(count_mode)
> +CXL_ECS_GET_ATTR(threshold)
> +
> +#define CXL_ECS_SET_ATTR(attrib, param_type) \
> +static int cxl_ecs_set_##attrib(struct device *dev, void *drv_data, \
> + int fru_id, u32 val) \
> +{ \
> + struct cxl_ecs_context *ctx = drv_data; \
> + struct cxl_ecs_params params = { \
> + .attrib = val, \
> + }; \
> + \
> + return cxl_mem_ecs_set_attrs(dev, ctx, fru_id, ¶ms, (param_type)); \
> +}
snip