lkml.org 
[lkml]   [2010]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] hmc6352: Add driver for the HMC6352 compass
Date
Am Donnerstag, 17. Juni 2010 13:20:48 schrieb Alan Cox:
> On Wed, 16 Jun 2010 14:43:45 +0200
> Oliver Neukum <oneukum@suse.de> wrote:
>
> > Am Mittwoch, 16. Juni 2010 14:16:14 schrieb Alan Cox:
> > > + msleep(10); /* sending 0x41 cmd we need to wait for 7-10 milli seconds */
> > > + ret = i2c_transfer(client->adapter, msg1, 1);
> > > + if (ret != 1) {
> > > + dev_warn(dev, "i2c read data cmd failed\n");
> > > + return ret;
> > > + }
> > > + ret_val = i2c_data[0];
> > > + ret_val = ((ret_val << 8) | i2c_data[1]);
> >
> > Please use the correct macro for this conversion.
>
> Its an array anyway - there isn't as such a 'correct macro' nor does it
> need to be using one.

So why does he use this unstructured data? Do we just hope the compiler
is good enough on big endian architectures?

Regards
Oliver


\
 
 \ /
  Last update: 2010-06-17 14:27    [W:0.081 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site