Linux IIO development
 help / color / mirror / Atom feed
* [PATCH v2 0/3] iio: Unify __packed use and fix a hidden regression
@ 2026-11-30 17:01 Andy Shevchenko
  2026-11-30 17:01 ` [PATCH v2 1/3] iio: common: ssp_sensors: Use __packed instead of __packed__ Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andy Shevchenko @ 2026-11-30 17:01 UTC (permalink / raw)
  To: linux-iio
  Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Andy Shevchenko

While checking the Sparse errors on IIO subsystem
(to make it sparse-error-free) I noticed a one issue
in ssp_sensors driver which appears to be a regression
that is fixed in patch 1. Patches 2 and 3 to unify the
style of __packed use over IIO subsystem.

In v2:
- added patches 2 & 3
- rewrote commit message of patch 1 (Jonathan, Sashiko)

Andy Shevchenko (3):
  iio: common: ssp_sensors: Use __packed instead of __packed__
  iio: chemical: ccs811: Use __packed shortcut for compiler attribute
  iio: chemical: sgp30: Use __packed shortcut for compiler attribute

 drivers/iio/chemical/ccs811.c            | 2 +-
 drivers/iio/chemical/sgp30.c             | 2 +-
 drivers/iio/common/ssp_sensors/ssp_dev.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.50.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/3] iio: common: ssp_sensors: Use __packed instead of __packed__
  2026-11-30 17:01 [PATCH v2 0/3] iio: Unify __packed use and fix a hidden regression Andy Shevchenko
@ 2026-11-30 17:01 ` Andy Shevchenko
  2026-11-30 17:01 ` [PATCH v2 2/3] iio: chemical: ccs811: Use __packed shortcut for compiler attribute Andy Shevchenko
  2026-11-30 17:01 ` [PATCH v2 3/3] iio: chemical: sgp30: " Andy Shevchenko
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2026-11-30 17:01 UTC (permalink / raw)
  To: linux-iio
  Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Andy Shevchenko

Sparse can't recognise __packed__ as compiler attribute:

  .../ssp_sensors/ssp_dev.c:30:3: warning: symbol '__packed__' was not declared. Should it be static?

Moreover it appears that the culprit commit (see Fixes tag below)
mistakenly used the non-existed keyword replacing the compiler attribute
with the exported variable named '__packed__'.

Use __packed instead of __packed__ to fix the regression and make
sparse happy.

Fixes: 74c3923344c6 ("iio: ssp_sensors: cleanup codestyle warning")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/common/ssp_sensors/ssp_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/common/ssp_sensors/ssp_dev.c b/drivers/iio/common/ssp_sensors/ssp_dev.c
index 40b658d39294..456d59dc53dd 100644
--- a/drivers/iio/common/ssp_sensors/ssp_dev.c
+++ b/drivers/iio/common/ssp_sensors/ssp_dev.c
@@ -27,7 +27,7 @@ struct ssp_instruction {
 	__le32 a;
 	__le32 b;
 	u8 c;
-} __packed__;
+} __packed;
 
 static const u8 ssp_magnitude_table[] = {110, 85, 171, 71, 203, 195, 0, 67,
 	208, 56, 175, 244, 206, 213, 0, 92, 250, 0, 55, 48, 189, 252, 171,
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/3] iio: chemical: ccs811: Use __packed shortcut for compiler attribute
  2026-11-30 17:01 [PATCH v2 0/3] iio: Unify __packed use and fix a hidden regression Andy Shevchenko
  2026-11-30 17:01 ` [PATCH v2 1/3] iio: common: ssp_sensors: Use __packed instead of __packed__ Andy Shevchenko
@ 2026-11-30 17:01 ` Andy Shevchenko
  2026-11-30 17:01 ` [PATCH v2 3/3] iio: chemical: sgp30: " Andy Shevchenko
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2026-11-30 17:01 UTC (permalink / raw)
  To: linux-iio
  Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Andy Shevchenko

Use __packed shortcut for __packed__ compiler attribute as it's
a common style in IIO subsystem and Linux kernel in general.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/chemical/ccs811.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/chemical/ccs811.c b/drivers/iio/chemical/ccs811.c
index d126ee12ffe5..d3fe8c512d2a 100644
--- a/drivers/iio/chemical/ccs811.c
+++ b/drivers/iio/chemical/ccs811.c
@@ -70,7 +70,7 @@ struct ccs811_reading {
 	u8 status;
 	u8 error;
 	__be16 raw_data;
-} __attribute__((__packed__));
+} __packed;
 
 struct ccs811_data {
 	struct i2c_client *client;
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 3/3] iio: chemical: sgp30: Use __packed shortcut for compiler attribute
  2026-11-30 17:01 [PATCH v2 0/3] iio: Unify __packed use and fix a hidden regression Andy Shevchenko
  2026-11-30 17:01 ` [PATCH v2 1/3] iio: common: ssp_sensors: Use __packed instead of __packed__ Andy Shevchenko
  2026-11-30 17:01 ` [PATCH v2 2/3] iio: chemical: ccs811: Use __packed shortcut for compiler attribute Andy Shevchenko
@ 2026-11-30 17:01 ` Andy Shevchenko
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2026-11-30 17:01 UTC (permalink / raw)
  To: linux-iio
  Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Andy Shevchenko

Use __packed shortcut for __packed__ compiler attribute as it's
a common style in IIO subsystem and Linux kernel in general.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/chemical/sgp30.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/chemical/sgp30.c b/drivers/iio/chemical/sgp30.c
index 379c1c4af8d8..2b60a033e219 100644
--- a/drivers/iio/chemical/sgp30.c
+++ b/drivers/iio/chemical/sgp30.c
@@ -82,7 +82,7 @@ struct sgp_version {
 struct sgp_crc_word {
 	__be16 value;
 	u8 crc8;
-} __attribute__((__packed__));
+} __packed;
 
 union sgp_reading {
 	u8 start;
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-30 17:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 17:01 [PATCH v2 0/3] iio: Unify __packed use and fix a hidden regression Andy Shevchenko
2026-11-30 17:01 ` [PATCH v2 1/3] iio: common: ssp_sensors: Use __packed instead of __packed__ Andy Shevchenko
2026-11-30 17:01 ` [PATCH v2 2/3] iio: chemical: ccs811: Use __packed shortcut for compiler attribute Andy Shevchenko
2026-11-30 17:01 ` [PATCH v2 3/3] iio: chemical: sgp30: " Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox