mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vinay K Nallamothu <vinay.nallamothu@gsecone.com>
To: akpm@osdl.org
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][2.6.12-rc2] __attribute__ placement
Date: Wed, 20 Apr 2005 16:54:08 +0530	[thread overview]
Message-ID: <1113996248.13256.3.camel@vinay.gsecone.com> (raw)
In-Reply-To: <1113994849.10792.46.camel@vinay.gsecone.com>

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



      parent reply	other threads:[~2005-04-20 11:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-18 15:16 Vinay K Nallamothu
     [not found] ` <1113994849.10792.46.camel@vinay.gsecone.com>
2005-04-20 11:24   ` Vinay K Nallamothu [this message]

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=1113996248.13256.3.camel@vinay.gsecone.com \
    --to=vinay.nallamothu@gsecone.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®