diff mbox series

media: allegro-dvt: Use __packed sentence

Message ID YBRpstkOi685uHef@debian
State New
Headers show
Series media: allegro-dvt: Use __packed sentence | expand

Commit Message

Emmanuel Arias Jan. 29, 2021, 8:01 p.m. UTC
Fix coding style using __packed sentece instead of
__attribute__((__packed__)).

Signed-off-by: Emmanuel Arias <eamanu@yaerobi.com>
---
 drivers/staging/media/allegro-dvt/allegro-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Tretter Feb. 1, 2021, 9:23 a.m. UTC | #1
On Fri, 29 Jan 2021 23:54:41 +0000, David Laight wrote:
> From: Emmanuel Arias

> > Sent: 29 January 2021 20:02

> > 

> > Fix coding style using __packed sentece instead of

> > __attribute__((__packed__)).

> > 

> > Signed-off-by: Emmanuel Arias <eamanu@yaerobi.com>

> > ---

> >  drivers/staging/media/allegro-dvt/allegro-core.c | 2 +-

> >  1 file changed, 1 insertion(+), 1 deletion(-)

> > 

> > diff --git a/drivers/staging/media/allegro-dvt/allegro-core.c b/drivers/staging/media/allegro-

> > dvt/allegro-core.c

> > index 9f718f43282b..cee624dac61a 100644

> > --- a/drivers/staging/media/allegro-dvt/allegro-core.c

> > +++ b/drivers/staging/media/allegro-dvt/allegro-core.c

> > @@ -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.

> 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
diff mbox series

Patch

diff --git a/drivers/staging/media/allegro-dvt/allegro-core.c b/drivers/staging/media/allegro-dvt/allegro-core.c
index 9f718f43282b..cee624dac61a 100644
--- a/drivers/staging/media/allegro-dvt/allegro-core.c
+++ b/drivers/staging/media/allegro-dvt/allegro-core.c
@@ -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;