Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2565205lkm; Mon, 20 Sep 2021 18:51:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRPPpPBkH8WXvXQDYK16A1SJ0w8geUxTb9Y3oCQ0HYCB0TarA0F9hUedRRPNWRAmUjjPt/ X-Received: by 2002:a92:cd09:: with SMTP id z9mr20468587iln.50.1632188983965; Mon, 20 Sep 2021 18:49:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188983; cv=none; d=google.com; s=arc-20160816; b=EDS7EuqzBKvTs9m4/9aOLUpbfPQRBH3YxwihHAKDeam0HspxvjwlAN+XkvYR3HgxTc unqZCLMDBYYge/dUUjKG2gBR3KyFfus9DIO1aEmxmiNy+qIFaeL9UsGBGMcIejRPDRz6 E8WbpLv8voL64yY+yP1pfimlqiw9VFbUiKRbX9Qnund/OIDfkt5j7Son21Jtwz+UJO/o 47pSmn+VvgiK0O0/VnBmo3j2AFB29vcSbvbIfQlcz86gnsb7c6Oqr0pBw9kbOjY8M5hj KgWkt0bInHHHjvVrw22k3kVxfRi5QYXf/PWQwxUlst93ui8yHHEQp/SUfM6MrkRFNA7J Y+/A== 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=3VkjGniWzBSFRLhyN+QiKXOJ5VCxKl0n/NM4iVFcFGE=; b=jvIDVcbr6mWX5miI/vp87Tr0bEZWHoYewRXG/3FJuuJuxQVKLlUq5tS1QBPxUNxOrt ky4SobigBBLyKRPYxNMrmGRxIH5pNQqHTtDTonATI3Z7HmCTTKaPbyxTsWr/DRNdOqNj nKlT1Vu0LUlvGoIVlgN1SePtge4V5Jx6dz9w44jEsLcJL/q8a847zSgBYVfeifSAtai8 h9OtlqZoerBO26qBs9jjyfqbSxOtDDP/rEJd1ycYg+CnrX3nHl/85qz9ofhAwMdkTWjT JwxIGGPQZFK7+8vcAa2BEVYiRbCTJYwqcYXIV1vsLwuzD18bSd+eO06DsSXCEBeEQJuk ad8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TiylCcFm; 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 i3si16835214iom.99.2021.09.20.18.49.33; Mon, 20 Sep 2021 18:49: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=TiylCcFm; 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 S1355622AbhITRzf (ORCPT + 99 others); Mon, 20 Sep 2021 13:55:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:53072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354252AbhITRtY (ORCPT ); Mon, 20 Sep 2021 13:49:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EAAA561353; Mon, 20 Sep 2021 17:11:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157892; bh=IG4WzuU9ZzfY8NhFaGUxR7321fnYT+WG2xobM7X31RA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TiylCcFm9tHUMmMmUWKutZwJceEudXIsZVDxw9EsRhZSqseANCELdx6qNX7zA8ilF x1ax/MpupOwwdSXOlOPWfLWmBiNfsmqSegrcZ8ftlqRRc+j/VUKrde0HhFGNL2en0k 6L+6KGnr6H0th68QwR7T4kuOEx4Sv+o3pj5BPP5I= 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.19 199/293] serial: 8250_pci: make setup_port() parameters explicitly unsigned Date: Mon, 20 Sep 2021 18:42:41 +0200 Message-Id: <20210920163940.080044788@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@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 725e5842b8ac..f54c18e4ae90 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -70,7 +70,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