lkml.org 
[lkml]   [2005]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH][2.6.12-rc2] __attribute__ placement
From
Date
Hi,

Apparently my previous patch incorrectly fixed few cases where the
problem didn't exist. The __attribute__((packed)) issue is applicable
only to typedefed structs and the correct syntax for this should be:

typedef struct ... { ... } __attribute__((packed)) new_type;

Please find the updated patch. Hope I haven't introduced any new bugs.

Thanks
Vinay

drivers/net/gt96100eth.h | 4 ++--
include/asm-m68knommu/MC68328.h | 2 +-
include/asm-m68knommu/MC68EZ328.h | 2 +-
include/asm-m68knommu/MC68VZ328.h | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)

=============================================================================
diff -urN linux-2.6.12-rc2/drivers/net/gt96100eth.h linux-2.6.12-rc2-nvk/drivers/net/gt96100eth.h
--- linux-2.6.12-rc2/drivers/net/gt96100eth.h 2005-04-07 18:56:46.000000000 +0530
+++ linux-2.6.12-rc2-nvk/drivers/net/gt96100eth.h 2005-04-20 15:50:20.000000000 +0530
@@ -214,7 +214,7 @@
u32 cmdstat;
u32 next;
u32 buff_ptr;
-} gt96100_td_t __attribute__ ((packed));
+} __attribute__ ((packed)) gt96100_td_t;

typedef struct {
#ifdef DESC_BE
@@ -227,7 +227,7 @@
u32 cmdstat;
u32 next;
u32 buff_ptr;
-} gt96100_rd_t __attribute__ ((packed));
+} __attribute__ ((packed)) gt96100_rd_t;


/* Values for the Tx command-status descriptor entry. */
diff -urN linux-2.6.12-rc2/include/asm-m68knommu/MC68328.h linux-2.6.12-rc2-nvk/include/asm-m68knommu/MC68328.h
--- linux-2.6.12-rc2/include/asm-m68knommu/MC68328.h 2005-04-07 18:55:40.000000000 +0530
+++ linux-2.6.12-rc2-nvk/include/asm-m68knommu/MC68328.h 2005-04-20 15:47:37.000000000 +0530
@@ -993,7 +993,7 @@
volatile unsigned short int pad1;
volatile unsigned short int pad2;
volatile unsigned short int pad3;
-} m68328_uart __attribute__((packed));
+} __attribute__((packed)) m68328_uart;


/**********
diff -urN linux-2.6.12-rc2/include/asm-m68knommu/MC68EZ328.h linux-2.6.12-rc2-nvk/include/asm-m68knommu/MC68EZ328.h
--- linux-2.6.12-rc2/include/asm-m68knommu/MC68EZ328.h 2005-04-07 18:55:40.000000000 +0530
+++ linux-2.6.12-rc2-nvk/include/asm-m68knommu/MC68EZ328.h 2005-04-20 15:48:27.000000000 +0530
@@ -815,7 +815,7 @@
volatile unsigned short int nipr;
volatile unsigned short int pad1;
volatile unsigned short int pad2;
-} m68328_uart __attribute__((packed));
+} __attribute__((packed)) m68328_uart;


/**********
diff -urN linux-2.6.12-rc2/include/asm-m68knommu/MC68VZ328.h linux-2.6.12-rc2-nvk/include/asm-m68knommu/MC68VZ328.h
--- linux-2.6.12-rc2/include/asm-m68knommu/MC68VZ328.h 2005-04-07 18:55:40.000000000 +0530
+++ linux-2.6.12-rc2-nvk/include/asm-m68knommu/MC68VZ328.h 2005-04-20 15:48:01.000000000 +0530
@@ -909,7 +909,7 @@
volatile unsigned short int nipr;
volatile unsigned short int hmark;
volatile unsigned short int unused;
-} m68328_uart __attribute__((packed));
+} __attribute__((packed)) m68328_uart;



=============================================================================
> On Mon, 2005-04-18 at 20:46 +0530, Vinay K Nallamothu wrote:
> > Hi,
> > The variable attributes "packed" and "align" when used with struct,
> > should have the following order:
> >
> > struct ... {...} __attribute__((packed)) var;
> >
> > This patch fixes few instances where the variable and attributes are
> > placed the other way around and had no affect.
> >

--
Views expressed in this mail are those of the individual sender and
do not bind Gsec1 Limited. or its subsidiary, unless the sender has done
so expressly with due authority of Gsec1.
_________________________________________________________________________

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-04-20 13:30    [W:0.043 / U:1.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site