staging: fbtft: ternary statement to if statement.
authorBhagyashri Dighole <digholebhagyashri@gmail.com>
Tue, 19 Mar 2019 11:00:37 +0000 (16:30 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Mar 2019 13:35:42 +0000 (14:35 +0100)
Convert a ternary statement into a if statement which is detected while
resolving "WARNING: line over 80 characters". Use BIT() macro instead
manually left shifting.

Signed-off-by: Bhagyashri Dighole <digholebhagyashri@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fbtft/fb_ssd1306.c

index d7c5e2e0eee9677995b9a9f62425c6130c882160..6cf9df579e88b69470422d2d1cdbc852e6c4bd9d 100644 (file)
@@ -184,7 +184,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
                for (y = 0; y < yres / 8; y++) {
                        *buf = 0x00;
                        for (i = 0; i < 8; i++)
-                               *buf |= (vmem16[(y * 8 + i) * xres + x] ? 1 : 0) << i;
+                               if (vmem16[(y * 8 + i) * xres + x])
+                                       *buf |= BIT(i);
                        buf++;
                }
        }