Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1471109 > unrolled thread
| Started by | Baoyou Xie <baoyou.xie@linaro.org> |
|---|---|
| First post | 2016-08-27 08:30 +0200 |
| Last post | 2016-08-29 21:20 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] fix:iio:common:st_sensors:st_sensors_trigger:mark symbols static where possible Baoyou Xie <baoyou.xie@linaro.org> - 2016-08-27 08:30 +0200
Re: [PATCH] fix:iio:common:st_sensors:st_sensors_trigger:mark symbols static where possible Linus Walleij <linus.walleij@linaro.org> - 2016-08-27 10:50 +0200
Re: [PATCH] fix:iio:common:st_sensors:st_sensors_trigger:mark symbols static where possible Jonathan Cameron <jic23@kernel.org> - 2016-08-29 21:20 +0200
| From | Baoyou Xie <baoyou.xie@linaro.org> |
|---|---|
| Date | 2016-08-27 08:30 +0200 |
| Subject | [PATCH] fix:iio:common:st_sensors:st_sensors_trigger:mark symbols static where possible |
| Message-ID | <saFhT-12j-7@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2016-08-27 10:50 +0200 |
| Subject | Re: [PATCH] fix:iio:common:st_sensors:st_sensors_trigger:mark symbols static where possible |
| Message-ID | <saHto-2iP-15@gated-at.bofh.it> |
| In reply to | #1471109 |
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
[toc] | [prev] | [next] | [standalone]
| From | Jonathan Cameron <jic23@kernel.org> |
|---|---|
| Date | 2016-08-29 21:20 +0200 |
| Subject | Re: [PATCH] fix:iio:common:st_sensors:st_sensors_trigger:mark symbols static where possible |
| Message-ID | <sbAgb-2S5-33@gated-at.bofh.it> |
| In reply to | #1471127 |
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 >
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web