From patchwork Fri May 18 13:25:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10410759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D4ED960383 for ; Fri, 18 May 2018 13:26:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C564228982 for ; Fri, 18 May 2018 13:26:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA3F928989; Fri, 18 May 2018 13:26:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E09028982 for ; Fri, 18 May 2018 13:26:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751980AbeERN0L (ORCPT ); Fri, 18 May 2018 09:26:11 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:39277 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752160AbeERN0G (ORCPT ); Fri, 18 May 2018 09:26:06 -0400 Received: by mail-lf0-f66.google.com with SMTP id j193-v6so13944567lfg.6 for ; Fri, 18 May 2018 06:26:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=mzzDnSnIThSJMiuy6ILYfw4+BqNBUk96o0ka6+cBAJU=; b=DothFcECqDT80qzgDT8c8T0+juYdsgRJtUbNsE1JS/LISOnhr+DmkoexysXHZL1/p8 m4SXVLTHJxtrby3UKKnaqHpq9u1VSezATT3zwNIlZ9C4Jg+C7OmBIze/+0qeAYQrQ06C MKIFRZ+hUh8dAnNbub+0+xzMSQ5FIX3juVssdXUmPlb7YqEzjQ3oSoVf0O/PuOlja9nX D1MumUYOED0ACZMuwSus7J0G9t9sTDM2bevoITfUNy1Ua4d83Kyvxmq2vX45Q2AYrshu W7sXdLPgIjlqov4jytz5heFHnOzRltymTsghtwo3eJpUH78At48W8kiHouGGLjg0aGK1 wq7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=mzzDnSnIThSJMiuy6ILYfw4+BqNBUk96o0ka6+cBAJU=; b=sgXrHDXJCMs3I8ZwKbTpMp1xMN4iwl7lii9SuADva82iscItL+dyQ2QXwEyYn5e8G+ EREaLJ/YU6c27D3+QBiFiiMwRiJGy4hd1lcqC3ffPpjI/lU2bP0UDWJDSvpMn1YTICUm YMVLHAnjmH3bFZ7mBtZqFCcCKbCOkS4qlrQZ8HEcZIPNsHBC3V9xaVzlZoghV7IqAgAe FgbdqWy0/XeBzD6ELOgweX705I5izWdPTWPhij75GNohqZuM575NEqsM2LlbHozeOKxi ps96ZYKMqSuru4UjWOiVHFGj94SMemFL2/BJ1g6UwctgHQedByv6sYxpyeQThgYWzToS /mSw== X-Gm-Message-State: ALKqPwckR+GPXm5ZTC5XcDZpb+npWEhRjgEMxvmA6mxtC9etuSOxsilp dM3x8PSlTHduAa0vR9yk7TkKTtua X-Google-Smtp-Source: AB8JxZroSAFrrECRy9w3QE4uvZEq3qmqhjSF67CU44Ppzbva1J7fCD1X1ogp5UOWErP/EUumZSUGkA== X-Received: by 2002:a2e:9a50:: with SMTP id k16-v6mr5660918ljj.36.1526649964316; Fri, 18 May 2018 06:26:04 -0700 (PDT) Received: from xi.terra (c-8bb2e655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.178.139]) by smtp.gmail.com with ESMTPSA id d5-v6sm1857411lfg.65.2018.05.18.06.26.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 06:26:02 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.90_1) (envelope-from ) id 1fJfOS-0005fm-TD; Fri, 18 May 2018 15:26:00 +0200 From: Johan Hovold To: Johan Hovold Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org Subject: [PATCH 3/4] USB: serial: ftdi_sio: drop unnecessary urb_ variable prefixes Date: Fri, 18 May 2018 15:25:49 +0200 Message-Id: <20180518132550.21749-4-johan@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518132550.21749-1-johan@kernel.org> References: <20180518132550.21749-1-johan@kernel.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Drop urb_ prefixes from value and index variables used in control requests. Signed-off-by: Johan Hovold Reviewed-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 83 +++++++++++++++++------------------ 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 0d24da03a4a3..3d7f181e7e2a 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -54,10 +54,9 @@ struct ftdi_private { int custom_divisor; /* custom_divisor kludge, this is for baud_base (different from what goes to the chip!) */ - u16 last_set_data_urb_value; - /* the last data state set - needed for doing - * a break - */ + u16 last_set_data_value; /* the last data state set - needed for doing + * a break + */ int flags; /* some ASYNC_xxxx flags are supported */ unsigned long last_dtr_rts; /* saved modem control outputs */ char prev_status; /* Used for TIOCMIWAIT */ @@ -1195,7 +1194,7 @@ static int update_mctrl(struct usb_serial_port *port, unsigned int set, { struct ftdi_private *priv = usb_get_serial_port_data(port); struct device *dev = &port->dev; - unsigned urb_value; + unsigned value; int rv; if (((set | clear) & (TIOCM_DTR | TIOCM_RTS)) == 0) { @@ -1204,20 +1203,20 @@ static int update_mctrl(struct usb_serial_port *port, unsigned int set, } clear &= ~set; /* 'set' takes precedence over 'clear' */ - urb_value = 0; + value = 0; if (clear & TIOCM_DTR) - urb_value |= FTDI_SIO_SET_DTR_LOW; + value |= FTDI_SIO_SET_DTR_LOW; if (clear & TIOCM_RTS) - urb_value |= FTDI_SIO_SET_RTS_LOW; + value |= FTDI_SIO_SET_RTS_LOW; if (set & TIOCM_DTR) - urb_value |= FTDI_SIO_SET_DTR_HIGH; + value |= FTDI_SIO_SET_DTR_HIGH; if (set & TIOCM_RTS) - urb_value |= FTDI_SIO_SET_RTS_HIGH; + value |= FTDI_SIO_SET_RTS_HIGH; rv = usb_control_msg(port->serial->dev, usb_sndctrlpipe(port->serial->dev, 0), FTDI_SIO_SET_MODEM_CTRL_REQUEST, FTDI_SIO_SET_MODEM_CTRL_REQUEST_TYPE, - urb_value, priv->interface, + value, priv->interface, NULL, 0, WDR_TIMEOUT); if (rv < 0) { dev_dbg(dev, "%s Error from MODEM_CTRL urb: DTR %s, RTS %s\n", @@ -1346,26 +1345,26 @@ static u32 get_ftdi_divisor(struct tty_struct *tty, static int change_speed(struct tty_struct *tty, struct usb_serial_port *port) { struct ftdi_private *priv = usb_get_serial_port_data(port); - u16 urb_value; - u16 urb_index; - u32 urb_index_value; + u16 value; + u16 index; + u32 index_value; int rv; - urb_index_value = get_ftdi_divisor(tty, port); - urb_value = (u16)urb_index_value; - urb_index = (u16)(urb_index_value >> 16); + index_value = get_ftdi_divisor(tty, port); + value = (u16)index_value; + index = (u16)(index_value >> 16); if ((priv->chip_type == FT2232C) || (priv->chip_type == FT2232H) || (priv->chip_type == FT4232H) || (priv->chip_type == FT232H)) { /* Probably the BM type needs the MSB of the encoded fractional * divider also moved like for the chips above. Any infos? */ - urb_index = (u16)((urb_index << 8) | priv->interface); + index = (u16)((index << 8) | priv->interface); } rv = usb_control_msg(port->serial->dev, usb_sndctrlpipe(port->serial->dev, 0), FTDI_SIO_SET_BAUDRATE_REQUEST, FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE, - urb_value, urb_index, + value, index, NULL, 0, WDR_SHORT_TIMEOUT); return rv; } @@ -2140,29 +2139,29 @@ static void ftdi_break_ctl(struct tty_struct *tty, int break_state) { struct usb_serial_port *port = tty->driver_data; struct ftdi_private *priv = usb_get_serial_port_data(port); - u16 urb_value; + u16 value; /* break_state = -1 to turn on break, and 0 to turn off break */ /* see drivers/char/tty_io.c to see it used */ - /* last_set_data_urb_value NEVER has the break bit set in it */ + /* last_set_data_value NEVER has the break bit set in it */ if (break_state) - urb_value = priv->last_set_data_urb_value | FTDI_SIO_SET_BREAK; + value = priv->last_set_data_value | FTDI_SIO_SET_BREAK; else - urb_value = priv->last_set_data_urb_value; + value = priv->last_set_data_value; if (usb_control_msg(port->serial->dev, usb_sndctrlpipe(port->serial->dev, 0), FTDI_SIO_SET_DATA_REQUEST, FTDI_SIO_SET_DATA_REQUEST_TYPE, - urb_value , priv->interface, + value , priv->interface, NULL, 0, WDR_TIMEOUT) < 0) { dev_err(&port->dev, "%s FAILED to enable/disable break state (state was %d)\n", __func__, break_state); } dev_dbg(&port->dev, "%s break state is %d - urb is %d\n", __func__, - break_state, urb_value); + break_state, value); } @@ -2192,7 +2191,7 @@ static void ftdi_set_termios(struct tty_struct *tty, struct ftdi_private *priv = usb_get_serial_port_data(port); struct ktermios *termios = &tty->termios; unsigned int cflag = termios->c_cflag; - u16 urb_value; /* will hold the new flags */ + u16 value; /* Added for xon/xoff support */ unsigned int iflag = termios->c_iflag; @@ -2258,44 +2257,44 @@ static void ftdi_set_termios(struct tty_struct *tty, no_skip: /* Set number of data bits, parity, stop bits */ - urb_value = 0; - urb_value |= (cflag & CSTOPB ? FTDI_SIO_SET_DATA_STOP_BITS_2 : - FTDI_SIO_SET_DATA_STOP_BITS_1); + value = 0; + value |= (cflag & CSTOPB ? FTDI_SIO_SET_DATA_STOP_BITS_2 : + FTDI_SIO_SET_DATA_STOP_BITS_1); if (cflag & PARENB) { if (cflag & CMSPAR) - urb_value |= cflag & PARODD ? - FTDI_SIO_SET_DATA_PARITY_MARK : - FTDI_SIO_SET_DATA_PARITY_SPACE; + value |= cflag & PARODD ? + FTDI_SIO_SET_DATA_PARITY_MARK : + FTDI_SIO_SET_DATA_PARITY_SPACE; else - urb_value |= cflag & PARODD ? - FTDI_SIO_SET_DATA_PARITY_ODD : - FTDI_SIO_SET_DATA_PARITY_EVEN; + value |= cflag & PARODD ? + FTDI_SIO_SET_DATA_PARITY_ODD : + FTDI_SIO_SET_DATA_PARITY_EVEN; } else { - urb_value |= FTDI_SIO_SET_DATA_PARITY_NONE; + value |= FTDI_SIO_SET_DATA_PARITY_NONE; } switch (cflag & CSIZE) { case CS5: dev_dbg(ddev, "Setting CS5 quirk\n"); break; case CS7: - urb_value |= 7; + value |= 7; dev_dbg(ddev, "Setting CS7\n"); break; default: case CS8: - urb_value |= 8; + value |= 8; dev_dbg(ddev, "Setting CS8\n"); break; } /* This is needed by the break command since it uses the same command - but is or'ed with this value */ - priv->last_set_data_urb_value = urb_value; + priv->last_set_data_value = value; if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), FTDI_SIO_SET_DATA_REQUEST, FTDI_SIO_SET_DATA_REQUEST_TYPE, - urb_value , priv->interface, + value , priv->interface, NULL, 0, WDR_SHORT_TIMEOUT) < 0) { dev_err(ddev, "%s FAILED to set databits/stopbits/parity\n", __func__); @@ -2354,13 +2353,13 @@ static void ftdi_set_termios(struct tty_struct *tty, */ vstart = termios->c_cc[VSTART]; vstop = termios->c_cc[VSTOP]; - urb_value = (vstop << 8) | (vstart); + value = (vstop << 8) | (vstart); if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), FTDI_SIO_SET_FLOW_CTRL_REQUEST, FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, - urb_value , (FTDI_SIO_XON_XOFF_HS + value , (FTDI_SIO_XON_XOFF_HS | priv->interface), NULL, 0, WDR_TIMEOUT) < 0) { dev_err(&port->dev, "urb failed to set to "