mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Jiri Slaby <jslaby@suse.cz>, thomas@winischhofer.net
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] sisusb: remove useless macros and compact the code
Date: Tue, 22 Jan 2019 07:57:47 -0800	[thread overview]
Message-ID: <920c0a6fa9db647f17ce94d29397a7ad0bf76e08.camel@perches.com> (raw)
In-Reply-To: <20190122151202.18152-4-jslaby@suse.cz>

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



  reply	other threads:[~2019-01-22 15:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 15:11 [PATCH 1/4] tty: sisusb_con, convert addr macros to functions Jiri Slaby
2019-01-22 15:12 ` [PATCH 2/4] tty: sisusb_con, cleanup configs Jiri Slaby
2019-01-22 15:12 ` [PATCH 3/4] sisusb: let files build only when needed Jiri Slaby
2019-01-22 15:12 ` [PATCH 4/4] sisusb: remove useless macros and compact the code Jiri Slaby
2019-01-22 15:57   ` Joe Perches [this message]
2019-01-22 15:23 ` [PATCH 1/4] tty: sisusb_con, convert addr macros to functions Greg KH
2019-01-22 15:26   ` Jiri Slaby
2019-01-25  9:03     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=920c0a6fa9db647f17ce94d29397a7ad0bf76e08.camel@perches.com \
    --to=joe@perches.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=thomas@winischhofer.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®