[PATCH v2] iio: chemical: sgp30: fix checkpatch warn to prefer __packed

Adi Nata posted 1 patch 2 months ago
drivers/iio/chemical/sgp30.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v2] iio: chemical: sgp30: fix checkpatch warn to prefer __packed
Posted by Adi Nata 2 months ago
Change instance of __attribute__((__packed__)) to __packed per checkpatch.pl warning

Reported by checkpatch:
FILE: drivers/iio/chemical/sgp30.c
WARNING: Prefer __packed over __attribute__((__packed__))
+} __attribute__((__packed__));

Signed-off-by: Adi Nata <adinata.softwareengineer@gmail.com>

Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>

v2:
- Rename commit title and message

---
 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 f10bbebc29e4..c33592a1e0c9 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.47.3
Re: [PATCH v2] iio: chemical: sgp30: fix checkpatch warn to prefer __packed
Posted by Uwe Kleine-König 2 months ago
Hello,

Just a few nitpicks. These might not justify a v3, as Jonathan sometimes
fixes up such thing while applying.

On Sun, Aug 02, 2026 at 10:51:31AM +0800, Adi Nata wrote:
> Change instance of __attribute__((__packed__)) to __packed per checkpatch.pl warning
> 
> Reported by checkpatch:
> FILE: drivers/iio/chemical/sgp30.c
> WARNING: Prefer __packed over __attribute__((__packed__))
> +} __attribute__((__packed__));
> 
> Signed-off-by: Adi Nata <adinata.softwareengineer@gmail.com>
> 
> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>

No empty lines in the S-o-B block, and please put your S-o-b last.

> v2:
> - Rename commit title and message

the v2 changelog belongs after the tripple dash.

> 
> ---
>  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 f10bbebc29e4..c33592a1e0c9 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;

Otherwise looks fine.

Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>

Best regards
Uwe
Re: [PATCH v2] iio: chemical: sgp30: fix checkpatch warn to prefer __packed
Posted by Jonathan Cameron 2 months ago
On Sun, 2 Aug 2026 14:34:59 +0200
Uwe Kleine-König <u.kleine-koenig@baylibre.com> wrote:

> Hello,
> 
> Just a few nitpicks. These might not justify a v3, as Jonathan sometimes
> fixes up such thing while applying.

There are enough things across various patches from Adi that I'd like
new versions incorporating all the various bits of feedback.

But wait a few days first in case there is more to come from additional
reviewers!

Thanks,

Jonathan

> 
> On Sun, Aug 02, 2026 at 10:51:31AM +0800, Adi Nata wrote:
> > Change instance of __attribute__((__packed__)) to __packed per checkpatch.pl warning
> > 
> > Reported by checkpatch:
> > FILE: drivers/iio/chemical/sgp30.c
> > WARNING: Prefer __packed over __attribute__((__packed__))
> > +} __attribute__((__packed__));
> > 
> > Signed-off-by: Adi Nata <adinata.softwareengineer@gmail.com>
> > 
> > Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>  
> 
> No empty lines in the S-o-B block, and please put your S-o-b last.
> 
> > v2:
> > - Rename commit title and message  
> 
> the v2 changelog belongs after the tripple dash.
> 
> > 
> > ---
> >  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 f10bbebc29e4..c33592a1e0c9 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;  
> 
> Otherwise looks fine.
> 
> Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> 
> Best regards
> Uwe