staging: fbtft: Fix duplicate arguments to bitwise AND
authorJamal Shareef <jamal.k.shareef@gmail.com>
Wed, 23 Oct 2019 21:51:05 +0000 (14:51 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Oct 2019 03:14:17 +0000 (23:14 -0400)
Fix duplicated arguments to bitwise & operator.
Issue detected by coccinelle.

Signed-off-by: Jamal Shareef <jamal.k.shareef@gmail.com>
Link: https://lore.kernel.org/r/20191023215105.18049-1-jamal.k.shareef@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fbtft/fb_uc1611.c

index 65681d0..e763205 100644 (file)
@@ -91,7 +91,7 @@ static int init_display(struct fbtft_par *par)
        write_reg(par, 0x2C | (pump & 0x03));
 
        /* Set inverse display */
-       write_reg(par, 0xA6 | (0x01 & 0x01));
+       write_reg(par, 0xA6 | 0x01);
 
        /* Set 4-bit grayscale mode */
        write_reg(par, 0xD0 | (0x02 & 0x03));
@@ -157,8 +157,8 @@ static int set_var(struct fbtft_par *par)
                /* Set RAM address control */
                write_reg(par, 0x88
                        | (0x0 & 0x1) << 2 /* Increment positively */
-                       | (0x1 & 0x1) << 1 /* Increment page first */
-                       | (0x1 & 0x1));    /* Wrap around (default) */
+                       | (0x1 << 1)       /* Increment page first */
+                       | 0x1);            /* Wrap around (default) */
 
                /* Set LCD mapping */
                write_reg(par, 0xC0
@@ -171,11 +171,11 @@ static int set_var(struct fbtft_par *par)
                write_reg(par, 0x88
                        | (0x0 & 0x1) << 2 /* Increment positively */
                        | (0x0 & 0x1) << 1 /* Increment column first */
-                       | (0x1 & 0x1));    /* Wrap around (default) */
+                       | 0x1);            /* Wrap around (default) */
 
                /* Set LCD mapping */
                write_reg(par, 0xC0
-                       | (0x1 & 0x1) << 2 /* Mirror Y ON */
+                       | (0x1 << 2)       /* Mirror Y ON */
                        | (0x0 & 0x1) << 1 /* Mirror X OFF */
                        | (0x0 & 0x1));    /* MS nibble last (default) */
                break;
@@ -183,13 +183,13 @@ static int set_var(struct fbtft_par *par)
                /* Set RAM address control */
                write_reg(par, 0x88
                        | (0x0 & 0x1) << 2 /* Increment positively */
-                       | (0x1 & 0x1) << 1 /* Increment page first */
-                       | (0x1 & 0x1));    /* Wrap around (default) */
+                       | (0x1 << 1)       /* Increment page first */
+                       | 0x1);            /* Wrap around (default) */
 
                /* Set LCD mapping */
                write_reg(par, 0xC0
-                       | (0x1 & 0x1) << 2 /* Mirror Y ON */
-                       | (0x1 & 0x1) << 1 /* Mirror X ON */
+                       | (0x1 << 2)       /* Mirror Y ON */
+                       | (0x1 << 1)       /* Mirror X ON */
                        | (0x0 & 0x1));    /* MS nibble last (default) */
                break;
        default:
@@ -197,12 +197,12 @@ static int set_var(struct fbtft_par *par)
                write_reg(par, 0x88
                        | (0x0 & 0x1) << 2 /* Increment positively */
                        | (0x0 & 0x1) << 1 /* Increment column first */
-                       | (0x1 & 0x1));    /* Wrap around (default) */
+                       | 0x1);            /* Wrap around (default) */
 
                /* Set LCD mapping */
                write_reg(par, 0xC0
                        | (0x0 & 0x1) << 2 /* Mirror Y OFF */
-                       | (0x1 & 0x1) << 1 /* Mirror X ON */
+                       | (0x1 << 1)       /* Mirror X ON */
                        | (0x0 & 0x1));    /* MS nibble last (default) */
                break;
        }