From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jens Frederich <jfrederich@gmail.com>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
cjb@laptop.org, linux-kernel@vger.kernel.org,
dilinger@queued.net
Subject: Re: [PATCH] Staging: olpc_dcon: replace some magic numbers
Date: Sun, 4 Aug 2013 02:14:47 +0300 [thread overview]
Message-ID: <20130803231447.GF5051@mwanda> (raw)
In-Reply-To: <1375562675-7816-1-git-send-email-jfrederich@gmail.com>
On Sat, Aug 03, 2013 at 10:44:35PM +0200, Jens Frederich wrote:
> @@ -126,7 +127,7 @@ static int dcon_bus_stabilize(struct dcon_priv *dcon, int is_powered_down)
> power_up:
> if (is_powered_down) {
> x = 1;
> - x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
> + x = olpc_ec_cmd(EC_DCON_POWER_MODE, (u8 *)&x, 1, NULL, 0);
^^^^^^^^
You didn't introduce this but using "x" as the inbuf here messy.
It should be char instead of an int. The code won't work on big
endian systems. I know this hardware is only available on little
endian systems and that's why it's not a bug. It's just an ugly
thing to do.
(Since you didn't introduce this, it means your patch is fine and
you can ignore this email. I am just commenting in case anyone
wants to fix clean it up).
> if (x) {
> pr_warn("unable to force dcon to power up: %d!\n", x);
> return x;
regards,
dan carpenter
next prev parent reply other threads:[~2013-08-03 23:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-03 20:44 [PATCH] Staging: olpc_dcon: replace some magic numbers Jens Frederich
2013-08-03 21:16 ` Andres Salomon
2013-08-03 21:32 ` Jens Frederich
2013-08-03 21:36 ` Jens Frederich
2013-08-03 21:38 ` Andres Salomon
2013-08-03 23:16 ` Dan Carpenter
[not found] ` <CALHpu36i5jWk0ex=pBsuomSU1b+72ru4JGQQ0bd8OQT5QcaMgQ@mail.gmail.com>
2013-08-04 14:00 ` Jens Frederich
2013-08-03 23:14 ` Dan Carpenter [this message]
2013-08-04 20:18 ` Jens Frederich
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=20130803231447.GF5051@mwanda \
--to=dan.carpenter@oracle.com \
--cc=cjb@laptop.org \
--cc=devel@driverdev.osuosl.org \
--cc=dilinger@queued.net \
--cc=gregkh@linuxfoundation.org \
--cc=jfrederich@gmail.com \
--cc=linux-kernel@vger.kernel.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