linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Staging: nvec: Convert to_nvec_led from a macro to an inline function
@ 2023-03-18 17:52 Sumitra Sharma
  2023-03-20  5:39 ` Dan Carpenter
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sumitra Sharma @ 2023-03-18 17:52 UTC (permalink / raw)
  To: Marc Dietrich, Greg Kroah-Hartman, ac100, linux-tegra,
	linux-staging, linux-kernel, outreachy

Convert to_nvec_led from a macro to a static inline function, to make the
relevant types apparent in the definition and to benefit from the type
checking performed by the compiler at call sites.

Signed-off-by: Sumitra Sharma <sumitraartsy@gmail.com>
---

v2: Change patch subject and description, noted by 
Julia Lawall <julia.lawall@inria.fr> 

 drivers/staging/nvec/nvec_paz00.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/nvec/nvec_paz00.c b/drivers/staging/nvec/nvec_paz00.c
index 8b4da95081c8..9573ba762cdd 100644
--- a/drivers/staging/nvec/nvec_paz00.c
+++ b/drivers/staging/nvec/nvec_paz00.c
@@ -14,8 +14,10 @@
 #include <linux/platform_device.h>
 #include "nvec.h"
 
-#define to_nvec_led(led_cdev) \
-	container_of(led_cdev, struct nvec_led, cdev)
+static inline struct nvec_led *to_nvec_led(struct led_classdev *led_cdev)
+{
+	return container_of(led_cdev, struct nvec_led, cdev);
+}
 
 #define NVEC_LED_REQ {'\x0d', '\x10', '\x45', '\x10', '\x00'}
 
-- 
2.25.1


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

end of thread, other threads:[~2023-03-20 15:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-18 17:52 [PATCH v2] Staging: nvec: Convert to_nvec_led from a macro to an inline function Sumitra Sharma
2023-03-20  5:39 ` Dan Carpenter
2023-03-20  8:44   ` Sumitra Sharma
2023-03-20  8:58     ` Dan Carpenter
2023-03-20  9:07     ` Julia Lawall
2023-03-20 15:27 ` kernel test robot
2023-03-20 15:45 ` Greg Kroah-Hartman

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).