lkml.org 
[lkml]   [2013]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Staging: olpc_dcon: replace some magic numbers
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


\
 
 \ /
  Last update: 2013-08-04 01:41    [W:0.065 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site