Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1170221 > unrolled thread

Re: [PATCH] staging: ft1000: convert pack pragma to __packed__ attribute

Started byJoe Perches <joe@perches.com>
First post2015-06-22 23:50 +0200
Last post2015-06-22 23:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] staging: ft1000: convert pack pragma to __packed__  attribute Joe Perches <joe@perches.com> - 2015-06-22 23:50 +0200

#1170221 — Re: [PATCH] staging: ft1000: convert pack pragma to __packed__ attribute

FromJoe Perches <joe@perches.com>
Date2015-06-22 23:50 +0200
SubjectRe: [PATCH] staging: ft1000: convert pack pragma to __packed__ attribute
Message-ID<pEhLj-7Da-7@gated-at.bofh.it>
On Mon, 2015-06-22 at 22:12 +0300, Giedrius Statkevičius wrote:
> Convert a Microsoft compiler specific directive "#pragma pack(1)" to a
> GCC equivalent __attribute__ ((__packed__)). Also, by doing this we save
> ourselves from trouble if any other struct definitions are added after
> the #pragma because it will be applied to all of the definitions
> following it.
[]
> diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
[]
> @@ -95,7 +95,6 @@ struct dsp_file_hdr {
>  	long              nDspImages;          /* Number of DSP images in file. */
>  };
>  
> -#pragma pack(1)
>  struct dsp_image_info {
>  	long              coff_date;           /* Date/time when DSP Coff image was built. */
>  	long              begin_offset;        /* Offset in file where image begins. */
> @@ -105,7 +104,7 @@ struct dsp_image_info {
>  	long              version;             /* Embedded version # of DSP code. */
>  	unsigned short    checksum;            /* DSP File checksum */
>  	unsigned short    pad1;
> -};
> +} __attribute__ ((__packed__));

__packed


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web