From: "Michael Büsch" <m@bues.ch>
To: Antti Palosaari <crope@iki.fi>
Cc: linux-media <linux-media@vger.kernel.org>
Subject: Re: [PATCH] Add fc0011 tuner driver
Date: Mon, 7 May 2012 23:00:31 +0200 [thread overview]
Message-ID: <20120507230031.2b1e9e3c@milhouse> (raw)
In-Reply-To: <4FA81C3A.1020108@iki.fi>
[-- Attachment #1: Type: text/plain, Size: 1442 bytes --]
On Mon, 07 May 2012 22:02:18 +0300
Antti Palosaari <crope@iki.fi> wrote:
> On 02.04.2012 19:14, Michael Büsch wrote:
> > This adds support for the Fitipower fc0011 DVB-t tuner.
> >
> > Signed-off-by: Michael Buesch<m@bues.ch>
>
> > + unsigned int i, vco_retries;
> > + u32 freq = p->frequency / 1000;
> > + u32 bandwidth = p->bandwidth_hz / 1000;
> > + u32 fvco, xin, xdiv, xdivr;
> > + u16 frac;
> > + u8 fa, fp, vco_sel, vco_cal;
> > + u8 regs[FC11_NR_REGS] = { };
>
> > +
> > + dev_dbg(&priv->i2c->dev, "Tuned to "
> > + "fa=%02X fp=%02X xin=%02X%02X vco=%02X vcosel=%02X "
> > + "vcocal=%02X(%u) bw=%u\n",
> > + (unsigned int)regs[FC11_REG_FA],
> > + (unsigned int)regs[FC11_REG_FP],
> > + (unsigned int)regs[FC11_REG_XINHI],
> > + (unsigned int)regs[FC11_REG_XINLO],
> > + (unsigned int)regs[FC11_REG_VCO],
> > + (unsigned int)regs[FC11_REG_VCOSEL],
> > + (unsigned int)vco_cal, vco_retries,
> > + (unsigned int)bandwidth);
>
> Just for the interest, is there any reason you use so much casting or is
> that only your style?
Well it makes sure the types are what the format string and thus vararg code expects.
it is true that most (probably all) of those explicit casts could be removed and instead
rely on implicit casts and promotions. But I personally prefer explicit casts
in this case (and only this case).
--
Greetings, Michael.
PGP encryption is encouraged / 908D8B0E
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-05-07 21:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-02 16:14 [PATCH] Add fc0011 tuner driver Michael Büsch
2012-04-02 16:56 ` Antti Palosaari
2012-04-02 17:20 ` Michael Büsch
2012-04-02 17:40 ` Antti Palosaari
2012-04-02 17:51 ` Michael Büsch
2012-04-02 21:52 ` Antti Palosaari
2012-04-03 6:36 ` Michael Büsch
2012-05-07 19:02 ` Antti Palosaari
2012-05-07 21:00 ` Michael Büsch [this message]
2012-05-07 21:13 ` Rémi Denis-Courmont
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=20120507230031.2b1e9e3c@milhouse \
--to=m@bues.ch \
--cc=crope@iki.fi \
--cc=linux-media@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).