linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: walter harms <wharms@bfs.de>
Cc: Colin King <colin.king@canonical.com>,
	Johan Hovold <johan@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB: serial: iuu_phoenix: remove redundant assignment of DIV to itself
Date: Mon, 27 Nov 2017 14:06:10 +0100	[thread overview]
Message-ID: <20171127130610.GE9862@localhost> (raw)
In-Reply-To: <5A1337DF.2060404@bfs.de>

On Mon, Nov 20, 2017 at 09:15:27PM +0100, walter harms wrote:
> Am 20.11.2017 18:40, schrieb Colin King:
> > From: Colin Ian King <colin.king@canonical.com>
> > 
> > The assignment of DIV to itself is redundant and can be removed.
> > 
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > ---
> >  drivers/usb/serial/iuu_phoenix.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c
> > index 397a8012ffa3..62c91e360baf 100644
> > --- a/drivers/usb/serial/iuu_phoenix.c
> > +++ b/drivers/usb/serial/iuu_phoenix.c
> > @@ -472,7 +472,6 @@ static int iuu_clk(struct usb_serial_port *port, int dwFrq)
> >  				}
> >  	}
> >  	P2 = ((P - PO) / 2) - 4;
> > -	DIV = DIV;
> >  	PUMP = 0x04;
> >  	PBmsb = (P2 >> 8 & 0x03);
> >  	PBlsb = P2 & 0xFF;
> 
> These all all-upper-case stuff makes me a bit nervous. Normally this
> is reserved for #define ( I assume that the programmer refers to
> the original documentation) a point to change ?

Yeah, this isn't pretty and appears to have been copied directly from
the iuutool userspace tool (mentioned in the header).

> btw: i noticed  int frq = (int)dwFrq;
> since dwFrq is already an in, the cast is useless.

Indeed. Also present in original code.

This driver went in marked as "experimental", but the dependency on
CONFIG_EXPERIMENTAL was later dropped. These days something like this
would have need to be cleaned up (e.g. in staging) before getting
merged.

Johan

  reply	other threads:[~2017-11-27 13:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-20 17:40 [PATCH] USB: serial: iuu_phoenix: remove redundant assignment of DIV to itself Colin King
2017-11-20 20:15 ` walter harms
2017-11-27 13:06   ` Johan Hovold [this message]
2017-11-27 12:52 ` Johan Hovold

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=20171127130610.GE9862@localhost \
    --to=johan@kernel.org \
    --cc=colin.king@canonical.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=wharms@bfs.de \
    /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;
as well as URLs for NNTP newsgroup(s).