All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@logfs.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andi Drebes <lists-receive@programmierforen.de>,
	Jeff Garzik <jeff@garzik.org>, J?rn Engel <joern@logfs.org>,
	linux-fsdevel@vger.kernel.org, Karel Zak <kzak@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Christoph Hellwig <hch@infradead.org>,
	Phillip Lougher <phillip@lougher.demon.co.uk>
Subject: Re: [PATCH 1/2] Make cramfs little endian only
Date: Wed, 5 Dec 2007 23:41:03 +0100	[thread overview]
Message-ID: <20071205224102.GA32330@lazybastard.org> (raw)
In-Reply-To: <alpine.LFD.0.9999.0712051409010.13796@woody.linux-foundation.org>

On Wed, 5 December 2007 14:21:02 -0800, Linus Torvalds wrote:
> 
> No, no, what I meant about not having any #ifdef __LITTLE_ENDIAN was to do 
> the code do the same thing *regardless* of endianness. In other words, a 
> simple:
> 
> 	struct cramfs_inode {
> 		__le32 mode_uid;	/* CRAMFS_MODE_WIDTH:CRAMFS_UID_WIDTH */
> 		__le32 size_gid;	/* CRAMFS_SIZE_WIDTH:CRAMFS_GID_WIDTH */
> 		__le32 namelen_offset;	/* CRAMFS_NAMELEN_WIDTH:CRAMFS_OFFSET_WIDTH */
> 	};

Mode and uid are both 16bit.  So maybe we can change the structure:

	struct cramfs_inode {
		__le16 uid;
		__le16 mode;
		__le32 size_gid;	/* CRAMFS_SIZE_WIDTH:CRAMFS_GID_WIDTH */
		__le32 namelen_offset;	/* CRAMFS_NAMELEN_WIDTH:CRAMFS_OFFSET_WIDTH */
	};

That way masks and shifts are only needed for the remaining two shared
variables.

> (No, the above is not tested in any way, shape, or form, and no, I didn't 
> double-check that I actually extracted the right bits, but you get the 
> idea).

Same warning applies to my code as well.

Jörn

-- 
Rules of Optimization:
Rule 1: Don't do it.
Rule 2 (for experts only): Don't do it yet.
-- M.A. Jackson
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2007-12-05 22:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-04 11:59 [PATCH 0/2] Make cramfs little endian only Andi Drebes
2007-12-04 12:01 ` [PATCH 1/2] " Andi Drebes
2007-12-04 15:34   ` Jörn Engel
2007-12-04 20:37     ` Andi Drebes
2007-12-04 20:58       ` Linus Torvalds
2007-12-04 21:31         ` Andi Drebes
2007-12-04 22:35           ` Linus Torvalds
2007-12-04 22:58             ` Jeff Garzik
2007-12-05 21:57               ` Andi Drebes
2007-12-05 22:21                 ` Linus Torvalds
2007-12-05 22:41                   ` Jörn Engel [this message]
2007-12-06 16:38                     ` Andi Drebes
2007-12-06 16:27                   ` Andi Drebes
2007-12-06 16:47                     ` Jörn Engel
2007-12-06 17:35                       ` Linus Torvalds
2007-12-06 17:31                     ` Linus Torvalds
2007-12-06 22:37                       ` Andi Drebes
2007-12-04 20:11   ` Andrew Morton
2007-12-04 20:58     ` Andi Drebes
2007-12-04 12:02 ` [PATCH 2/2] Update documentation Andi Drebes

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=20071205224102.GA32330@lazybastard.org \
    --to=joern@logfs.org \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=jeff@garzik.org \
    --cc=kzak@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=lists-receive@programmierforen.de \
    --cc=phillip@lougher.demon.co.uk \
    --cc=torvalds@linux-foundation.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.