tua6100: Avoid build warnings.
[ Upstream commit 621ccc6cc5
]
Rename _P to _P_VAL and _R to _R_VAL to avoid global
namespace conflicts:
drivers/media/dvb-frontends/tua6100.c: In function ‘tua6100_set_params’:
drivers/media/dvb-frontends/tua6100.c:79: warning: "_P" redefined
#define _P 32
In file included from ./include/acpi/platform/aclinux.h:54,
from ./include/acpi/platform/acenv.h:152,
from ./include/acpi/acpi.h:22,
from ./include/linux/acpi.h:34,
from ./include/linux/i2c.h:17,
from drivers/media/dvb-frontends/tua6100.h:30,
from drivers/media/dvb-frontends/tua6100.c:32:
./include/linux/ctype.h:14: note: this is the location of the previous definition
#define _P 0x10 /* punct */
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b24e816c9f
commit
e95d432c38
@ -80,8 +80,8 @@ static int tua6100_set_params(struct dvb_frontend *fe)
|
|||||||
struct i2c_msg msg1 = { .addr = priv->i2c_address, .flags = 0, .buf = reg1, .len = 4 };
|
struct i2c_msg msg1 = { .addr = priv->i2c_address, .flags = 0, .buf = reg1, .len = 4 };
|
||||||
struct i2c_msg msg2 = { .addr = priv->i2c_address, .flags = 0, .buf = reg2, .len = 3 };
|
struct i2c_msg msg2 = { .addr = priv->i2c_address, .flags = 0, .buf = reg2, .len = 3 };
|
||||||
|
|
||||||
#define _R 4
|
#define _R_VAL 4
|
||||||
#define _P 32
|
#define _P_VAL 32
|
||||||
#define _ri 4000000
|
#define _ri 4000000
|
||||||
|
|
||||||
// setup register 0
|
// setup register 0
|
||||||
@ -96,14 +96,14 @@ static int tua6100_set_params(struct dvb_frontend *fe)
|
|||||||
else
|
else
|
||||||
reg1[1] = 0x0c;
|
reg1[1] = 0x0c;
|
||||||
|
|
||||||
if (_P == 64)
|
if (_P_VAL == 64)
|
||||||
reg1[1] |= 0x40;
|
reg1[1] |= 0x40;
|
||||||
if (c->frequency >= 1525000)
|
if (c->frequency >= 1525000)
|
||||||
reg1[1] |= 0x80;
|
reg1[1] |= 0x80;
|
||||||
|
|
||||||
// register 2
|
// register 2
|
||||||
reg2[1] = (_R >> 8) & 0x03;
|
reg2[1] = (_R_VAL >> 8) & 0x03;
|
||||||
reg2[2] = _R;
|
reg2[2] = _R_VAL;
|
||||||
if (c->frequency < 1455000)
|
if (c->frequency < 1455000)
|
||||||
reg2[1] |= 0x1c;
|
reg2[1] |= 0x1c;
|
||||||
else if (c->frequency < 1630000)
|
else if (c->frequency < 1630000)
|
||||||
@ -115,18 +115,18 @@ static int tua6100_set_params(struct dvb_frontend *fe)
|
|||||||
* The N divisor ratio (note: c->frequency is in kHz, but we
|
* The N divisor ratio (note: c->frequency is in kHz, but we
|
||||||
* need it in Hz)
|
* need it in Hz)
|
||||||
*/
|
*/
|
||||||
prediv = (c->frequency * _R) / (_ri / 1000);
|
prediv = (c->frequency * _R_VAL) / (_ri / 1000);
|
||||||
div = prediv / _P;
|
div = prediv / _P_VAL;
|
||||||
reg1[1] |= (div >> 9) & 0x03;
|
reg1[1] |= (div >> 9) & 0x03;
|
||||||
reg1[2] = div >> 1;
|
reg1[2] = div >> 1;
|
||||||
reg1[3] = (div << 7);
|
reg1[3] = (div << 7);
|
||||||
priv->frequency = ((div * _P) * (_ri / 1000)) / _R;
|
priv->frequency = ((div * _P_VAL) * (_ri / 1000)) / _R_VAL;
|
||||||
|
|
||||||
// Finally, calculate and store the value for A
|
// Finally, calculate and store the value for A
|
||||||
reg1[3] |= (prediv - (div*_P)) & 0x7f;
|
reg1[3] |= (prediv - (div*_P_VAL)) & 0x7f;
|
||||||
|
|
||||||
#undef _R
|
#undef _R_VAL
|
||||||
#undef _P
|
#undef _P_VAL
|
||||||
#undef _ri
|
#undef _ri
|
||||||
|
|
||||||
if (fe->ops.i2c_gate_ctrl)
|
if (fe->ops.i2c_gate_ctrl)
|
||||||
|
Reference in New Issue
Block a user