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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux