Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2319370pxb; Mon, 20 Sep 2021 18:42:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzO+qgjoor1KYpAZcHXtbKzMO9O2SwldYGwgwfzKDEPR1kb3M87tR3K5nIwmRW24cLcrw7D X-Received: by 2002:a6b:d915:: with SMTP id r21mr21077943ioc.76.1632188545087; Mon, 20 Sep 2021 18:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188545; cv=none; d=google.com; s=arc-20160816; b=Qe1ZybXfMzE8yVUPv8uoYowlddf2qe/7mAEt3lFphGCI3hJXz8X5E9rJJPG7tWMfmp t5o+56fE91KFwW53TCpC7PbijiVgVIJBHKgMeoGNxK+jHLewXoe/JyY7o+map/S2B55q oRfRRkDyRjXAEEHPre5fsL6O6qfSbVDLUR8gD98dG9wAr/Cjk7heKU0jkVggBAIfoZiT DXBV6vgohqbguSjK4puuBVtspVwb9lsBkSNyB/ohiH2kAy1+d8MUaeqUQ+g/2QDFMXNw 2Iz/I70HEYPcDbVjr/1ZWr0JLfJtoiGX16XGo9emlPJ6l1amBlXUQH+j4M4Z7h40hgxz g6Tw== 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=swuwQK+1t6j6KTDs/a6ByY06FQKVmwGuyDYzuF7z0s4=; b=WPx66S+mytkwPxWDH/FIyAKijOmIqOjDShfMTOdaffI5Ip7fe/d5EMZMm1TP1UhzLg 6vA/0NAS7MzTqLPr7ozkexlDIwCN29W+oYCVapcXtWHZDUrDSjNkBaw/6ItHJj4H/PzT p5evpzT4gBOrI7zHtoExPm+x8ahiX1DXHWdFCU/JZ4qFlX80bc99xCnHfNZftwZIhkcg 74oAZhPzhWW2v1mIItQswugnLYB5AxJLekq4R3gRVuh7E6oJJdMKePZzl+MrYUccBH6u yekO7XsHGilOnJCoLw1g94Ty0PLaD49tZS3hdjXEIbioyQ4xcrC3bquZxuPjZDIxcJy7 sR+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IlIEBGs5; 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 b8si15676005ios.12.2021.09.20.18.42.14; Mon, 20 Sep 2021 18:42:25 -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=IlIEBGs5; 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 S244188AbhITQxq (ORCPT + 99 others); Mon, 20 Sep 2021 12:53:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:36916 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244458AbhITQuV (ORCPT ); Mon, 20 Sep 2021 12:50:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 63DAB60F6E; Mon, 20 Sep 2021 16:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632156534; bh=t2DnsPgOihfcUtjeeX67dy+A84XuD9Hq03BYlV5z3uA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IlIEBGs56qVesHbDQh814vjYdZTd/0LoxmHoAR+mFsBy/9mzdWKFH5cIUBp/c4iyy /7nOkyy1h/vb6tDM6HEEb6h7+Qg8m5UA8RrVzJgb13qZ+hcxrCF0CXTxIC4AcUcOZg 9tbbzuCxVu3bM0HoCUb9S9nGnJs29ZNDTWgzXNVs= 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 4.4 104/133] serial: 8250_pci: make setup_port() parameters explicitly unsigned Date: Mon, 20 Sep 2021 18:43:02 +0200 Message-Id: <20210920163916.032531017@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163912.603434365@linuxfoundation.org> References: <20210920163912.603434365@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 72f6cde146b5..db66e533319e 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -78,7 +78,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