linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [POWERPC] iseries: remove some gcc 4.1 warnings
@ 2006-08-16  5:20 Stephen Rothwell
  2006-08-16  5:26 ` Michael Ellerman
  2006-08-16 13:15 ` Arnd Bergmann
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen Rothwell @ 2006-08-16  5:20 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev

gcc 4.1 produces some warnings that it is ignoring the packed attribute
on some structure elements, so just remove them.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/platforms/iseries/main_store.h |   46 ++++++++++++++-------------
 1 files changed, 23 insertions(+), 23 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff --git a/arch/powerpc/platforms/iseries/main_store.h b/arch/powerpc/platforms/iseries/main_store.h
index 74f6889..4b31658 100644
--- a/arch/powerpc/platforms/iseries/main_store.h
+++ b/arch/powerpc/platforms/iseries/main_store.h
@@ -63,7 +63,7 @@ struct IoHriMainStoreSegment4 {
 /* Main Store VPD for Power4 */
 struct IoHriMainStoreChipInfo1 {
 	u32	chipMfgID	__attribute((packed));
-	char	chipECLevel[4]	__attribute((packed));
+	char	chipECLevel[4];
 };
 
 struct IoHriMainStoreVpdIdData {
@@ -74,9 +74,9 @@ struct IoHriMainStoreVpdIdData {
 };
 
 struct IoHriMainStoreVpdFruData {
-	char	fruLabel[8]	__attribute((packed));
-	u8	numberOfSlots	__attribute((packed));
-	u8	pluggingType	__attribute((packed));
+	char	fruLabel[8];
+	u8	numberOfSlots;
+	u8	pluggingType;
 	u16	slotMapIndex	__attribute((packed));
 };
 
@@ -90,8 +90,8 @@ #define MaxAreaAdrRangeBlocks 4
 
 struct IoHriMainStoreArea4 {
 	u32	msVpdFormat			__attribute((packed));
-	u8	containedVpdType		__attribute((packed));
-	u8	reserved1			__attribute((packed));
+	u8	containedVpdType;
+	u8	reserved1;
 	u16	reserved2			__attribute((packed));
 
 	u64	msExists			__attribute((packed));
@@ -101,16 +101,16 @@ struct IoHriMainStoreArea4 {
 	u32	procNodeId			__attribute((packed));
 
 	u32	numAdrRangeBlocks		__attribute((packed));
-	struct IoHriMainStoreAdrRangeBlock xAdrRangeBlock[MaxAreaAdrRangeBlocks]	__attribute((packed));
+	struct IoHriMainStoreAdrRangeBlock xAdrRangeBlock[MaxAreaAdrRangeBlocks];
 
-	struct IoHriMainStoreChipInfo1	chipInfo0	__attribute((packed));
-	struct IoHriMainStoreChipInfo1	chipInfo1	__attribute((packed));
-	struct IoHriMainStoreChipInfo1	chipInfo2	__attribute((packed));
-	struct IoHriMainStoreChipInfo1	chipInfo3	__attribute((packed));
-	struct IoHriMainStoreChipInfo1	chipInfo4	__attribute((packed));
-	struct IoHriMainStoreChipInfo1	chipInfo5	__attribute((packed));
-	struct IoHriMainStoreChipInfo1	chipInfo6	__attribute((packed));
-	struct IoHriMainStoreChipInfo1	chipInfo7	__attribute((packed));
+	struct IoHriMainStoreChipInfo1	chipInfo0;
+	struct IoHriMainStoreChipInfo1	chipInfo1;
+	struct IoHriMainStoreChipInfo1	chipInfo2;
+	struct IoHriMainStoreChipInfo1	chipInfo3;
+	struct IoHriMainStoreChipInfo1	chipInfo4;
+	struct IoHriMainStoreChipInfo1	chipInfo5;
+	struct IoHriMainStoreChipInfo1	chipInfo6;
+	struct IoHriMainStoreChipInfo1	chipInfo7;
 
 	void	*msRamAreaArray			__attribute((packed));
 	u32	msRamAreaArrayNumEntries	__attribute((packed));
@@ -122,22 +122,22 @@ struct IoHriMainStoreArea4 {
 	u32	numaDimmArrayNumEntries		__attribute((packed));
 	u32	numaDimmArrayEntrySize		__attribute((packed));
 
-	struct IoHriMainStoreVpdIdData idData	__attribute((packed));
+	struct IoHriMainStoreVpdIdData idData;
 
 	u64	powerData			__attribute((packed));
 	u64	cardAssemblyPartNum		__attribute((packed));
 	u64	chipSerialNum			__attribute((packed));
 
 	u64	reserved3			__attribute((packed));
-	char	reserved4[16]			__attribute((packed));
+	char	reserved4[16];
 
-	struct IoHriMainStoreVpdFruData fruData	__attribute((packed));
+	struct IoHriMainStoreVpdFruData fruData;
 
-	u8	vpdPortNum			__attribute((packed));
-	u8	reserved5			__attribute((packed));
-	u8	frameId				__attribute((packed));
-	u8	rackUnit			__attribute((packed));
-	char	asciiKeywordVpd[256]		__attribute((packed));
+	u8	vpdPortNum;
+	u8	reserved5;
+	u8	frameId;
+	u8	rackUnit;
+	char	asciiKeywordVpd[256];
 	u32	reserved6			__attribute((packed));
 };
 
-- 
1.4.1.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [POWERPC] iseries: remove some gcc 4.1 warnings
  2006-08-16  5:20 [POWERPC] iseries: remove some gcc 4.1 warnings Stephen Rothwell
@ 2006-08-16  5:26 ` Michael Ellerman
  2006-08-16  5:32   ` Stephen Rothwell
  2006-08-16 13:15 ` Arnd Bergmann
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Ellerman @ 2006-08-16  5:26 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: ppc-dev, paulus

[-- Attachment #1: Type: text/plain, Size: 488 bytes --]

On Wed, 2006-08-16 at 15:20 +1000, Stephen Rothwell wrote:
> gcc 4.1 produces some warnings that it is ignoring the packed attribute
> on some structure elements, so just remove them.

Why is it ignoring them? Because there's no packing to be done?

cheers

-- 
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [POWERPC] iseries: remove some gcc 4.1 warnings
  2006-08-16  5:26 ` Michael Ellerman
@ 2006-08-16  5:32   ` Stephen Rothwell
  2006-08-16  6:09     ` Alan Modra
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2006-08-16  5:32 UTC (permalink / raw)
  To: michael; +Cc: linuxppc-dev, paulus

[-- Attachment #1: Type: text/plain, Size: 588 bytes --]

On Wed, 16 Aug 2006 15:26:04 +1000 Michael Ellerman <michael@ellerman.id.au> wrote:
>
> On Wed, 2006-08-16 at 15:20 +1000, Stephen Rothwell wrote:
> > gcc 4.1 produces some warnings that it is ignoring the packed attribute
> > on some structure elements, so just remove them.
> 
> Why is it ignoring them? Because there's no packing to be done?

A patch went into gcc to warn if the thing you are packing is already
minimally aligned.  I have not idea why it warns ...

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [POWERPC] iseries: remove some gcc 4.1 warnings
  2006-08-16  5:32   ` Stephen Rothwell
@ 2006-08-16  6:09     ` Alan Modra
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Modra @ 2006-08-16  6:09 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev, paulus

On Wed, Aug 16, 2006 at 03:32:06PM +1000, Stephen Rothwell wrote:
> On Wed, 16 Aug 2006 15:26:04 +1000 Michael Ellerman <michael@ellerman.id.au> wrote:
> >
> > On Wed, 2006-08-16 at 15:20 +1000, Stephen Rothwell wrote:
> > > gcc 4.1 produces some warnings that it is ignoring the packed attribute
> > > on some structure elements, so just remove them.
> > 
> > Why is it ignoring them? Because there's no packing to be done?
> 
> A patch went into gcc to warn if the thing you are packing is already
> minimally aligned.  I have not idea why it warns ...

http://gcc.gnu.org/ml/gcc-patches/2005-11/msg01883.html
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21166

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [POWERPC] iseries: remove some gcc 4.1 warnings
  2006-08-16  5:20 [POWERPC] iseries: remove some gcc 4.1 warnings Stephen Rothwell
  2006-08-16  5:26 ` Michael Ellerman
@ 2006-08-16 13:15 ` Arnd Bergmann
  2006-08-17  6:28   ` Stephen Rothwell
  1 sibling, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2006-08-16 13:15 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Stephen Rothwell, paulus

On Wednesday 16 August 2006 07:20, Stephen Rothwell wrote:
> gcc 4.1 produces some warnings that it is ignoring the packed attribute
> on some structure elements, so just remove them.
> 

Wouldn't it be nicer to just specify the packed attribute on the
structure instead of each of the members? My reading of the 
gcc documentation is that this is functionally the same, but
it makes the source more readable, aside from avoiding this warning.

	Arnd <><

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [POWERPC] iseries: remove some gcc 4.1 warnings
  2006-08-16 13:15 ` Arnd Bergmann
@ 2006-08-17  6:28   ` Stephen Rothwell
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2006-08-17  6:28 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev, Arnd Bergmann

gcc 4.1 produces some warnings that say it is ignoring the packed
attribute on some structure elements, so, since all the elements of
these structs are packed, pack the structs instead.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/platforms/iseries/main_store.h |  126 ++++++++++++++-------------
 1 files changed, 63 insertions(+), 63 deletions(-)

This version takes into account Arnds good suggestion.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff --git a/arch/powerpc/platforms/iseries/main_store.h b/arch/powerpc/platforms/iseries/main_store.h
index 74f6889..1a7a3f5 100644
--- a/arch/powerpc/platforms/iseries/main_store.h
+++ b/arch/powerpc/platforms/iseries/main_store.h
@@ -61,9 +61,9 @@ struct IoHriMainStoreSegment4 {
 };
 
 /* Main Store VPD for Power4 */
-struct IoHriMainStoreChipInfo1 {
-	u32	chipMfgID	__attribute((packed));
-	char	chipECLevel[4]	__attribute((packed));
+struct __attribute((packed)) IoHriMainStoreChipInfo1 {
+	u32	chipMfgID;
+	char	chipECLevel[4];
 };
 
 struct IoHriMainStoreVpdIdData {
@@ -73,72 +73,72 @@ struct IoHriMainStoreVpdIdData {
 	char	serialNumber[12];
 };
 
-struct IoHriMainStoreVpdFruData {
-	char	fruLabel[8]	__attribute((packed));
-	u8	numberOfSlots	__attribute((packed));
-	u8	pluggingType	__attribute((packed));
-	u16	slotMapIndex	__attribute((packed));
+struct	__attribute((packed)) IoHriMainStoreVpdFruData {
+	char	fruLabel[8];
+	u8	numberOfSlots;
+	u8	pluggingType;
+	u16	slotMapIndex;
 };
 
-struct IoHriMainStoreAdrRangeBlock {
-	void	*blockStart      __attribute((packed));
-	void	*blockEnd        __attribute((packed));
-	u32	blockProcChipId __attribute((packed));
+struct  __attribute((packed)) IoHriMainStoreAdrRangeBlock {
+	void	*blockStart;
+	void	*blockEnd;
+	u32	blockProcChipId;
 };
 
 #define MaxAreaAdrRangeBlocks 4
 
-struct IoHriMainStoreArea4 {
-	u32	msVpdFormat			__attribute((packed));
-	u8	containedVpdType		__attribute((packed));
-	u8	reserved1			__attribute((packed));
-	u16	reserved2			__attribute((packed));
-
-	u64	msExists			__attribute((packed));
-	u64	msFunctional			__attribute((packed));
-
-	u32	memorySize			__attribute((packed));
-	u32	procNodeId			__attribute((packed));
-
-	u32	numAdrRangeBlocks		__attribute((packed));
-	struct IoHriMainStoreAdrRangeBlock xAdrRangeBlock[MaxAreaAdrRangeBlocks]	__attribute((packed));
-
-	struct IoHriMainStoreChipInfo1	chipInfo0	__attribute((packed));
-	struct IoHriMainStoreChipInfo1	chipInfo1	__attribute((packed));
-	struct IoHriMainStoreChipInfo1	chipInfo2	__attribute((packed));
-	struct IoHriMainStoreChipInfo1	chipInfo3	__attribute((packed));
-	struct IoHriMainStoreChipInfo1	chipInfo4	__attribute((packed));
-	struct IoHriMainStoreChipInfo1	chipInfo5	__attribute((packed));
-	struct IoHriMainStoreChipInfo1	chipInfo6	__attribute((packed));
-	struct IoHriMainStoreChipInfo1	chipInfo7	__attribute((packed));
-
-	void	*msRamAreaArray			__attribute((packed));
-	u32	msRamAreaArrayNumEntries	__attribute((packed));
-	u32	msRamAreaArrayEntrySize		__attribute((packed));
-
-	u32	numaDimmExists			__attribute((packed));
-	u32	numaDimmFunctional		__attribute((packed));
-	void	*numaDimmArray			__attribute((packed));
-	u32	numaDimmArrayNumEntries		__attribute((packed));
-	u32	numaDimmArrayEntrySize		__attribute((packed));
-
-	struct IoHriMainStoreVpdIdData idData	__attribute((packed));
-
-	u64	powerData			__attribute((packed));
-	u64	cardAssemblyPartNum		__attribute((packed));
-	u64	chipSerialNum			__attribute((packed));
-
-	u64	reserved3			__attribute((packed));
-	char	reserved4[16]			__attribute((packed));
-
-	struct IoHriMainStoreVpdFruData fruData	__attribute((packed));
-
-	u8	vpdPortNum			__attribute((packed));
-	u8	reserved5			__attribute((packed));
-	u8	frameId				__attribute((packed));
-	u8	rackUnit			__attribute((packed));
-	char	asciiKeywordVpd[256]		__attribute((packed));
-	u32	reserved6			__attribute((packed));
+struct __attribute((packed)) IoHriMainStoreArea4 {
+	u32	msVpdFormat;
+	u8	containedVpdType;
+	u8	reserved1;
+	u16	reserved2;
+
+	u64	msExists;
+	u64	msFunctional;
+
+	u32	memorySize;
+	u32	procNodeId;
+
+	u32	numAdrRangeBlocks;
+	struct IoHriMainStoreAdrRangeBlock xAdrRangeBlock[MaxAreaAdrRangeBlocks];
+
+	struct IoHriMainStoreChipInfo1	chipInfo0;
+	struct IoHriMainStoreChipInfo1	chipInfo1;
+	struct IoHriMainStoreChipInfo1	chipInfo2;
+	struct IoHriMainStoreChipInfo1	chipInfo3;
+	struct IoHriMainStoreChipInfo1	chipInfo4;
+	struct IoHriMainStoreChipInfo1	chipInfo5;
+	struct IoHriMainStoreChipInfo1	chipInfo6;
+	struct IoHriMainStoreChipInfo1	chipInfo7;
+
+	void	*msRamAreaArray;
+	u32	msRamAreaArrayNumEntries;
+	u32	msRamAreaArrayEntrySize;
+
+	u32	numaDimmExists;
+	u32	numaDimmFunctional;
+	void	*numaDimmArray;
+	u32	numaDimmArrayNumEntries;
+	u32	numaDimmArrayEntrySize;
+
+	struct IoHriMainStoreVpdIdData idData;
+
+	u64	powerData;
+	u64	cardAssemblyPartNum;
+	u64	chipSerialNum;
+
+	u64	reserved3;
+	char	reserved4[16];
+
+	struct IoHriMainStoreVpdFruData fruData;
+
+	u8	vpdPortNum;
+	u8	reserved5;
+	u8	frameId;
+	u8	rackUnit;
+	char	asciiKeywordVpd[256];
+	u32	reserved6;
 };
 
 
-- 
1.4.1.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-08-17  6:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-16  5:20 [POWERPC] iseries: remove some gcc 4.1 warnings Stephen Rothwell
2006-08-16  5:26 ` Michael Ellerman
2006-08-16  5:32   ` Stephen Rothwell
2006-08-16  6:09     ` Alan Modra
2006-08-16 13:15 ` Arnd Bergmann
2006-08-17  6:28   ` Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).