Skip to contentSkip to conversation

Staging: nvec: Remove macro definition to_nvec_led

PATCH In review Sumitra Sharma 2 participants 2 messages Mar 22, 2023 – Mar 24, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 Staging: nvec: Remove macro definition to_nvec_led

Remove definition 'to_nvec_led' because it is only used once. Rewrite the code directly in the calling function 'nvec_led_brightness_set'.

---

v2: Change patch subject and description, noted by Julia Lawall <[email protected]>

v3: Remove macro definition 'to_nvec_led'
Change subject and description,
noted by Greg Kroah-Hartman <[email protected]>

 drivers/staging/nvec/nvec_paz00.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/nvec/nvec_paz00.c +1 -4
index 8b4da95081c8..55d59840fca4 100644
@@ -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;
Signature · 1 line
2.25.1