From: Sumitra Sharma <sumitraartsy@gmail.com>
To: outreachy@lists.linux.dev
Cc: johan@kernel.org, elder@kernel.org, gregkh@linuxfoundation.org,
greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org,
Sumitra Sharma <sumitraartsy@gmail.com>
Subject: [PATCH 1/3] Staging: greybus: Convert macro gpio_chip_to_gb_gpio_controller to an inline function
Date: Thu, 23 Mar 2023 02:03:34 -0700 [thread overview]
Message-ID: <92e39b9957a1863d13fc5ce9e346e99c68550fa3.1679558269.git.sumitraartsy@gmail.com> (raw)
In-Reply-To: <cover.1679558269.git.sumitraartsy@gmail.com>
Convert 'gpio_chip_to_gb_gpio_controller' 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>
---
drivers/staging/greybus/gpio.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c
index d729b922a750..2a115a8fc263 100644
--- a/drivers/staging/greybus/gpio.c
+++ b/drivers/staging/greybus/gpio.c
@@ -41,8 +41,11 @@ struct gb_gpio_controller {
struct irq_chip irqc;
struct mutex irq_lock;
};
-#define gpio_chip_to_gb_gpio_controller(chip) \
- container_of(chip, struct gb_gpio_controller, chip)
+
+static inline struct gb_gpio_controller *gpio_chip_to_gb_gpio_controller(struct gpio_chip *chip)
+{
+ return container_of(chip, struct gb_gpio_controller, chip);
+}
static struct gpio_chip *irq_data_to_gpio_chip(struct irq_data *d)
{
--
2.25.1
next prev parent reply other threads:[~2023-03-23 9:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-23 9:01 [PATCH 0/3] Staging: greybus: Convert macro definitions to Sumitra Sharma
2023-03-23 9:03 ` Sumitra Sharma [this message]
2023-03-23 9:03 ` [PATCH 2/3] Staging: greybus: Convert macro struct gb_audio_manager_module to an inline function Sumitra Sharma
2023-03-23 9:03 ` [PATCH 3/3] Staging: greybus: Convert macro struct pwm_chip_to_gb_pwm_chip " Sumitra Sharma
2023-03-23 17:36 ` [PATCH 0/3] Staging: greybus: Convert macro definitions to Alison Schofield
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=92e39b9957a1863d13fc5ce9e346e99c68550fa3.1679558269.git.sumitraartsy@gmail.com \
--to=sumitraartsy@gmail.com \
--cc=elder@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=greybus-dev@lists.linaro.org \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=outreachy@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®