Skip to content

Commit

Permalink
tua6100: Avoid build warnings.
Browse files Browse the repository at this point in the history
[ Upstream commit 621ccc6 ]

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 <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
davem330 authored and gregkh committed Aug 4, 2019
1 parent 5d3d68f commit ed532b4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions drivers/media/dvb-frontends/tua6100.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 msg2 = { .addr = priv->i2c_address, .flags = 0, .buf = reg2, .len = 3 };

#define _R 4
#define _P 32
#define _R_VAL 4
#define _P_VAL 32
#define _ri 4000000

// setup register 0
Expand All @@ -96,14 +96,14 @@ static int tua6100_set_params(struct dvb_frontend *fe)
else
reg1[1] = 0x0c;

if (_P == 64)
if (_P_VAL == 64)
reg1[1] |= 0x40;
if (c->frequency >= 1525000)
reg1[1] |= 0x80;

// register 2
reg2[1] = (_R >> 8) & 0x03;
reg2[2] = _R;
reg2[1] = (_R_VAL >> 8) & 0x03;
reg2[2] = _R_VAL;
if (c->frequency < 1455000)
reg2[1] |= 0x1c;
else if (c->frequency < 1630000)
Expand All @@ -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
* need it in Hz)
*/
prediv = (c->frequency * _R) / (_ri / 1000);
div = prediv / _P;
prediv = (c->frequency * _R_VAL) / (_ri / 1000);
div = prediv / _P_VAL;
reg1[1] |= (div >> 9) & 0x03;
reg1[2] = div >> 1;
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
reg1[3] |= (prediv - (div*_P)) & 0x7f;
reg1[3] |= (prediv - (div*_P_VAL)) & 0x7f;

#undef _R
#undef _P
#undef _R_VAL
#undef _P_VAL
#undef _ri

if (fe->ops.i2c_gate_ctrl)
Expand Down

0 comments on commit ed532b4

Please sign in to comment.