iio: common: ssp_sensors: Use __packed instead of __packed__
PATCH 1/1 iio: common: ssp_sensors: Use __packed instead of __packed__
Sparse can't recognise __packed__ attribute:
.../ssp_sensors/ssp_dev.c:30:3: warning: symbol '__packed__' was not declared. Should it be static?
Use __packed instead of __packed__ to make sparse happy
--- drivers/iio/common/ssp_sensors/ssp_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/common/ssp_sensors/ssp_dev.c +1 -1
@@ -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 ,
Signature · 1 line
2.50.1
Jonathan Cameron
maintainerQuoted 7 lines · On Fri, 27 Nov 2026 12:58:52 +0100 Andy Shevchenko…
Sparse can't recognise
__packed__attribute:
.../ssp_sensors/ssp_dev.c:30:3: warning: symbol '__packed__' was not declared. Should it be static?Use
__packedinstead of__packed__to make sparse happySigned-off-by Andy Shevchenko <[email protected]>
https://sashiko.dev/#/patchset/20261127115852.1720736-1-andriy.shevchenko%40linux.intel.com
I'd been meaning to look into this warning. Seems rather nastier than simply confusing sparse.
Is sashiko right?
Jonathan
Quoted 17 lines
--- drivers/iio/common/ssp_sensors/ssp_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/common/ssp_sensors/ssp_dev.c +1
-1@@ -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 ,
Quoted 9 lines · Jonathan Cameron
Quoted 6 lines · On Fri, 27 Nov 2026 12:58:52 +0100 Andy Shevchenko…
Sparse can't recognise
__packed__attribute:
.../ssp_sensors/ssp_dev.c:30:3: warning: symbol '__packed__' was not declared. Should it be static?Use
__packedinstead of__packed__to make sparse happy
Quoted 7 lines
Quoted 1 line
Signed-off-by Andy Shevchenko <[email protected]>https://sashiko.dev/#/patchset/20261127115852.1720736-1-andriy.shevchenko%40linux.intel.com
I'd been meaning to look into this warning. Seems rather nastier than simply confusing sparse.
Is sashiko right?
Ha, Sashiko is semi-right, this is a regression that my patch actually fixes! I will send a v2 with an amended commit message and necessary tags.
Signature · 2 lines
With Best Regards, Andy Shevchenko