* [PATCH v4] Staging: nvec: Remove macro definition to_nvec_led
@ 2023-03-22 5:40 Sumitra Sharma
2023-03-24 22:10 ` Ira Weiny
0 siblings, 1 reply; 2+ messages in thread
From: Sumitra Sharma @ 2023-03-22 5:40 UTC (permalink / raw)
To: Marc Dietrich, Greg Kroah-Hartman, ac100, linux-tegra,
linux-staging, linux-kernel, outreachy
Remove definition 'to_nvec_led' because it is only used once.
Rewrite the code directly in the calling function
'nvec_led_brightness_set'.
Signed-off-by: Sumitra Sharma <sumitraartsy@gmail.com>
---
v2: Change patch subject and description, noted by
Julia Lawall <julia.lawall@inria.fr>
v3: Remove macro definition 'to_nvec_led'
Change subject and description,
noted by Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/nvec/nvec_paz00.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/staging/nvec/nvec_paz00.c b/drivers/staging/nvec/nvec_paz00.c
index 8b4da95081c8..55d59840fca4 100644
--- a/drivers/staging/nvec/nvec_paz00.c
+++ b/drivers/staging/nvec/nvec_paz00.c
@@ -14,9 +14,6 @@
#include <linux/platform_device.h>
#include "nvec.h"
-#define to_nvec_led(led_cdev) \
- container_of(led_cdev, struct nvec_led, cdev)
-
#define NVEC_LED_REQ {'\x0d', '\x10', '\x45', '\x10', '\x00'}
#define NVEC_LED_MAX 8
@@ -29,7 +26,7 @@ struct nvec_led {
static void nvec_led_brightness_set(struct led_classdev *led_cdev,
enum led_brightness value)
{
- struct nvec_led *led = to_nvec_led(led_cdev);
+ struct nvec_led *led = container_of(led_cdev, struct nvec_led, cdev);
unsigned char buf[] = NVEC_LED_REQ;
buf[4] = value;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v4] Staging: nvec: Remove macro definition to_nvec_led
2023-03-22 5:40 [PATCH v4] Staging: nvec: Remove macro definition to_nvec_led Sumitra Sharma
@ 2023-03-24 22:10 ` Ira Weiny
0 siblings, 0 replies; 2+ messages in thread
From: Ira Weiny @ 2023-03-24 22:10 UTC (permalink / raw)
To: Sumitra Sharma, Marc Dietrich, Greg Kroah-Hartman, ac100,
linux-tegra, linux-staging, linux-kernel, outreachy
Sumitra Sharma wrote:
> Remove definition 'to_nvec_led' because it is only used once.
> Rewrite the code directly in the calling function
> 'nvec_led_brightness_set'.
>
> Signed-off-by: Sumitra Sharma <sumitraartsy@gmail.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-24 22:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-22 5:40 [PATCH v4] Staging: nvec: Remove macro definition to_nvec_led Sumitra Sharma
2023-03-24 22:10 ` Ira Weiny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).