Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1686971pxb; Thu, 16 Sep 2021 12:59:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBRHnUU683QkdPYuvFPfLKpJE0PfETTG1rklOKUXFskvrlAzZybWPbZGnyDwrRpzh16CrC X-Received: by 2002:a6b:6c17:: with SMTP id a23mr5770980ioh.110.1631822383099; Thu, 16 Sep 2021 12:59:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631822383; cv=none; d=google.com; s=arc-20160816; b=mg1XIoXyJAI1mz3xPd5bim1dYS4yGNP7tOimK6Oty/V17gzv8GqwlnmmsLqkJ484M2 RxixGBrtDFuioRZBjTniAQcpnE4N6EhT6cWcIt5H2vOL6H5TyhrKCZM8wSKR62VSJaLs 1uUmN20y84iu/XZf+IXta3C9OGxoWR3996kPqcJGdYCECzJddEXWS3NkqwR83WWlEzfP XXlaEgjALxSeAsUazYV8pv7HM/ipJiygmT/99sFjBye3lE/O3DL4cygt1TtN+GhsI7r/ Gw+Q1EpJuglevbY470ELyi1uki7XRCiVH+D7m5EZvdiQS0soXl3YFnNPXqHt+1F2R2mn KqMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=w0ScXfiEgdyFe/fMJ5Rfm/xUirfSELzLcP/ojP8xo8k=; b=WWKiTiUH3nPhHu314rQFOkX/Wjc6BUFC/MAE9s6ZP/5SvKXwv7ZTr4N6WmbKkF1P0U ZYx8NAODlw4kr9Dp4RgoDHTfz7uVONPp0O3Ab389ktpB9HH8XYrQ+GE8BJBkPfJTvaOz w+F5S9gY/5iu6RWcL3RdJO5D31D49MYmwyEMMMtbAmSUYQ75sKuZH9peK6nnOkoxc1tU jO0hY7oiRi23kEuHfoyx0BlYl5LVc+W1xo3peOYT9tn9OMJOo5aR+6cwzRWqwMVYVQh0 rxCDuROOPLFigrqvbL7H/stSlUGSa4NqvRKayG7jFvJIAIJrfrDaPRfwojKjcAQMOQcI eUjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EzmS7Y9E; 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=pass (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 x19si3171299ilc.166.2021.09.16.12.59.31; Thu, 16 Sep 2021 12:59:43 -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=@linuxfoundation.org header.s=korg header.b=EzmS7Y9E; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240853AbhIPQX5 (ORCPT + 99 others); Thu, 16 Sep 2021 12:23:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:55040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240805AbhIPQOa (ORCPT ); Thu, 16 Sep 2021 12:14:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ADF656124D; Thu, 16 Sep 2021 16:10:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808631; bh=EHZMCFSHyOO1L7w81BhKWJw0Y/4adHCWEe+UnisaJIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EzmS7Y9EQJTOx5pYy5/YOyKphpYc2cwECljR092nMSc+9C5kPGvU9W25cc9cp3g95 +SAUZV0s+8Jbqoe+ndUuQV4PcDLQdA3fZi634h3dXDTfECD3H98fIJNs/TsZaaW9zm 6n5gHOEdmbAbhCgiOLTMQk6aZ/gWxQZfXC4Vi/8c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiri Slaby , Jordy Zomer , Sasha Levin Subject: [PATCH 5.10 164/306] serial: 8250_pci: make setup_port() parameters explicitly unsigned Date: Thu, 16 Sep 2021 17:58:29 +0200 Message-Id: <20210916155759.674992781@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman [ Upstream commit 3a96e97ab4e835078e6f27b7e1c0947814df3841 ] The bar and offset parameters to setup_port() are used in pointer math, and while it would be very difficult to get them to wrap as a negative number, just be "safe" and make them unsigned so that static checkers do not trip over them unintentionally. Cc: Jiri Slaby Reported-by: Jordy Zomer Link: https://lore.kernel.org/r/20210726130717.2052096-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/8250/8250_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index 39f9ea24e316..58f718ed1bb9 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -87,7 +87,7 @@ static void moan_device(const char *str, struct pci_dev *dev) static int setup_port(struct serial_private *priv, struct uart_8250_port *port, - int bar, int offset, int regshift) + u8 bar, unsigned int offset, int regshift) { struct pci_dev *dev = priv->dev; -- 2.30.2