lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200401190810.7a2cfa07@canb.auug.org.au>
Date:   Wed, 1 Apr 2020 19:08:10 +1100
From:   Stephen Rothwell <sfr@...b.auug.org.au>
To:     Linus Walleij <linus.walleij@...aro.org>
Cc:     Thierry Reding <treding@...dia.com>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Linux Next Mailing List <linux-next@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [PATCH] gpio: turn of_pinctrl_get() into a static inline

This avoids the overheads of an EXPORTed function.

Suggested-by: Geert Uytterhoeven <geert@...ux-m68k.org>
Signed-off-by: Stephen Rothwell <sfr@...b.auug.org.au>
---
 drivers/pinctrl/devicetree.c    | 6 ------
 include/linux/pinctrl/pinctrl.h | 9 +++------
 2 files changed, 3 insertions(+), 12 deletions(-)

This is not even build tested, but is this what you meant, Geert?

diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c
index c6fe7d64c913..61abff89e5f8 100644
--- a/drivers/pinctrl/devicetree.c
+++ b/drivers/pinctrl/devicetree.c
@@ -99,12 +99,6 @@ static int dt_remember_or_free_map(struct pinctrl *p, const char *statename,
 	return -ENOMEM;
 }
 
-struct pinctrl_dev *of_pinctrl_get(struct device_node *np)
-{
-	return get_pinctrl_dev_from_of_node(np);
-}
-EXPORT_SYMBOL_GPL(of_pinctrl_get);
-
 static int dt_to_map_one_config(struct pinctrl *p,
 				struct pinctrl_dev *hog_pctldev,
 				const char *statename,
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index 2aef59df93d7..e7b5cd5e1b10 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -186,15 +186,12 @@ extern int pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
 				const char *pin_group, const unsigned **pins,
 				unsigned *num_pins);
 
-#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PINCTRL)
-extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np);
-#else
-static inline
-struct pinctrl_dev *of_pinctrl_get(struct device_node *np)
+static inline struct pinctrl_dev *of_pinctrl_get(struct device_node *np)
 {
+	if (IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PINCTRL))
+		return get_pinctrl_dev_from_of_node(np);
 	return NULL;
 }
-#endif /* CONFIG_OF */
 
 extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev);
 extern const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev);
-- 
2.26.0

-- 
Cheers,
Stephen Rothwell

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ