]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
staging: fbtft: Replace a bit shift by a use of BIT.
authorArushi Singhal <arushisinghal19971997@gmail.com>
Wed, 22 Mar 2017 16:58:28 +0000 (22:28 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Mar 2017 13:25:33 +0000 (14:25 +0100)
This patch replaces bit shifting on 1 with the BIT(x) macro.
This was done with coccinelle:
@@
constant c;
@@

-1 << c
+BIT(c)

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fbtft/fb_agm1264k-fl.c
drivers/staging/fbtft/fb_ili9163.c
drivers/staging/fbtft/fb_ili9325.c
drivers/staging/fbtft/fb_ssd1289.c

index 4ee76dbd30b59a7ca58ad8f90a88c8e0136c813b..489151a6bf802fbaa4642ee29240e756fe360cb2 100644 (file)
@@ -369,7 +369,7 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
                        /* select left side (sc0)
                         * set addr
                         */
-                       write_reg(par, 0x00, (1 << 6) | (u8)addr_win.xs);
+                       write_reg(par, 0x00, BIT(6) | (u8)addr_win.xs);
                        write_reg(par, 0x00, (0x17 << 3) | (u8)y);
 
                        /* write bitmap */
index 579e17734612ac44188a7adcad7630df498937e9..045cadc3bc65466274e16e6484c65f25865c941b 100644 (file)
@@ -194,7 +194,7 @@ static int set_var(struct fbtft_par *par)
 
        /* Colorspcae */
        if (par->bgr)
-               mactrl_data |= (1 << 2);
+               mactrl_data |= BIT(2);
        write_reg(par, MIPI_DCS_SET_ADDRESS_MODE, mactrl_data);
        write_reg(par, MIPI_DCS_WRITE_MEMORY_START);
        return 0;
index 7189de5ae4b37061311db84d6701baefebe7ef9d..7f9e9b25490e1e155497efc1c8e1e9aeb43e299d 100644 (file)
@@ -126,7 +126,7 @@ static int init_display(struct fbtft_par *par)
        write_reg(par, 0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */
        mdelay(200); /* Dis-charge capacitor power voltage */
        write_reg(par, 0x0010, /* SAP, BT[3:0], AP, DSTB, SLP, STB */
-               (1 << 12) | (bt << 8) | (1 << 7) | (0x01 << 4));
+               BIT(12) | (bt << 8) | BIT(7) | BIT(4));
        write_reg(par, 0x0011, 0x220 | vc); /* DC1[2:0], DC0[2:0], VC[2:0] */
        mdelay(50); /* Delay 50ms */
        write_reg(par, 0x0012, vrh); /* Internal reference voltage= Vci; */
index c603e1516e647f938ee029cb871782535a18ba67..129e175fcd7eabb6b0f8f9c0a4b014d9ff3aa708 100644 (file)
@@ -47,7 +47,7 @@ static int init_display(struct fbtft_par *par)
        write_reg(par, 0x0E, 0x2B00);
        write_reg(par, 0x1E, 0x00B7);
        write_reg(par, 0x01,
-               (1 << 13) | (par->bgr << 11) | (1 << 9) | (HEIGHT - 1));
+               BIT(13) | (par->bgr << 11) | BIT(9) | (HEIGHT - 1));
        write_reg(par, 0x02, 0x0600);
        write_reg(par, 0x10, 0x0000);
        write_reg(par, 0x05, 0x0000);