Re: [PATCH] Add fc0011 tuner driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 07 May 2012 22:02:18 +0300
Antti Palosaari <crope@xxxxxx> 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@xxxxxxx>
> 
> > +	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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux