From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752738AbdK0NGV (ORCPT ); Mon, 27 Nov 2017 08:06:21 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:39591 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752513AbdK0NGR (ORCPT ); Mon, 27 Nov 2017 08:06:17 -0500 X-Google-Smtp-Source: AGs4zMaa1HMqPVQNEDnV5zLZe4FP9tXYyrcv+lpEdLHIAk8snWmuzRdPWXn7Q8ReD2rXVG+dYZHqHw== Date: Mon, 27 Nov 2017 14:06:10 +0100 From: Johan Hovold To: walter harms Cc: Colin King , Johan Hovold , Greg Kroah-Hartman , 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 Message-ID: <20171127130610.GE9862@localhost> References: <20171120174015.7191-1-colin.king@canonical.com> <5A1337DF.2060404@bfs.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5A1337DF.2060404@bfs.de> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > > > The assignment of DIV to itself is redundant and can be removed. > > > > Signed-off-by: Colin Ian King > > --- > > 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