[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <f200046cde9d205904f3050718a3936ed813974f.1679642024.git.sumitraartsy@gmail.com>
Date: Fri, 24 Mar 2023 00:30:00 -0700
From: Sumitra Sharma <sumitraartsy@...il.com>
To: outreachy@...ts.linux.dev
Cc: johan@...nel.org, elder@...nel.org, gregkh@...uxfoundation.org,
greybus-dev@...ts.linaro.org, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org,
Sumitra Sharma <sumitraartsy@...il.com>
Subject: [PATCH v2 2/3] Staging: greybus: Use inline function for gb_audio_manager_module
Convert 'gb_audio_manager_module' 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@...il.com>
---
v2: Change patch subject, noted by Alison Schofield
<alison.schofield@...el.com>
drivers/staging/greybus/audio_manager_module.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c
index 81b4ba607a0e..5f9dcbdbc191 100644
--- a/drivers/staging/greybus/audio_manager_module.c
+++ b/drivers/staging/greybus/audio_manager_module.c
@@ -12,8 +12,11 @@
#define to_gb_audio_module_attr(x) \
container_of(x, struct gb_audio_manager_module_attribute, attr)
-#define to_gb_audio_module(x) \
- container_of(x, struct gb_audio_manager_module, kobj)
+
+static inline struct gb_audio_manager_module *to_gb_audio_module(struct kobject *kobj)
+{
+ return container_of(kobj, struct gb_audio_manager_module, kobj);
+}
struct gb_audio_manager_module_attribute {
struct attribute attr;
--
2.25.1
Powered by blists - more mailing lists