tua6100: Avoid build warnings.
authorDavid S. Miller <davem@davemloft.net>
Thu, 30 May 2019 18:36:15 +0000 (11:36 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 May 2019 18:36:15 +0000 (11:36 -0700)
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>
drivers/media/dvb-frontends/tua6100.c

index b233b7be0b84aaee1eb621660c02a22614e988fa..e6aaf4973aef47bdf8e84628bf5aa471734b2b96 100644 (file)
@@ -75,8 +75,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
@@ -91,14 +91,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)
@@ -110,18 +110,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)