lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <920c0a6fa9db647f17ce94d29397a7ad0bf76e08.camel@perches.com>
Date:   Tue, 22 Jan 2019 07:57:47 -0800
From:   Joe Perches <joe@...ches.com>
To:     Jiri Slaby <jslaby@...e.cz>, thomas@...ischhofer.net
Cc:     gregkh@...uxfoundation.org, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] sisusb: remove useless macros and compact the code

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ