mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Stefan Lengfeld <s.lengfeld@phytec.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH upstream 1/4] state: use packet attribute for on storage structs
Date: Thu, 3 Nov 2016 07:21:34 +0100	[thread overview]
Message-ID: <20161103062134.dqkssqmjzp624mb2@pengutronix.de> (raw)
In-Reply-To: <1478073270-3527-1-git-send-email-s.lengfeld@phytec.de>

On Wed, Nov 02, 2016 at 08:54:27AM +0100, Stefan Lengfeld wrote:
> These structs are used for on-storage data layouts. They should be not
> affected by different integer precisions and alignment optimizations of
> 32bit or 64bit machines. Using the architecture independent integer data
> types, like uint32_t, achieves the former, using the packet attribute
> the later.
> 
> Signed-off-by: Stefan Lengfeld <s.lengfeld@phytec.de>

Applied all, thanks. 3/4 went to master, the rest to next. Also fixed
s/packet/packed/ while applying.

Sascha

> ---
>  common/state/backend_bucket_circular.c | 2 +-
>  common/state/backend_bucket_direct.c   | 2 +-
>  common/state/backend_format_raw.c      | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/common/state/backend_bucket_circular.c b/common/state/backend_bucket_circular.c
> index 72e165e..d8504e0 100644
> --- a/common/state/backend_bucket_circular.c
> +++ b/common/state/backend_bucket_circular.c
> @@ -47,7 +47,7 @@ struct state_backend_storage_bucket_circular {
>  	struct device_d *dev;
>  };
>  
> -struct state_backend_storage_bucket_circular_meta {
> +struct __attribute__((__packed__)) state_backend_storage_bucket_circular_meta {
>  	uint32_t magic;
>  	uint32_t written_length;
>  };
> diff --git a/common/state/backend_bucket_direct.c b/common/state/backend_bucket_direct.c
> index 08892f0..5225433 100644
> --- a/common/state/backend_bucket_direct.c
> +++ b/common/state/backend_bucket_direct.c
> @@ -32,7 +32,7 @@ struct state_backend_storage_bucket_direct {
>  	struct device_d *dev;
>  };
>  
> -struct state_backend_storage_bucket_direct_meta {
> +struct __attribute__((__packed__)) state_backend_storage_bucket_direct_meta {
>  	uint32_t magic;
>  	uint32_t written_length;
>  };
> diff --git a/common/state/backend_format_raw.c b/common/state/backend_format_raw.c
> index 4209424..e028ea6 100644
> --- a/common/state/backend_format_raw.c
> +++ b/common/state/backend_format_raw.c
> @@ -37,7 +37,7 @@ struct state_backend_format_raw {
>  	struct device_d *dev;
>  };
>  
> -struct backend_raw_header {
> +struct __attribute__((__packed__)) backend_raw_header {
>  	uint32_t magic;
>  	uint16_t reserved;
>  	uint16_t data_len;
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2016-11-03  6:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-02  7:54 Stefan Lengfeld
2016-11-02  7:54 ` [PATCH upstream 2/4] state: fix indentation Stefan Lengfeld
2016-11-02  7:54 ` [PATCH upstream 3/4] state: fix state is not saved when string variable is changed Stefan Lengfeld
2016-11-02  7:54 ` [PATCH upstream 4/4] docs: state: make string variable type clearer Stefan Lengfeld
2016-11-02 14:17 ` [PATCH upstream 1/4] state: use packet attribute for on storage structs Andrey Smirnov
2016-11-03  6:21 ` Sascha Hauer [this message]
2016-11-03  8:38   ` Stefan Lengfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161103062134.dqkssqmjzp624mb2@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.lengfeld@phytec.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox