All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: olpc_dcon: more big endian conformity
@ 2013-08-04 21:04 Jens Frederich
  2013-08-12 21:07 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Jens Frederich @ 2013-08-04 21:04 UTC (permalink / raw)
  To: gregkh; +Cc: dsd, jon.nettleton, devel, linux-kernel, Jens Frederich

Using an int which is casted to unsigned char as inbuf is messy.
The code won't work on big endian systems.  The patch should fix
this.

Signed-off-by: Jens Frederich <jfrederich@gmail.com>

diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c
index 5ca4fa4..198595e 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -122,12 +122,13 @@ err:
 static int dcon_bus_stabilize(struct dcon_priv *dcon, int is_powered_down)
 {
 	unsigned long timeout;
+	u8 pm;
 	int x;
 
 power_up:
 	if (is_powered_down) {
-		x = 1;
-		x = olpc_ec_cmd(EC_DCON_POWER_MODE, (u8 *)&x, 1, NULL, 0);
+		pm = 1;
+		x = olpc_ec_cmd(EC_DCON_POWER_MODE, &pm, 1, NULL, 0);
 		if (x) {
 			pr_warn("unable to force dcon to power up: %d!\n", x);
 			return x;
@@ -144,8 +145,8 @@ power_up:
 	if (x < 0) {
 		pr_err("unable to stabilize dcon's smbus, reasserting power and praying.\n");
 		BUG_ON(olpc_board_at_least(olpc_board(0xc2)));
-		x = 0;
-		olpc_ec_cmd(EC_DCON_POWER_MODE, (u8 *)&x, 1, NULL, 0);
+		pm = 0;
+		olpc_ec_cmd(EC_DCON_POWER_MODE, &pm, 1, NULL, 0);
 		msleep(100);
 		is_powered_down = 1;
 		goto power_up;	/* argh, stupid hardware.. */
@@ -208,8 +209,8 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep)
 		return;
 
 	if (sleep) {
-		x = 0;
-		x = olpc_ec_cmd(EC_DCON_POWER_MODE, (u8 *)&x, 1, NULL, 0);
+		u8 pm = 0;
+		x = olpc_ec_cmd(EC_DCON_POWER_MODE, &pm, 1, NULL, 0);
 		if (x)
 			pr_warn("unable to force dcon to power down: %d!\n", x);
 		else
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Staging: olpc_dcon: more big endian conformity
  2013-08-04 21:04 [PATCH] Staging: olpc_dcon: more big endian conformity Jens Frederich
@ 2013-08-12 21:07 ` Greg KH
  2013-08-15 19:18   ` Jens Frederich
  2013-08-15 19:54   ` Jens Frederich
  0 siblings, 2 replies; 6+ messages in thread
From: Greg KH @ 2013-08-12 21:07 UTC (permalink / raw)
  To: Jens Frederich; +Cc: devel, jon.nettleton, dsd, linux-kernel

On Sun, Aug 04, 2013 at 11:04:16PM +0200, Jens Frederich wrote:
> Using an int which is casted to unsigned char as inbuf is messy.
> The code won't work on big endian systems.  The patch should fix
> this.
> 
> Signed-off-by: Jens Frederich <jfrederich@gmail.com>

This patch doesn't apply at all, can you refresh it against my
staging-next branch and resend it so that I can apply it?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Staging: olpc_dcon: more big endian conformity
  2013-08-12 21:07 ` Greg KH
@ 2013-08-15 19:18   ` Jens Frederich
  2013-08-15 19:54   ` Jens Frederich
  1 sibling, 0 replies; 6+ messages in thread
From: Jens Frederich @ 2013-08-15 19:18 UTC (permalink / raw)
  To: Greg KH; +Cc: devel, Jon Nettleton, Daniel Drake, linux-kernel

On Mon, Aug 12, 2013 at 11:07 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Sun, Aug 04, 2013 at 11:04:16PM +0200, Jens Frederich wrote:
>> Using an int which is casted to unsigned char as inbuf is messy.
>> The code won't work on big endian systems.  The patch should fix
>> this.
>>
>> Signed-off-by: Jens Frederich <jfrederich@gmail.com>
>
> This patch doesn't apply at all, can you refresh it against my
> staging-next branch and resend it so that I can apply it?
>

There has been three outstanding patches. I'll resend it again.

thanks,
jens

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Staging: olpc_dcon: more big endian conformity
  2013-08-12 21:07 ` Greg KH
  2013-08-15 19:18   ` Jens Frederich
@ 2013-08-15 19:54   ` Jens Frederich
  2013-08-16  0:22     ` Greg KH
  1 sibling, 1 reply; 6+ messages in thread
From: Jens Frederich @ 2013-08-15 19:54 UTC (permalink / raw)
  To: Greg KH; +Cc: devel, Jon Nettleton, Daniel Drake, linux-kernel

On Mon, Aug 12, 2013 at 11:07 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Sun, Aug 04, 2013 at 11:04:16PM +0200, Jens Frederich wrote:
>> Using an int which is casted to unsigned char as inbuf is messy.
>> The code won't work on big endian systems.  The patch should fix
>> this.
>>
>> Signed-off-by: Jens Frederich <jfrederich@gmail.com>
>
> This patch doesn't apply at all, can you refresh it against my
> staging-next branch and resend it so that I can apply it?
>

Sorry for the duplicated patch 3.  The subject:
[PATCH] Staging: olpc_dcon: more big endian conformity and
[PATCH 3/3] Staging: olpc_dcon: more big endian conformity
is equal for the Google mail client and lands in the same
thread.  I'd use Mutt.

thanks,
jens

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Staging: olpc_dcon: more big endian conformity
  2013-08-15 19:54   ` Jens Frederich
@ 2013-08-16  0:22     ` Greg KH
  2013-08-16  5:58       ` Jens Frederich
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2013-08-16  0:22 UTC (permalink / raw)
  To: Jens Frederich; +Cc: devel, Jon Nettleton, Daniel Drake, linux-kernel

On Thu, Aug 15, 2013 at 09:54:05PM +0200, Jens Frederich wrote:
> On Mon, Aug 12, 2013 at 11:07 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Sun, Aug 04, 2013 at 11:04:16PM +0200, Jens Frederich wrote:
> >> Using an int which is casted to unsigned char as inbuf is messy.
> >> The code won't work on big endian systems.  The patch should fix
> >> this.
> >>
> >> Signed-off-by: Jens Frederich <jfrederich@gmail.com>
> >
> > This patch doesn't apply at all, can you refresh it against my
> > staging-next branch and resend it so that I can apply it?
> >
> 
> Sorry for the duplicated patch 3.  The subject:
> [PATCH] Staging: olpc_dcon: more big endian conformity and
> [PATCH 3/3] Staging: olpc_dcon: more big endian conformity
> is equal for the Google mail client and lands in the same
> thread.  I'd use Mutt.

I do use mutt, and see two copies of this patch sent.

What happened to patch 1/3, I never got that.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Staging: olpc_dcon: more big endian conformity
  2013-08-16  0:22     ` Greg KH
@ 2013-08-16  5:58       ` Jens Frederich
  0 siblings, 0 replies; 6+ messages in thread
From: Jens Frederich @ 2013-08-16  5:58 UTC (permalink / raw)
  To: Greg KH; +Cc: devel, Jon Nettleton, Daniel Drake, linux-kernel

>
> What happened to patch 1/3, I never got that.
>

You never got it, okay I'll resend it to you.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-08-16  5:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-04 21:04 [PATCH] Staging: olpc_dcon: more big endian conformity Jens Frederich
2013-08-12 21:07 ` Greg KH
2013-08-15 19:18   ` Jens Frederich
2013-08-15 19:54   ` Jens Frederich
2013-08-16  0:22     ` Greg KH
2013-08-16  5:58       ` Jens Frederich

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.