Re: [PATCH 4/4] sisusb: remove useless macros and compact the code

From: Joe Perches
Date: Tue Jan 22 2019 - 10:57:55 EST


On Tue, 2019-01-22 at 16:12 +0100, Jiri Slaby wrote:
> Remove macros which are only wrappers around standard operations. When
> we expand them into code, we see that sisusbcon_memsetw can simply use
> memset16 and sisusbcon_putcs can just call memcpy. So make the code
> compact.
[]
> diff --git a/drivers/usb/misc/sisusbvga/sisusb_con.c b/drivers/usb/misc/sisusbvga/sisusb_con.c
[]
> @@ -344,13 +337,11 @@ sisusbcon_invert_region(struct vc_data *vc, u16 *p, int count)
> */
>
> while (count--) {
> - u16 a = sisusbcon_readw(p);
> -
> - a = ((a) & 0x88ff) |
> - (((a) & 0x7000) >> 4) |
> - (((a) & 0x0700) << 4);
> + u16 a = *p;
>
> - sisusbcon_writew(a, p++);
> + *p++ = ((a) & 0x88ff) |
> + (((a) & 0x7000) >> 4) |
> + (((a) & 0x0700) << 4);

You might remove the unnecessary parentheses
around (a) here too