From: Adrian McMenamin <adrian@newgolddream.dyndns.info>
To: "Jörn Engel" <joern@logfs.org>
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 20:11:01 +0000 [thread overview]
Message-ID: <1206043861.6274.8.camel@localhost.localdomain> (raw)
In-Reply-To: <20080320123139.GE1355@logfs.org>
On Thu, 2008-03-20 at 13:31 +0100, Jörn Engel wrote:
> 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.
You don't seem to have grasped that this is one type of device on a
proprietary bus which has other (types of) devices. I keep the code
consistent so that the API runs the same across the different devices -
makes the code easier to understand and maintain.
And given that this is also the variable that points to the memory block
that also includes the 8 bit based date that gets read in for block
writes I it makes perfect sense to have this as a void*.
next prev parent reply other threads:[~2008-03-20 20:11 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
2008-03-20 20:11 ` Adrian McMenamin [this message]
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=1206043861.6274.8.camel@localhost.localdomain \
--to=adrian@newgolddream.dyndns.info \
--cc=joern@logfs.org \
--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