From patchwork Fri May 18 13:25:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10410755 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 20FB6601F9 for ; Fri, 18 May 2018 13:26:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10B0528982 for ; Fri, 18 May 2018 13:26:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 051F028988; Fri, 18 May 2018 13:26:12 +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 65E2528982 for ; Fri, 18 May 2018 13:26:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751542AbeERN0I (ORCPT ); Fri, 18 May 2018 09:26:08 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:39274 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752136AbeERN0E (ORCPT ); Fri, 18 May 2018 09:26:04 -0400 Received: by mail-lf0-f67.google.com with SMTP id j193-v6so13944476lfg.6 for ; Fri, 18 May 2018 06:26:04 -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=z9LNSDHm7gTxhtviO8GMNIqAFcImqwW0u33spL+Fu4k=; b=S/ITp9QRWa96sTAjGBGQ3heNdI15wJkBXfseUTwSYVHyS4ybPx4isN/sV5iRwmxLRT RreeXlB+4/AkEZ1gR8bIl3LHgDqM3J42DTyAAnGqgYSCn12wnaX1JApYALL8zciQ5XfI duglNXI7OwxJnWtYLRn1IUaqs06Xh1Kjs6mDApK7jjTIL5Qs9kjNUShCilq/ZM1TjLM2 4dwXyI8uyOL+iwgn0a1JzSsuUd9q9rMIEGOj1t4UNayTIW/B3whsrR2AsXI70PB04Jy0 chU9WOdAUoVNgqS9vn8cfLycIZHbLgOd0q7SdgKx0HDzjlP9DQ4WHMIZ+T5u7HblZdT0 bSZw== 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=z9LNSDHm7gTxhtviO8GMNIqAFcImqwW0u33spL+Fu4k=; b=RJty+NgJzHa1mzSTqYKSK74VsWYmPpiU2CmNIJzeZhCOkfdtUbyhUtb4v0TKh8hrCM lMNFvI9zcAZIMPORlQ2payDjpfKIPS/zslA+5epjGXI80MsczbvFBAWdjmD8dI7HN8lt w/VaF7OLjQ6qdXHKmDNQcigfWF5n8WOprnpEvBfHxItRowYgqOuMZ6eRnugWyN99cL4/ xwh2rtDvgM/in9CoWuzK25gNs/O9dqTXktpGHWedP1PnRK8nC36AvEYbcTQM+CrOrLu/ kCidNuXB3G1rJAwZNpvIDTLuMilOoIthSDJsQn6fPcUZlVYa6hUKmId2PgBajoz2uXcq 0bOQ== X-Gm-Message-State: ALKqPweRUaVd8HnmTRfx4kjYUDiX80zu/cp8y5E44UIVFVY7R0+UqLbU JAqMZLNpgQjCERug9nJ75gVB9DjV X-Google-Smtp-Source: AB8JxZpOc+RO09i5taeS2Zj2GdADo6cslLfGm3aWx4m17L1z+ZssV8kt2kKVPU+bwVLeqkLoM1L6Nw== X-Received: by 2002:a19:cb06:: with SMTP id b6-v6mr21527482lfg.115.1526649963283; Fri, 18 May 2018 06:26:03 -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 r78-v6sm1237854ljb.20.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-0005fh-Pl; 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 2/4] USB: serial: ftdi_sio: use non-underscore fixed types Date: Fri, 18 May 2018 15:25:48 +0200 Message-Id: <20180518132550.21749-3-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 Replace all __u types with their u counterparts throughout the driver (whose structures are not exported to user space). Signed-off-by: Johan Hovold Reviewed-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 50 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 62c99871863c..0d24da03a4a3 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -54,7 +54,7 @@ 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 ; + u16 last_set_data_urb_value; /* the last data state set - needed for doing * a break */ @@ -62,7 +62,7 @@ struct ftdi_private { unsigned long last_dtr_rts; /* saved modem control outputs */ char prev_status; /* Used for TIOCMIWAIT */ char transmit_empty; /* If transmitter is empty or not */ - __u16 interface; /* FT2232C, FT2232H or FT4232H port interface + u16 interface; /* FT2232C, FT2232H or FT4232H port interface (0 for FT232/245) */ speed_t force_baud; /* if non-zero, force the baud rate to @@ -1063,10 +1063,10 @@ static int ftdi_get_modem_status(struct usb_serial_port *port, static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base); static unsigned short int ftdi_232am_baud_to_divisor(int baud); -static __u32 ftdi_232bm_baud_base_to_divisor(int baud, int base); -static __u32 ftdi_232bm_baud_to_divisor(int baud); -static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base); -static __u32 ftdi_2232h_baud_to_divisor(int baud); +static u32 ftdi_232bm_baud_base_to_divisor(int baud, int base); +static u32 ftdi_232bm_baud_to_divisor(int baud); +static u32 ftdi_2232h_baud_base_to_divisor(int baud, int base); +static u32 ftdi_2232h_baud_to_divisor(int baud); static struct usb_serial_driver ftdi_sio_device = { .driver = { @@ -1136,14 +1136,14 @@ static unsigned short int ftdi_232am_baud_to_divisor(int baud) return ftdi_232am_baud_base_to_divisor(baud, 48000000); } -static __u32 ftdi_232bm_baud_base_to_divisor(int baud, int base) +static u32 ftdi_232bm_baud_base_to_divisor(int baud, int base) { static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; - __u32 divisor; + u32 divisor; /* divisor shifted 3 bits to the left */ int divisor3 = base / 2 / baud; divisor = divisor3 >> 3; - divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; + divisor |= (u32)divfrac[divisor3 & 0x7] << 14; /* Deal with special cases for highest baud rates. */ if (divisor == 1) divisor = 0; @@ -1152,22 +1152,22 @@ static __u32 ftdi_232bm_baud_base_to_divisor(int baud, int base) return divisor; } -static __u32 ftdi_232bm_baud_to_divisor(int baud) +static u32 ftdi_232bm_baud_to_divisor(int baud) { return ftdi_232bm_baud_base_to_divisor(baud, 48000000); } -static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base) +static u32 ftdi_2232h_baud_base_to_divisor(int baud, int base) { static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; - __u32 divisor; + u32 divisor; int divisor3; /* hi-speed baud rate is 10-bit sampling instead of 16-bit */ divisor3 = base * 8 / (baud * 10); divisor = divisor3 >> 3; - divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; + divisor |= (u32)divfrac[divisor3 & 0x7] << 14; /* Deal with special cases for highest baud rates. */ if (divisor == 1) divisor = 0; @@ -1182,7 +1182,7 @@ static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base) return divisor; } -static __u32 ftdi_2232h_baud_to_divisor(int baud) +static u32 ftdi_2232h_baud_to_divisor(int baud) { return ftdi_2232h_baud_base_to_divisor(baud, 120000000); } @@ -1236,12 +1236,12 @@ static int update_mctrl(struct usb_serial_port *port, unsigned int set, } -static __u32 get_ftdi_divisor(struct tty_struct *tty, +static u32 get_ftdi_divisor(struct tty_struct *tty, struct usb_serial_port *port) { struct ftdi_private *priv = usb_get_serial_port_data(port); struct device *dev = &port->dev; - __u32 div_value = 0; + u32 div_value = 0; int div_okay = 1; int baud; @@ -1299,7 +1299,7 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty, case FT232RL: /* FT232RL chip */ case FTX: /* FT-X series */ if (baud <= 3000000) { - __u16 product_id = le16_to_cpu( + u16 product_id = le16_to_cpu( port->serial->dev->descriptor.idProduct); if (((product_id == FTDI_NDI_HUC_PID) || (product_id == FTDI_NDI_SPECTRA_SCU_PID) || @@ -1346,19 +1346,19 @@ 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 urb_value; + u16 urb_index; + u32 urb_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); + urb_value = (u16)urb_index_value; + urb_index = (u16)(urb_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); + urb_index = (u16)((urb_index << 8) | priv->interface); } rv = usb_control_msg(port->serial->dev, @@ -2140,7 +2140,7 @@ 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 urb_value; /* break_state = -1 to turn on break, and 0 to turn off break */ /* see drivers/char/tty_io.c to see it used */ @@ -2192,7 +2192,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 urb_value; /* will hold the new flags */ /* Added for xon/xoff support */ unsigned int iflag = termios->c_iflag;