Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH] staging: greybus: Remove unused macro
@ 2026-05-27 20:00 Michail Tatas
  2026-06-15  7:56 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Michail Tatas @ 2026-05-27 20:00 UTC (permalink / raw)
  To: pure.logic, johan, elder, gregkh; +Cc: greybus-dev, linux-staging, linux-kernel

Remove unused macro as indicated by the compiler
when building with make W=2

Signed-off-by: Michail Tatas <michail.tatas@gmail.com>
---
 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)
-
 #define gb_dev_loopback_ro_attr(field)				\
 static ssize_t field##_show(struct device *dev,		\
 			    struct device_attribute *attr,		\
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: greybus: Remove unused macro
  2026-05-27 20:00 [PATCH] staging: greybus: Remove unused macro Michail Tatas
@ 2026-06-15  7:56 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2026-06-15  7:56 UTC (permalink / raw)
  To: Michail Tatas
  Cc: pure.logic, johan, elder, greybus-dev, linux-staging,
	linux-kernel

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@gmail.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-15  7:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-27 20:00 [PATCH] staging: greybus: Remove unused macro Michail Tatas
2026-06-15  7:56 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox