Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp504147pxb; Thu, 9 Sep 2021 06:02:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw53vJ78tsHSQSv+AO6A2GZ82SN4bW/SF9leOqOrkcuzxHQ1xfPg/Y6VGHrJyssi41/NV67 X-Received: by 2002:a17:906:6717:: with SMTP id a23mr3207062ejp.358.1631192578897; Thu, 09 Sep 2021 06:02:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631192578; cv=none; d=google.com; s=arc-20160816; b=d+nnsO+JD5jhe0PRojyGB3lWnBCC732gedegQ0YmQOMqfFlf7tjh0+Ml86RD08YZBc 6jamlPhHIKHV3jbR6rLeZrpses0WtFslLTxlPlRD+Evzq3Xt2f/OONnrtjrUyX9kD7As pgiHVf7zOm043/fAxh4MbQziGcFq4uqGLsA1nF4IA6WOhrFepXt49zeIxfgOFdW4cfxo Y2ry3CK3erQE64OBlhJ3eDvmE8JiWrA9zHP0WAS9PtnjGv0Z83yRFLXwa6U2fmaDkRG7 tpgRPdExkWbSrzII8LumN0fwfFkMxzQkKrpCpFcC8yY+L2rAV6uYjLt4bttkDF0FKblz tYIw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4nrMdH02iP5X2kNYObBFszp1/edu6DrncNj/UHqfypI=; b=imeKhkJnSbFho7wG030CJg+bkT6/AcPDC7J2Sy9t9I0xih+jBvQVAfAJQuA2j5xBHz 2WkJhKqneH3ZBBVyqLG7/B5GFKJRu22poe62Mnb2zYndXjemaKouxYuT7rmn5a7tNDoy XHkdsIZ/JPSnnpFgLjSgmQafdVye/spwae2KfAOouFK/UhjDdBuOWkAHvQbjLelQp2Ec JsUFatw8WEOuqAcAKV0GbrYtS3nrJW6AxkRdYS9JU07RbQiVixAHsg3gcxylkPhKoKGa 3KDtTo/kQgte9mhi+/ZVvR6/jytwBGLW/1IRPjyZnS8MKzfKWMTCc4tgbn0+7ysknUeY 06+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n2A2EvAP; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w18si1749159edu.157.2021.09.09.06.02.03; Thu, 09 Sep 2021 06:02:58 -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=k20201202 header.b=n2A2EvAP; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355694AbhIIM5w (ORCPT + 99 others); Thu, 9 Sep 2021 08:57:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:55856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355285AbhIIMpF (ORCPT ); Thu, 9 Sep 2021 08:45:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9F7C761CA7; Thu, 9 Sep 2021 11:55:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631188555; bh=ZRikLOqo0PKGel3u5wiYC/BoTvDsFQGCrNbrTgsCVYU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n2A2EvAPi4qd8AlOYXo7lPQTzBLlirshYvtIK4Xl9dHhFur4bxCSYmV/rVdexlJEh QbX9oaz2NgLkr0E4IuqbzXSpPY8TkqyKtRVJx7iL7KJjCLf+Ul9/9RqWcN7G/h3b0h EHpeK0T87t/Tgwb91Jc8XQFANbGove9GDJiKSE0eYmWD2kMd+TxQL+M83oh4Ot7Ncn vqMCGYISmKtV+tKU8HJ3cUigG8+dS0Jhod7kDWp78KZ8BpmLOJNCqS2+q5ZEr+60NF fjGHbjs+wWdQSWPzfWJwYfMy91gHJeooDB5/C62aVtQnbHVeFRxSiM0zBuJLIiTX8B yeNOCXKWKR4lw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby , Jordy Zomer , Sasha Levin , linux-serial@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 038/109] serial: 8250_pci: make setup_port() parameters explicitly unsigned Date: Thu, 9 Sep 2021 07:53:55 -0400 Message-Id: <20210909115507.147917-38-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909115507.147917-1-sashal@kernel.org> References: <20210909115507.147917-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 43fc5b6a25d3..a2bb103f22fc 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -89,7 +89,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