All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
Cc: linux-mtd@lists.infradead.org
Subject: Re: partt partition table parser
Date: Tue, 02 Oct 2001 21:20:54 +0100	[thread overview]
Message-ID: <6763.1002054054@redhat.com> (raw)
In-Reply-To: <20010925220426.B9581@wohnheim.fh-wedel.de>

In general, it looks relatively sane. Can you justify the use of 
CONFIG_MTD_PARTT_INDIRECT? 

What systems use this partition table format?


> +++ mtd/util/mkpartt.c	Tue Sep 25 20:15:58 2001
> +#include "/usr/src/linux/include/linux/mtd/ibmpartt.h"

No. Pull the definitions into the C file or take a copy. Don't look too 
hard at the mkfs.jffs2 code - do as I say, not as I do :)

> +void x_order_32 (__u32 *old32)
> +{
> +	__u32 new32;
> +	__u8 *new8 = (__u8*)&new32;
> +	__u8 *old8 = (__u8*)old32;
> +	new8[0] = old8[3];
> +	new8[1] = old8[2];
> +	new8[2] = old8[1];
> +	new8[3] = old8[0];
> +	*old32 = new32;
> +}

That's going to break. In the kernel, we compile with -fno-strict-aliasing 
just because we've always had evil code there and nobody's yet looked too 
hard at cleaning it up. For userspace, we need to write real C code.

> +		columns = sscanf (buf, " %20s %x %x %x", /* FIXME: Replace 20 with NAME_MAX_LEN */

 "%" #NAME_MAX_LEN "s %x %x %x"

How about making big-endian and little-endian options too, instead of just 
cross-endian?

--
dwmw2

  reply	other threads:[~2001-10-02 20:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-25 20:04 partt partition table parser Jörn Engel
2001-10-02 20:20 ` David Woodhouse [this message]
2001-10-09 13:22   ` Jörn Engel

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=6763.1002054054@redhat.com \
    --to=dwmw2@infradead.org \
    --cc=joern@wohnheim.fh-wedel.de \
    --cc=linux-mtd@lists.infradead.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 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.