public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* The bzip2/lzma patches
@ 2008-12-31  2:47 H. Peter Anvin
  2008-12-31  8:47 ` Alain Knaff
  0 siblings, 1 reply; 4+ messages in thread
From: H. Peter Anvin @ 2008-12-31  2:47 UTC (permalink / raw)
  To: Alain Knaff; +Cc: Linux Kernel Mailing List, the arch/x86 maintainers

Hi Alain,

I finally got the tree with your latest bzip2/LZMA code unburied.  My
apologies for having sat on it for so long (you know why.)

Anyway, I did run into a few things that I'd really like to get fixed.

First of all, there are more than just the x86 and ARM tree which is
using the old API, I count at least four more architectures.  I can't
apply the ARM tree anyway, and we clearly need a saner migration way.

Second, the ugly if...goto hacks in init/initramfs.c could be much
cleaner handled by iterating down a list of function pointers -- except
that gunzip() seems to have a different return value (in init/than the
others?!

Third, you're using the construct if (!foo() < 0 && message == NULL)

... which is wrong on three(!) accounts, one technical (! has higher
precedence than <) and two stylistic (write >= instead of !(.. < ..) and
write !message instead of message == NULL).

I think the solution to all of this is to introduce a new function
instead of gunzip(), and have the old gunzip() be a wrapper using the
old ABI.  That is much cleaner than relying on #ifdef NEW_CODE.

Finally, I know I suggested it, but I don't think the
<linux/decompress/*.h> header file are justified given that they only
contain a single function header.  Might as well put them all in a
single <linux/decompress.h> header.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


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

end of thread, other threads:[~2008-12-31 14:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-31  2:47 The bzip2/lzma patches H. Peter Anvin
2008-12-31  8:47 ` Alain Knaff
2008-12-31 13:42   ` Sam Ravnborg
2008-12-31 14:22     ` Alain Knaff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox