Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: fbtft: convert a macro to a function.

Convert a macro to an inline function to improve type safety and make
the code simpler.

Signed-off-by: Bhagyashri Dighole <digholebhagyashri@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Bhagyashri Dighole and committed by
Greg Kroah-Hartman
dfa5fbb9 d8b2f7cf

+5 -4
+5 -4
drivers/staging/fbtft/fb_watterott.c
··· 90 90 return 0; 91 91 } 92 92 93 - #define RGB565toRGB332(c) ((((c) & 0xE000) >> 8) |\ 94 - (((c) & 000700) >> 6) |\ 95 - (((c) & 0x0018) >> 3)) 93 + static inline int rgb565_to_rgb332(u16 c) 94 + { 95 + return ((c & 0xE000) >> 8) | ((c & 000700) >> 6) | ((c & 0x0018) >> 3); 96 + } 96 97 97 98 static int write_vmem_8bit(struct fbtft_par *par, size_t offset, size_t len) 98 99 { ··· 117 116 for (i = start_line; i <= end_line; i++) { 118 117 pos[1] = cpu_to_be16(i); 119 118 for (j = 0; j < par->info->var.xres; j++) { 120 - buf8[j] = RGB565toRGB332(*vmem16); 119 + buf8[j] = rgb565_to_rgb332(*vmem16); 121 120 vmem16++; 122 121 } 123 122 ret = par->fbtftops.write(par,