public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@logfs.org>
To: Adrian McMenamin <adrian@newgolddream.dyndns.info>
Cc: MTD <linux-mtd@lists.infradead.org>
Subject: Re: [Fwd: Re: [PATCH] 2/2 mtd: Add support for the Dreamcast VMU flash]
Date: Thu, 20 Mar 2008 13:31:39 +0100	[thread overview]
Message-ID: <20080320123139.GE1355@logfs.org> (raw)
In-Reply-To: <47111.85.118.17.158.1206017802.squirrel@newgolddream.dyndns.info>

On Thu, 20 March 2008 12:56:42 -0000, Adrian McMenamin wrote:
> On Thu, March 20, 2008 11:20 am, Jörn Engel wrote:
> > On Thu, 20 March 2008 11:56:54 -0000, Adrian McMenamin wrote:
> >> >> +
> >> >> +	((unsigned long *)sendbuf)[0] = cpu_to_be32(MAPLE_FUNC_MEMCARD);
> >> >> +	((unsigned long *)sendbuf)[1] = cpu_to_be32(partition << 24 | num);
> > So why do you use void* for data you actually dereference?
> 
> Because for other devices data can be passed as 16 bit structures as well
> as 32 bit ones.

Hogwash!  If you ever deal with 16bit structures here you have a bug.
cpu_to_be32() only makes sense when actually dealing with __be32.
Either your variable is and should be called __be32, or it isn't and you
have a bug right in front of you.

Jörn

-- 
It does not matter how slowly you go, so long as you do not stop.
-- Confucius

  reply	other threads:[~2008-03-20 13:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-19 21:20 [Fwd: Re: [PATCH] 2/2 mtd: Add support for the Dreamcast VMU flash] Adrian McMenamin
2008-03-20 10:03 ` Jörn Engel
2008-03-20 11:56   ` Adrian McMenamin
2008-03-20 11:20     ` Jörn Engel
2008-03-20 12:56       ` Adrian McMenamin
2008-03-20 12:31         ` Jörn Engel [this message]
2008-03-20 20:11           ` Adrian McMenamin
2008-03-20 21:58             ` Jörn Engel
2008-03-20 22:27               ` Adrian McMenamin
2008-03-21  9:49                 ` 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=20080320123139.GE1355@logfs.org \
    --to=joern@logfs.org \
    --cc=adrian@newgolddream.dyndns.info \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox