RE: drivers/block/ub.c

From: Robert White
Date: Mon Jun 28 2004 - 21:51:20 EST


Ok, that is what it does. That is not what *I* would have *expected* it to do. I
would have expected it to remain a struct when viewed from the outside rather than
become an "N-byte blob".


-----Original Message-----
From: David S. Miller [mailto:davem@xxxxxxxxxx]
Sent: Monday, June 28, 2004 7:16 PM
To: Robert White
Cc: oliver@xxxxxxxxxx; scott@xxxxxxxxxxx; zaitcev@xxxxxxxxxx; greg@xxxxxxxxx;
arjanv@xxxxxxxxxx; jgarzik@xxxxxxxxxx; tburke@xxxxxxxxxx;
linux-kernel@xxxxxxxxxxxxxxx; stern@xxxxxxxxxxxxxxxxxxx;
mdharm-usb@xxxxxxxxxxxxxxxxxx; david-b@xxxxxxxxxxx
Subject: Re: drivers/block/ub.c

On Mon, 28 Jun 2004 18:54:46 -0700
"Robert White" <rwhite@xxxxxxxxxxxx> wrote:

> The below makes no sense to me... Nothing in the definition of struct bar{} (which
> is not packed) infers (top me) in the slightest that foo should be unnaturally
> aligned within it.

First of all, it is what the compiler does and has done since the
__packed__ attribute was added.

Second of all, you are asking it to "PACK" the structure, this includes
any place you place it within other data objects. It becomes an N-byte
blob that has no alignment constraints must be placed exactly where it
is declared.

I am growing very tired of this thread.


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