Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1249438pxa; Thu, 20 Aug 2020 06:45:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/YPE1TvGurluf/ppaLbtti7jH3NRSlsLSmYdOoRaav3TS6PwLzYzhU7w80HbepVshTP4k X-Received: by 2002:a17:906:8517:: with SMTP id i23mr3256533ejx.287.1597931115489; Thu, 20 Aug 2020 06:45:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597931115; cv=none; d=google.com; s=arc-20160816; b=NYVhLZNZVx6Zmb8IE0ZFTSiGzNAXaOQ+M1Mc0jb6HIOPQY1nFazLZUiGfFCmuq06Mz L0h1VaMxTRaxKRzcf9hS9bvvnFEDsFNkA4ELPioqCm0DUAHX64IMvBLP9LcMbhVsNAyq r6WEm9XeknAh9/5jYmd7OpnaOmWMiJK5f1XWQYjB+gET8Tv5v+DWIxiSksMjMmtxnEUT cDbqLjW6HMiSHZgxXb5C3quWYlcVpHbqGIvJtv04Cr8PrkwrY0fp/3tqrmvMvUfB7Qev XtAdYqcqWXtRYU9tuUIsXpKDn4p9pyR8v5DSw67LGp+UylMEAYQAeFCz+RMMDMDE0G84 tWyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rNY0/3IGgkXnJz5hLH3Ma5E1c8Yz05Iu37kKBgi3Deo=; b=GhTPI14TSUE4jXluS8uzDZMLmn3q42dqmLQIWAI6wfIpHqOClUypSjBueT5/IxsgzA sS9O5LhCoGkozdcO+zYeNCMxNTBzozFN2fjPik53H0tnAdo2x8XshbDVdLsoJmmAw4qk D+vVCttoN3h8FJ6jQS0OtNhTigiN4e7wJntALzd/vneMb3D9+wYY4oomT2zkBbtPZ7qE yjSVMW4hkdwVe10cYwC2ZPCRndmj00moK/j0v9JSmOFba5+x602hN5GAVDqXbKMiVKJG ZVwSz/UuMLlVP52lwNQX6tmPoD9Pud6tfHUs+ipyQs/bGsrK3AxzFxaece6oQZi+taan W8lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jWi5qC9N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si1357862ejb.68.2020.08.20.06.44.51; Thu, 20 Aug 2020 06:45:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jWi5qC9N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729924AbgHTNmN (ORCPT + 99 others); Thu, 20 Aug 2020 09:42:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:40486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728117AbgHTJ3t (ORCPT ); Thu, 20 Aug 2020 05:29:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 858CB21744; Thu, 20 Aug 2020 09:29:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915789; bh=kDSAgY3T2N8pzGL+AufxB3nLV2xVHcmx/Br5SerSUBE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jWi5qC9N5s9pdRwUlb+r7YCgLyzzrn9+ujvCd5kWxv8yw0h6W80+FYuDOYAcxHCXJ vsUPiEo4VUblaPSEGpM5uo60y27xlx9CpQho8tdjFUdMyCSTdIn0+PSYtQVLTMYEFs H7NgUF6zC47L6mM+o9NaTHX1S3yZLeGucItGg3Ps= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Sasha Levin Subject: [PATCH 5.8 135/232] USB: serial: ftdi_sio: make process-packet buffer unsigned Date: Thu, 20 Aug 2020 11:19:46 +0200 Message-Id: <20200820091619.361947211@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold [ Upstream commit ab4cc4ef6724ea588e835fc1e764c4b4407a70b7 ] Use an unsigned type for the process-packet buffer argument and give it a more apt name. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold Signed-off-by: Sasha Levin --- drivers/usb/serial/ftdi_sio.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 9ad44a96dfe3a..96b9e2768ac5c 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -2480,12 +2480,12 @@ static int ftdi_prepare_write_buffer(struct usb_serial_port *port, #define FTDI_RS_ERR_MASK (FTDI_RS_BI | FTDI_RS_PE | FTDI_RS_FE | FTDI_RS_OE) static int ftdi_process_packet(struct usb_serial_port *port, - struct ftdi_private *priv, char *packet, int len) + struct ftdi_private *priv, unsigned char *buf, int len) { + unsigned char status; + unsigned char *ch; int i; - char status; char flag; - char *ch; if (len < 2) { dev_dbg(&port->dev, "malformed packet\n"); @@ -2495,7 +2495,7 @@ static int ftdi_process_packet(struct usb_serial_port *port, /* Compare new line status to the old one, signal if different/ N.B. packet may be processed more than once, but differences are only processed once. */ - status = packet[0] & FTDI_STATUS_B0_MASK; + status = buf[0] & FTDI_STATUS_B0_MASK; if (status != priv->prev_status) { char diff_status = status ^ priv->prev_status; @@ -2521,7 +2521,7 @@ static int ftdi_process_packet(struct usb_serial_port *port, } /* save if the transmitter is empty or not */ - if (packet[1] & FTDI_RS_TEMT) + if (buf[1] & FTDI_RS_TEMT) priv->transmit_empty = 1; else priv->transmit_empty = 0; @@ -2535,29 +2535,29 @@ static int ftdi_process_packet(struct usb_serial_port *port, * data payload to avoid over-reporting. */ flag = TTY_NORMAL; - if (packet[1] & FTDI_RS_ERR_MASK) { + if (buf[1] & FTDI_RS_ERR_MASK) { /* Break takes precedence over parity, which takes precedence * over framing errors */ - if (packet[1] & FTDI_RS_BI) { + if (buf[1] & FTDI_RS_BI) { flag = TTY_BREAK; port->icount.brk++; usb_serial_handle_break(port); - } else if (packet[1] & FTDI_RS_PE) { + } else if (buf[1] & FTDI_RS_PE) { flag = TTY_PARITY; port->icount.parity++; - } else if (packet[1] & FTDI_RS_FE) { + } else if (buf[1] & FTDI_RS_FE) { flag = TTY_FRAME; port->icount.frame++; } /* Overrun is special, not associated with a char */ - if (packet[1] & FTDI_RS_OE) { + if (buf[1] & FTDI_RS_OE) { port->icount.overrun++; tty_insert_flip_char(&port->port, 0, TTY_OVERRUN); } } port->icount.rx += len; - ch = packet + 2; + ch = buf + 2; if (port->port.console && port->sysrq) { for (i = 0; i < len; i++, ch++) { -- 2.25.1