All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Colin Ian King <colin.i.king@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-serial@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] serial: 8250_pci: remove redundant assignment to tmp after the mask operation
Date: Mon, 6 Dec 2021 15:46:39 +0200	[thread overview]
Message-ID: <Ya4UP5ceA8jINvVT@smile.fi.intel.com> (raw)
In-Reply-To: <20211205232822.110099-1-colin.i.king@gmail.com>

On Sun, Dec 05, 2021 at 11:28:22PM +0000, Colin Ian King wrote:
> The variable tmp is being masked with a bitmask and the value is being
> written to port base + 0x3c.  However, the masked value is being written
> back to tmp and tmp is never used after this. The assignmentment is
> redundant, replace the &= operator with just &.

Make sense (maybe you can replace all those 0x00...BIT...00 by BIT()
and GENMASK() later on).

Reviewesd-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  drivers/tty/serial/8250/8250_pci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
> index 60f8fffdfd77..81aac3c25ead 100644
> --- a/drivers/tty/serial/8250/8250_pci.c
> +++ b/drivers/tty/serial/8250/8250_pci.c
> @@ -1278,7 +1278,7 @@ static int pci_quatech_init(struct pci_dev *dev)
>  			outl(inl(base + 0x38) | 0x00002000, base + 0x38);
>  			tmp = inl(base + 0x3c);
>  			outl(tmp | 0x01000000, base + 0x3c);
> -			outl(tmp &= ~0x01000000, base + 0x3c);
> +			outl(tmp & ~0x01000000, base + 0x3c);
>  		}
>  	}
>  	return 0;
> -- 
> 2.33.1
> 

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2021-12-06 13:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-05 23:28 [PATCH] serial: 8250_pci: remove redundant assignment to tmp after the mask operation Colin Ian King
2021-12-06 13:46 ` Andy Shevchenko [this message]

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=Ya4UP5ceA8jINvVT@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=colin.i.king@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.