Skip to contentSkip to conversation

IIO: Clean up a couple of warnings that snuck in.

PATCH In review Jonathan Cameron 3 participants 6 messages Aug 7, 2022 – Aug 13, 2022

Subsystems (2)
lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

cover IIO: Clean up a couple of warnings that snuck in.

From: Jonathan Cameron <[email protected]>

I'm not sure how these slipped through my local tests and 0-day. These are definitely shown with W=1, perhaps not without that but IIO is generally W=1 clean.

Jonathan Cameron (2):
iio: test: Mark file local structure arrays static.
iio: light: cm32181: Mark the dev_pm_ops static.

 drivers/iio/light/cm32181.c         | 2 +-
 drivers/iio/test/iio-test-rescale.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.37.1
author maintainer
#1 lore raw

PATCH 1/2 iio: test: Mark file local structure arrays static.

From: Jonathan Cameron <[email protected]>

Warning cleanup:
drivers/iio/test/iio-test-rescale.c:32:30: warning: symbol 'scale_cases' was not declared. Should it be static? drivers/iio/test/iio-test-rescale.c:480:30: warning: symbol 'offset_cases' was not declared. Should it be static?

---
 drivers/iio/test/iio-test-rescale.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/test/iio-test-rescale.c +2 -2
index cc782ccff880..31ee55a6faed 100644
@@ -29,7 +29,7 @@ struct rescale_tc_data {
 	const char *expected_off;
 };
 
-const struct rescale_tc_data scale_cases[] = {
+static const struct rescale_tc_data scale_cases[] = {
 	/*
 	 * Typical use cases
 	 */
@@ -477,7 +477,7 @@ const struct rescale_tc_data scale_cases[] = {
 	},
 };
 
-const struct rescale_tc_data offset_cases[] = {
+static const struct rescale_tc_data offset_cases[] = {
 	/*
 	 * Typical use cases
 	 */
Signature · 1 line
2.37.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] iio: test: Mark file local structure arrays static.

Quoted 8 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Warning cleanup:
drivers/iio/test/iio-test-rescale.c:32:30: warning: symbol 'scale_cases' was not declared. Should it be static? drivers/iio/test/iio-test-rescale.c:480:30: warning: symbol 'offset_cases' was not declared. Should it be static?

Quoted 29 lines
---
 drivers/iio/test/iio-test-rescale.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/test/iio-test-rescale.c +2 -2
index cc782ccff880..31ee55a6faed 100644
@@ -29,7 +29,7 @@ struct rescale_tc_data {
 	const char *expected_off;
 };
 
-const struct rescale_tc_data scale_cases[] = {
+static const struct rescale_tc_data scale_cases[] = {
 	/*
 	 * Typical use cases
 	 */
@@ -477,7 +477,7 @@ const struct rescale_tc_data scale_cases[] = {
 	},
 };
 
-const struct rescale_tc_data offset_cases[] = {
+static const struct rescale_tc_data offset_cases[] = {
 	/*
 	 * Typical use cases
 	 */
Signature · 1 line
2.37.1
author maintainer
#3 lore raw

PATCH 2/2 iio: light: cm32181: Mark the dev_pm_ops static.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Only accessed from the local file.
Warning:
drivers/iio/light/cm32181.c:508:1: warning: symbol 'cm32181_pm_ops' was not declared. Should it be static?

Fixes 68c1b3dd5c48 ("iio: light: cm32181: Add PM support")
Cc Kai-Heng Feng <[email protected]>
---
 drivers/iio/light/cm32181.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/cm32181.c +1 -1
index edbe6a3138d0..001055d09750 100644
@@ -505,7 +505,7 @@ static int cm32181_resume(struct device *dev)
 					 cm32181->conf_regs[CM32181_REG_ADDR_CMD]);
 }
 
-DEFINE_SIMPLE_DEV_PM_OPS(cm32181_pm_ops, cm32181_suspend, cm32181_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(cm32181_pm_ops, cm32181_suspend, cm32181_resume);
 
 static const struct of_device_id cm32181_of_match[] = {
 	{ .compatible = "capella,cm3218" },
Signature · 1 line
2.37.1
Reviewed-by on the v1 series
#4 lore raw
In reply to Jonathan Cameron
Quoted 6 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

I'm not sure how these slipped through my local tests and 0-day. These are definitely shown with W=1, perhaps not without that but IIO is generally W=1 clean.

Quoted 11 lines

Jonathan Cameron (2):
iio: test: Mark file local structure arrays static.
iio: light: cm32181: Mark the dev_pm_ops static.

 drivers/iio/light/cm32181.c         | 2 +-
 drivers/iio/test/iio-test-rescale.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

--
2.37.1

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author maintainer Applied
#5 lore raw
Quoted 9 lines · On Mon, 8 Aug 2022 11:15:52 +0200 Andy Shevchenko <[email protected]>…
Quoted 6 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

I'm not sure how these slipped through my local tests and 0-day. These are definitely shown with W=1, perhaps not without that but IIO is generally W=1 clean.

Applied. Thanks,

Jonathan

Quoted 14 lines
Quoted 12 lines

Jonathan Cameron (2):
iio: test: Mark file local structure arrays static.
iio: light: cm32181: Mark the dev_pm_ops static.

 drivers/iio/light/cm32181.c         | 2 +-
 drivers/iio/test/iio-test-rescale.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

--
2.37.1