Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1951297pxb; Thu, 16 Sep 2021 21:19:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8bSGzq81JQs53aTSh5K3BQPBKJArIbQkoL5Pt6/TzyO3gx/Ro8dzkF0lJg/iubjiFYtso X-Received: by 2002:a5d:9499:: with SMTP id v25mr6865646ioj.187.1631852395266; Thu, 16 Sep 2021 21:19:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631852395; cv=none; d=google.com; s=arc-20160816; b=paEtyKwMKEkgKpe3TQUxBeSegyZk3gOmuioECjDz637eCmvGqqC/PCr5jlyVgLqCA6 F/lBu5fsbkXwBmRRSsizgrE3I9tZrwGXYZIfXlgJijGU8BI20VO//yNjpCk4zeEgsScN UpfDNlqvtp8YhchTLXV4h53QQvTMNZ3c+aj/i3Mc7V+qOSleDMWUyKuEL3oF9nkmhMvB fn5VmFmPpcupn3teeEmH1QZxXW+0swDZQfTUfXvZVJMrBzaPNl0Z+veHdCeCuaJ5LMw/ xbe14TEzwypNcCGCAvAZM5G9anzsVTHvUyQgyY5F1zigrOA5xDyEMlbAj7/kHLjTZu8T DKOg== 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=Q0WITyWnp77xPE9iiuoxTmfOzayWaDUXYq6w2h/qMH4=; b=p57X2ABRmidBiZNANus7ZgxUG1laF9YtDCVSL7689sgfOdyamoAp/8Ve0Z2UlYleR/ DrEQ7GpwevU8c2zBc3Gn7GsDO6dHyYOQVmhKF2s6P0vulVr+DpMFmgQTD6N17am+Ez7A izbZvVvrlHIOcQgzMSGF9ARtJZHk/sruMCBHXOtRUu0Of5oLGz9x6/PWCygwMlyK4ayN 8bLs07Ez4dMrZk1gAxAY4UwhSz6eTJMeF2MBlMZnMX6QnXeZW8EFn/U/nTWUE6KryunA /H50Xlc44NaIzG5ph3n+tEOwBTVubENM8KjRom1zmXgxGkymFZMU6lWMdnxDkSYIu5GE vvOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y75bvHB4; 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 m12si2276403ioj.101.2021.09.16.21.19.44; Thu, 16 Sep 2021 21:19:55 -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=Y75bvHB4; 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 S1352292AbhIPRhR (ORCPT + 99 others); Thu, 16 Sep 2021 13:37:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:46944 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352338AbhIPR14 (ORCPT ); Thu, 16 Sep 2021 13:27:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D72ED61BF5; Thu, 16 Sep 2021 16:45:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631810741; bh=nv/jOUxKTaJ0v/uL56vZxSME+fATAGjjAdnhJxvqmvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y75bvHB4LfHnvsNJy1X0yTQ2bF0x4UCABNPSiBrpt660fvgswRNsmQ4muWPeoxyD+ l8L28WdqZlSBwqeTHsGY2FFMfP8ch+gVf6jclMt3ys4A7NFNoIz6Zw6GSsfyhrFs77 ngDv7nmhbt89v8d+qCKLWAiWFau9rF0Fn0EmCIeE= 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.14 233/432] serial: 8250_pci: make setup_port() parameters explicitly unsigned Date: Thu, 16 Sep 2021 17:59:42 +0200 Message-Id: <20210916155818.744513375@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155810.813340753@linuxfoundation.org> References: <20210916155810.813340753@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 a808c283883e..726912b16a55 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