* [PATCH] drivers: reset: Mark function as static in core.c
@ 2013-12-14 13:26 Rashika Kheria
2013-12-14 14:15 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Rashika Kheria @ 2013-12-14 13:26 UTC (permalink / raw)
To: linux-kernel
Cc: Philipp Zabel, Pavel Machek, Stephen Warren, Dan Carpenter,
Rashika Kheria, josh
This patch marks the function of_reset_simple_xlate() and
devm_reset_control_put() as static in core.c because it is not used
outside this file.
Thus, it also eliminate the following warnings in core.c:
drivers/reset/core.c:46:5: warning: no previous prototype for ‘of_reset_simple_xlate’ [-Wmissing-prototypes]
drivers/reset/core.c:262:6: warning: no previous prototype for ‘devm_reset_control_put’ [-Wmissing-prototypes]
Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
---
drivers/reset/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/reset/core.c b/drivers/reset/core.c
index d1b6089..8604053 100644
--- a/drivers/reset/core.c
+++ b/drivers/reset/core.c
@@ -43,7 +43,7 @@ struct reset_control {
* This simple translation function should be used for reset controllers
* with 1:1 mapping, where reset lines can be indexed by number without gaps.
*/
-int of_reset_simple_xlate(struct reset_controller_dev *rcdev,
+static int of_reset_simple_xlate(struct reset_controller_dev *rcdev,
const struct of_phandle_args *reset_spec)
{
if (WARN_ON(reset_spec->args_count != rcdev->of_reset_n_cells))
@@ -259,7 +259,7 @@ static int devm_reset_control_match(struct device *dev, void *res, void *data)
* This function will not need to be called normally, as devres will take
* care of freeing the resource.
*/
-void devm_reset_control_put(struct reset_control *rstc)
+static void devm_reset_control_put(struct reset_control *rstc)
{
int ret;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drivers: reset: Mark function as static in core.c
2013-12-14 13:26 [PATCH] drivers: reset: Mark function as static in core.c Rashika Kheria
@ 2013-12-14 14:15 ` Dan Carpenter
2013-12-14 20:56 ` Josh Triplett
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2013-12-14 14:15 UTC (permalink / raw)
To: Rashika Kheria, Philipp Zabel
Cc: linux-kernel, Pavel Machek, Stephen Warren, josh
On Sat, Dec 14, 2013 at 06:56:10PM +0530, Rashika Kheria wrote:
> This patch marks the function of_reset_simple_xlate() and
> devm_reset_control_put() as static in core.c because it is not used
> outside this file.
>
> Thus, it also eliminate the following warnings in core.c:
> drivers/reset/core.c:46:5: warning: no previous prototype for ‘of_reset_simple_xlate’ [-Wmissing-prototypes]
> drivers/reset/core.c:262:6: warning: no previous prototype for ‘devm_reset_control_put’ [-Wmissing-prototypes]
>
These are EXPORT_SYMBOL_GPL() so that doesn't make sense.
devm_reset_control_put() is not used at all and of_reset_simple_xlate()
doesn't look like it needs to be exported. Philipp?
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drivers: reset: Mark function as static in core.c
2013-12-14 14:15 ` Dan Carpenter
@ 2013-12-14 20:56 ` Josh Triplett
2013-12-14 21:37 ` Philipp Zabel
0 siblings, 1 reply; 4+ messages in thread
From: Josh Triplett @ 2013-12-14 20:56 UTC (permalink / raw)
To: Dan Carpenter
Cc: Rashika Kheria, Philipp Zabel, linux-kernel, Pavel Machek,
Stephen Warren
On Sat, Dec 14, 2013 at 05:15:34PM +0300, Dan Carpenter wrote:
> On Sat, Dec 14, 2013 at 06:56:10PM +0530, Rashika Kheria wrote:
> > This patch marks the function of_reset_simple_xlate() and
> > devm_reset_control_put() as static in core.c because it is not used
> > outside this file.
> >
> > Thus, it also eliminate the following warnings in core.c:
> > drivers/reset/core.c:46:5: warning: no previous prototype for ‘of_reset_simple_xlate’ [-Wmissing-prototypes]
> > drivers/reset/core.c:262:6: warning: no previous prototype for ‘devm_reset_control_put’ [-Wmissing-prototypes]
> >
>
> These are EXPORT_SYMBOL_GPL() so that doesn't make sense.
> devm_reset_control_put() is not used at all and of_reset_simple_xlate()
> doesn't look like it needs to be exported. Philipp?
That sounds like the right fix to me: drop devm_reset_control_put and
its export completely, and drop the export of make
of_reset_simple_xlate. Unless there's some relevant out-of-tree caller
of either function, that seems sensible.
- Josh Triplett
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drivers: reset: Mark function as static in core.c
2013-12-14 20:56 ` Josh Triplett
@ 2013-12-14 21:37 ` Philipp Zabel
0 siblings, 0 replies; 4+ messages in thread
From: Philipp Zabel @ 2013-12-14 21:37 UTC (permalink / raw)
To: Josh Triplett
Cc: Dan Carpenter, Rashika Kheria, Philipp Zabel, linux-kernel,
Pavel Machek, Stephen Warren
On Sat, Dec 14, 2013 at 12:56:57PM -0800, Josh Triplett wrote:
> On Sat, Dec 14, 2013 at 05:15:34PM +0300, Dan Carpenter wrote:
> > On Sat, Dec 14, 2013 at 06:56:10PM +0530, Rashika Kheria wrote:
> > > This patch marks the function of_reset_simple_xlate() and
> > > devm_reset_control_put() as static in core.c because it is not used
> > > outside this file.
> > >
> > > Thus, it also eliminate the following warnings in core.c:
> > > drivers/reset/core.c:46:5: warning: no previous prototype for ‘of_reset_simple_xlate’ [-Wmissing-prototypes]
> > > drivers/reset/core.c:262:6: warning: no previous prototype for ‘devm_reset_control_put’ [-Wmissing-prototypes]
> > >
> >
> > These are EXPORT_SYMBOL_GPL() so that doesn't make sense.
> > devm_reset_control_put() is not used at all and of_reset_simple_xlate()
> > doesn't look like it needs to be exported. Philipp?
>
> That sounds like the right fix to me: drop devm_reset_control_put and
> its export completely, and drop the export of make
> of_reset_simple_xlate. Unless there's some relevant out-of-tree caller
> of either function, that seems sensible.
Yes, of_reset_simple_xlate() is used as default if the driver does not specify
the .of_xlate field of the rcdev parameter to reset_controller_register().
It does not need to be exported. This is analogous to of_gpio_simple_xlate.
devm_reset_control_put would be needed if a driver wanted to release
the reset control before the devres cleanup for some reason. I added
it for symmetry with devm_reset_control_get but forgot the header
prototypes.
If this is considered not useful, we should probably also review
devm_{clk,gpiod,phy,pinctrl,pwm,regulator,usb}_put.
regards
Philipp
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-12-14 21:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-14 13:26 [PATCH] drivers: reset: Mark function as static in core.c Rashika Kheria
2013-12-14 14:15 ` Dan Carpenter
2013-12-14 20:56 ` Josh Triplett
2013-12-14 21:37 ` Philipp Zabel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox