On Mon, 16 Jan 2012 14:11:20 +0100
Oliver Neukum <oneu...@suse.de> wrote:

> Am Montag, 16. Januar 2012, 14:02:05 schrieb Hans Verkuil:
> > > > +/* Set frequency (if non-0), PA, mute and turn on/off the FM
> > > > transmitter. */ +static int keene_cmd_main(struct keene_device *radio,
> > > > unsigned freq, bool play) +{
> > > > +   unsigned short freq_send = freq ? (freq - 76 * 16000) / 800 : 0;
> > > > +   int ret;
> > > > +
> > > > +   radio->buffer[0] = 0x00;
> > > > +   radio->buffer[1] = 0x50;
> > > > +   radio->buffer[2] = (freq_send >> 8) & 0xff;
> > > > +   radio->buffer[3] = freq_send & 0xff;
> > > 
> > > Please use the endianness macro appropriate here
> > 
> > I don't see any endianness issues here, but perhaps I missed something.
> 
> You are doing the endianness conversion by hand. We have a nice macro

No - it's packing bytes into a buffer from a u16. That doesn't have a
macro.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to