Re: [PATCH] staging: greybus: Remove unused macro

From: Greg KH

Date: Mon Jun 15 2026 - 04:04:32 EST


On Wed, May 27, 2026 at 11:00:38PM +0300, Michail Tatas wrote:
> Remove unused macro as indicated by the compiler
> when building with make W=2

W=2 even works for staging drivers? I wouldn't worry about that at all :)

> Signed-off-by: Michail Tatas <michail.tatas@xxxxxxxxx>
> ---
> drivers/staging/greybus/loopback.c | 26 --------------------------
> 1 file changed, 26 deletions(-)
>
> diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
> index 4d085d3cd471..7442b1c4e86c 100644
> --- a/drivers/staging/greybus/loopback.c
> +++ b/drivers/staging/greybus/loopback.c
> @@ -167,32 +167,6 @@ static DEVICE_ATTR_RO(name##_avg)
> gb_loopback_ro_stats_attr(field, max, u); \
> gb_loopback_ro_avg_attr(field)
>
> -#define gb_loopback_attr(field, type) \
> -static ssize_t field##_show(struct device *dev, \
> - struct device_attribute *attr, \
> - char *buf) \
> -{ \
> - struct gb_loopback *gb = dev_get_drvdata(dev); \
> - return sysfs_emit(buf, "%" #type "\n", gb->field); \
> -} \
> -static ssize_t field##_store(struct device *dev, \
> - struct device_attribute *attr, \
> - const char *buf, \
> - size_t len) \
> -{ \
> - int ret; \
> - struct gb_loopback *gb = dev_get_drvdata(dev); \
> - mutex_lock(&gb->mutex); \
> - ret = sscanf(buf, "%"#type, &gb->field); \
> - if (ret != 1) \
> - len = -EINVAL; \
> - else \
> - gb_loopback_check_attr(gb, bundle); \
> - mutex_unlock(&gb->mutex); \
> - return len; \
> -} \
> -static DEVICE_ATTR_RW(field)

I see why this is present, it makes it more uniform. That being said,
as it's not being used anywhere, I can understand the confusion even if
there is not any produced code difference at all.

I'll queue this up after -rc1 is out.

thanks,

greg k-h