All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Oliver Neukum <oneukum@suse.de>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	linux-media@vger.kernel.org, linux-input@vger.kernel.org,
	Jiri Kosina <jkosina@suse.cz>,
	Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [RFC PATCH 2/3] radio-keene: add a driver for the Keene FM Transmitter.
Date: Mon, 16 Jan 2012 17:28:13 +0000	[thread overview]
Message-ID: <20120116172813.39bd4da6@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <201201161411.20514.oneukum@suse.de>

On Mon, 16 Jan 2012 14:11:20 +0100
Oliver Neukum <oneukum@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

  reply	other threads:[~2012-01-16 17:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-16 12:29 [RFC PATCH 0/3] New driver for the Keene USB FM Transmitter Hans Verkuil
2012-01-16 12:29 ` [RFC PATCH 1/3] v4l2-ctrls: fix ugly control name Hans Verkuil
2012-01-16 12:29   ` [RFC PATCH 2/3] radio-keene: add a driver for the Keene FM Transmitter Hans Verkuil
2012-01-16 12:44     ` Oliver Neukum
2012-01-16 13:02       ` Hans Verkuil
2012-01-16 13:11         ` Oliver Neukum
2012-01-16 17:28           ` Alan Cox [this message]
2012-01-16 12:46     ` Oliver Neukum
2012-01-16 13:03       ` Hans Verkuil
2012-01-16 13:15         ` Oliver Neukum
2012-01-16 12:29   ` [RFC PATCH 3/3] hid-core: ignore the Keene FM transmitter Hans Verkuil
2012-01-16 13:00   ` [RFC PATCH 1/3] v4l2-ctrls: fix ugly control name Oliver Neukum
2012-01-16 13:04     ` Hans Verkuil

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=20120116172813.39bd4da6@pyramind.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=oneukum@suse.de \
    /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 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.