Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp446537pxb; Thu, 9 Sep 2021 04:47:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsPte36TU0S6rqxXLDGFFdtKzKIjvLzCOek0juBrcQ27JOUb84lPBxFAwlJhY5r/vHnA11 X-Received: by 2002:a02:7f47:: with SMTP id r68mr2502607jac.54.1631188068760; Thu, 09 Sep 2021 04:47:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631188068; cv=none; d=google.com; s=arc-20160816; b=prsbX7p8C6mp/9w3gWjIOU2W07URHMrCu3411nkxYYjSL3NuLUZG/fe2T7B4Qqb4JF UdY8u0mDgTPtKsQ2fXarEZQOmbRtvEPf0vtbxQIhPjmcci/8C3a/GNe1cvRaSlTNgMKH 1IBW+qN0U+mf/dDpJ0dPiKuFfLAEOG0kZWkbyFEFZrJSzjHiRU9pnr0AEvAmKhGurdX5 U1SFjdqO7kuz24TSZG35V2FVhXRe4ltrIAwT5tDyR8dYeXMjwwblzbbvbHjiEuR0F9zM J+uL2RXJ+dmmx8he72HdJAcSMhuHaK3XWVcMSJB9hsXx6Luftq9lRPIRiiDQ16fLYEZn mGvg== 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=Q0WITyWnp77xPE9iiuoxTmfOzayWaDUXYq6w2h/qMH4=; b=dEr9Kibw3GhuT28zA14TCVkkYJgnlO2WRdqSnxZTKd3ug4Ke36EUMHD0EHZ2XytSiJ fiQiRuv1p1JQLSa0s4ErlUBrvlxSJsQLuOQQCZqXW5jbXEFtk+ITnSMlES+t12tBOwWr WqZc9ZHELVU9U6jJDDLU/C+ZribTyuEOkkF/md4iGK1edw8sB88X+PYvrrzmxTwVgd1M bLFvDYfL6QQHQcyXD5HSuEhqalo6bSd3MmDrOZavexWQAnq+yS2b38V081czcDNFRazi vpEJy5bymrUNz9FHQ5uPgsW2EBWm7vUPgp5quz04XKved/YtDoVTjDhCqd9pfcpGrK9R A4hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p6lEtfqZ; 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 h11si1703922ild.67.2021.09.09.04.47.37; Thu, 09 Sep 2021 04:47:48 -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=p6lEtfqZ; 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 S240613AbhIILsG (ORCPT + 99 others); Thu, 9 Sep 2021 07:48:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:45620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240383AbhIILpv (ORCPT ); Thu, 9 Sep 2021 07:45:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1469761220; Thu, 9 Sep 2021 11:42:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187769; bh=nv/jOUxKTaJ0v/uL56vZxSME+fATAGjjAdnhJxvqmvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p6lEtfqZoFBrLpueUlM4qLWOT0GyTQCevXMW7Bki1qxPILz7X9ZXRyi4MthYfkGXK Yl+uhfMhR6kO2CJQDYnQrx1dUgibfMJlf1oQVIxke4QTM8RYLya11/AxsW+PI1fmIE LPM0sar6/eISK/bsHhryFKSDTtoXw1/cw0G6jBGE8bvMaq8E3GJugDnN/TFJv/XXGK LlonlD8lBUmlTE1IL43l13R+FZKl0cPAs+qmTsJceGhBQx9AjZcOU2HruiQ2b45S9O JGkzzVlq+szOVYXv8hC9RjsWGdvZLk0bJq3W6hSpEJjKVkooHca1mloexosFa/gxr+ PzvaZJOFOU5SQ== 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.14 081/252] serial: 8250_pci: make setup_port() parameters explicitly unsigned Date: Thu, 9 Sep 2021 07:38:15 -0400 Message-Id: <20210909114106.141462-81-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-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 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