Skip to contentSkip to conversation

media: allegro-dvt: Use __packed sentence

PATCH In review Emmanuel Arias 4 participants 5 messages Jan 29, 2021 – Feb 1, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: allegro-dvt: Use __packed sentence

Fix coding style using __packed sentece instead of __attribute__((__packed__)).

---
 drivers/staging/media/allegro-dvt/allegro-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/allegro-dvt/allegro-core.c +1 -1
index 9f718f43282b..cee624dac61a 100644
@@ -670,7 +670,7 @@ static ssize_t allegro_mbox_read(struct allegro_mbox *mbox,
 	struct {
 		u16 length;
 		u16 type;
-	} __attribute__ ((__packed__)) *header;
+	} __packed *header;
 	struct regmap *sram = mbox->dev->sram;
 	unsigned int head;
 	ssize_t size;
Signature · 1 line
2.29.2
#1 lore raw

From: Emmanuel Arias

Quoted 16 lines

Sent: 29 January 2021 20:02

Fix coding style using __packed sentece instead of __attribute__((__packed__)).

---
 drivers/staging/media/allegro-dvt/allegro-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/allegro- renamed from drivers/staging/media/allegro-dvt/allegro-core.c +0 -0

dvt/allegro-core.c
index 9f718f43282b..cee624dac61a 100644

drivers/staging/media/allegro-dvt/allegro-core.c static ssize_t allegro_mbox_read(struct allegro_mbox *mbox, · line 674

Quoted 6 lines
drivers/staging/media/allegro-dvt/allegro-core.c +1 -1
@@ -670,7 +670,7 @@ static ssize_t allegro_mbox_read(struct allegro_mbox *mbox,
 	struct {
 		u16 length;
 		u16 type;
-	} __attribute__ ((__packed__)) *header;
+	} __packed *header;
 	struct regmap *sram = mbox->dev->sram;

Does this actually need to be packed?
The only reason would be if the structure could exist on a 2n+1 boundary.
But that is only likely if part of some binary sequence. In which case I'd expect it to be marked __be or __le.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)

maintainer
#3 lore raw
In reply to Emmanuel Arias
Quoted 1 line · Emmanuel Arias

Fix coding style using __packed sentece instead of

Spelling check please?

And _why_ are you making this change, what does this do "better" than the original?

thanks,

greg k-h

#4 lore raw

Hi,

Quoted 6 lines

Spelling check please?

And _why_ are you making this change, what does this do "better" than the original?

Actually, I'm really new here, and this is my first patch. I run the checkpatch.pl, and give me that recommendation.

I would like to look the David comments.

Thanks!
eamanu

Quoted 3 lines

thanks,

greg k-h

#2 lore raw
In reply to David Laight
Quoted 11 lines · David Laight

From: Emmanuel Arias

Quoted 10 lines

Sent: 29 January 2021 20:02

Fix coding style using __packed sentece instead of __attribute__((__packed__)).

---
 drivers/staging/media/allegro-dvt/allegro-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines

drivers/staging/media/allegro-dvt/allegro-core.c static ssize_t allegro_mbox_read(struct allegro_mbox *mbox, · line 674

Quoted 12 lines
drivers/staging/media/allegro- renamed from drivers/staging/media/allegro-dvt/allegro-core.c +0 -0

dvt/allegro-core.c
index 9f718f43282b..cee624dac61a 100644

drivers/staging/media/allegro-dvt/allegro-core.c +1 -1
@@ -670,7 +670,7 @@ static ssize_t allegro_mbox_read(struct allegro_mbox *mbox,
 	struct {
 		u16 length;
 		u16 type;
-	} __attribute__ ((__packed__)) *header;
+	} __packed *header;
 	struct regmap *sram = mbox->dev->sram;

Does this actually need to be packed?
The only reason would be if the structure could exist on a 2n+1 boundary.

Not sure, what you mean by this.

Quoted 2 lines

But that is only likely if part of some binary sequence. In which case I'd expect it to be marked __be or __le.

It is part of a binary sequence. It is the header of messages in a mailbox that is used to exchange data with a co-processor (video encoder). In fact, it should be marked as __le.

Michael