* [PATCH] fix:iio:common:st_sensors:st_sensors_trigger:mark symbols static where possible
@ 2016-08-27 6:26 Baoyou Xie
2016-08-27 8:44 ` Linus Walleij
0 siblings, 1 reply; 3+ messages in thread
From: Baoyou Xie @ 2016-08-27 6:26 UTC (permalink / raw)
To: jic23, lars, pmeerw
Cc: linus.walleij, rob, maitysanchayan, baoyou.xie, leonard.crestez,
gregor.boirie, linux-iio, linux-kernel, arnd, xie.baoyou
We get 2 warnings when biuld kernel with W=1:
drivers/iio/common/st_sensors/st_sensors_trigger.c:69:13: warning: no previous prototype
for 'st_sensors_irq_handler' [-Wmissing-prototypes]
drivers/iio/common/st_sensors/st_sensors_trigger.c:85:13: warning: no previous prototype
for 'st_sensors_irq_thread' [-Wmissing-prototypes]
In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
so this patch marks these functions with 'static'.
Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
---
drivers/iio/common/st_sensors/st_sensors_trigger.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/common/st_sensors/st_sensors_trigger.c b/drivers/iio/common/st_sensors/st_sensors_trigger.c
index e66f12e..fa73e67 100644
--- a/drivers/iio/common/st_sensors/st_sensors_trigger.c
+++ b/drivers/iio/common/st_sensors/st_sensors_trigger.c
@@ -66,7 +66,7 @@ static int st_sensors_new_samples_available(struct iio_dev *indio_dev,
* @irq: irq number
* @p: private handler data
*/
-irqreturn_t st_sensors_irq_handler(int irq, void *p)
+static irqreturn_t st_sensors_irq_handler(int irq, void *p)
{
struct iio_trigger *trig = p;
struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig);
@@ -82,7 +82,7 @@ irqreturn_t st_sensors_irq_handler(int irq, void *p)
* @irq: irq number
* @p: private handler data
*/
-irqreturn_t st_sensors_irq_thread(int irq, void *p)
+static irqreturn_t st_sensors_irq_thread(int irq, void *p)
{
struct iio_trigger *trig = p;
struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig);
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fix:iio:common:st_sensors:st_sensors_trigger:mark symbols static where possible
2016-08-27 6:26 [PATCH] fix:iio:common:st_sensors:st_sensors_trigger:mark symbols static where possible Baoyou Xie
@ 2016-08-27 8:44 ` Linus Walleij
2016-08-29 19:13 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2016-08-27 8:44 UTC (permalink / raw)
To: Baoyou Xie
Cc: Jonathan Cameron, Lars-Peter Clausen, Peter Meerwald-Stadler,
rob, maitysanchayan, Crestez Dan Leonard, Gregor Boirie,
linux-iio, linux-kernel, Arnd Bergmann, xie.baoyou
On Sat, Aug 27, 2016 at 8:26 AM, Baoyou Xie <baoyou.xie@linaro.org> wrote:
> We get 2 warnings when biuld kernel with W=1:
> drivers/iio/common/st_sensors/st_sensors_trigger.c:69:13: warning: no previous prototype
> for 'st_sensors_irq_handler' [-Wmissing-prototypes]
> drivers/iio/common/st_sensors/st_sensors_trigger.c:85:13: warning: no previous prototype
> for 'st_sensors_irq_thread' [-Wmissing-prototypes]
>
> In fact, these functions are only used in the file in which they are
> declared and don't need a declaration, but can be made static.
> so this patch marks these functions with 'static'.
>
> Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix:iio:common:st_sensors:st_sensors_trigger:mark symbols static where possible
2016-08-27 8:44 ` Linus Walleij
@ 2016-08-29 19:13 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2016-08-29 19:13 UTC (permalink / raw)
To: Linus Walleij, Baoyou Xie
Cc: Lars-Peter Clausen, Peter Meerwald-Stadler, rob, maitysanchayan,
Crestez Dan Leonard, Gregor Boirie, linux-iio, linux-kernel,
Arnd Bergmann, xie.baoyou
On 27/08/16 09:44, Linus Walleij wrote:
> On Sat, Aug 27, 2016 at 8:26 AM, Baoyou Xie <baoyou.xie@linaro.org> wrote:
>
>> We get 2 warnings when biuld kernel with W=1:
>> drivers/iio/common/st_sensors/st_sensors_trigger.c:69:13: warning: no previous prototype
>> for 'st_sensors_irq_handler' [-Wmissing-prototypes]
>> drivers/iio/common/st_sensors/st_sensors_trigger.c:85:13: warning: no previous prototype
>> for 'st_sensors_irq_thread' [-Wmissing-prototypes]
>>
>> In fact, these functions are only used in the file in which they are
>> declared and don't need a declaration, but can be made static.
>> so this patch marks these functions with 'static'.
>>
>> Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Applied to the togreg branch of iio.git. Initially pushed out
as testing for the autobuilders to play with it.
Thanks,
Jonathan
>
> Yours,
> Linus Walleij
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-08-29 19:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-27 6:26 [PATCH] fix:iio:common:st_sensors:st_sensors_trigger:mark symbols static where possible Baoyou Xie
2016-08-27 8:44 ` Linus Walleij
2016-08-29 19:13 ` Jonathan Cameron
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.