]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
staging: greybus: Inline gb_audio_manager_module()
authorSumitra Sharma <sumitraartsy@gmail.com>
Sat, 25 Mar 2023 08:31:06 +0000 (01:31 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Mar 2023 08:54:52 +0000 (09:54 +0100)
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@gmail.com>
Link: https://lore.kernel.org/r/7470bf9d9a57e8bf27e55bd5e3791c5e0ee31385.1679732179.git.sumitraartsy@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/greybus/audio_manager_module.c

index 81b4ba607a0e1767deb89f6d479d7cc50f4c5e3b..5f9dcbdbc191870434fe4b0247f548cf46de5148 100644 (file)
 
 #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;