All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] cramfs voodoo
@ 2007-11-24 21:20 Haavard Skinnemoen
  2007-11-24 22:40 ` [U-Boot-Users] [PATCH] Make CRAMFS optional (was Re: cramfs voodoo) Haavard Skinnemoen
  0 siblings, 1 reply; 2+ messages in thread
From: Haavard Skinnemoen @ 2007-11-24 21:20 UTC (permalink / raw)
  To: u-boot

Does anyone know why the following deep voodoo magic in
include/cramfs/cramfs_fs.h is needed?

#define CRAMFS_GET_NAMELEN(x)	(((u8*)(x))[8] & 0x3f)
#define CRAMFS_GET_OFFSET(x)	((CRAMFS_24(((u32*)(x))[2] & 0xffffff) << 2) |\
				 ((((u32*)(x))[2] & 0xc0000000) >> 30))
#define CRAMFS_SET_NAMELEN(x,y)	(((u8*)(x))[8] = (((0x3f & (y))) | \
						  (0xc0 & ((u8*)(x))[8])))
#define CRAMFS_SET_OFFSET(x,y)	(((u32*)(x))[2] = (((y) & 3) << 30) | \
				 CRAMFS_24((((y) & 0x03ffffff) >> 2)) | \
				 (((u32)(((u8*)(x))[8] & 0x3f)) << 24))

It looks like a workaround for buggy bitfield handling in the compiler,
but newer versions of gcc are not@all happy with it and spews
warnings like this:

cramfs.c:82: warning: dereferencing type-punned pointer will break
strict-aliasing rules

which indicates that the generated code is probably wrong.

Can we get rid of it somehow?

Haavard

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

* [U-Boot-Users] [PATCH] Make CRAMFS optional (was Re: cramfs voodoo)
  2007-11-24 21:20 [U-Boot-Users] cramfs voodoo Haavard Skinnemoen
@ 2007-11-24 22:40 ` Haavard Skinnemoen
  0 siblings, 0 replies; 2+ messages in thread
From: Haavard Skinnemoen @ 2007-11-24 22:40 UTC (permalink / raw)
  To: u-boot

On Sat, 24 Nov 2007 22:20:14 +0100
Haavard Skinnemoen <hskinnemoen@atmel.com> wrote:

> Can we get rid of it somehow?

Actually, I think I'd rather get rid of cramfs altogether. How do
everyone feel about something like this?

==============[cut here]==============

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

end of thread, other threads:[~2007-11-24 22:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-24 21:20 [U-Boot-Users] cramfs voodoo Haavard Skinnemoen
2007-11-24 22:40 ` [U-Boot-Users] [PATCH] Make CRAMFS optional (was Re: cramfs voodoo) Haavard Skinnemoen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.