* [PATCH] staging: ft1000: convert pack pragma to __packed__ attribute
@ 2015-06-22 19:12 Giedrius Statkevičius
2015-06-22 21:48 ` Joe Perches
0 siblings, 1 reply; 2+ messages in thread
From: Giedrius Statkevičius @ 2015-06-22 19:12 UTC (permalink / raw)
To: gregkh
Cc: marek.belisko, joe, tapaswenipathak, mahfouz.saif.elyazal,
tinajohnson.1234, gulsah.1004, devel, linux-kernel,
Giedrius Statkevičius
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.
Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
---
drivers/staging/ft1000/ft1000-usb/ft1000_download.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
index 5def347..345c256 100644
--- 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__));
/* checks if the doorbell register is cleared */
--
2.4.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: ft1000: convert pack pragma to __packed__ attribute
2015-06-22 19:12 [PATCH] staging: ft1000: convert pack pragma to __packed__ attribute Giedrius Statkevičius
@ 2015-06-22 21:48 ` Joe Perches
0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2015-06-22 21:48 UTC (permalink / raw)
To: Giedrius Statkevičius
Cc: gregkh, marek.belisko, tapaswenipathak, mahfouz.saif.elyazal,
tinajohnson.1234, gulsah.1004, devel, linux-kernel
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-22 21:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-22 19:12 [PATCH] staging: ft1000: convert pack pragma to __packed__ attribute Giedrius Statkevičius
2015-06-22 21:48 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox