Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp63725rdb; Tue, 19 Dec 2023 09:22:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFT13/hvKU4eY1xDQUbxIOizKhI1s7Z4v2C4eCocgwCkHAbcAFZyeB0R20G1k/PcGcGS3oa X-Received: by 2002:a0c:d80c:0:b0:67a:35e9:3a93 with SMTP id h12-20020a0cd80c000000b0067a35e93a93mr17590733qvj.8.1703006572670; Tue, 19 Dec 2023 09:22:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703006572; cv=none; d=google.com; s=arc-20160816; b=xvH5kBxh/PJ/OZERxjBDl6avyJ5FUnpDA/SSewHHXUtO+HfdqKICDXsZCvGbCBqF8Q Gy8pusG4eMB0QneAzue2GSRwAsFhKzvw0OhR5Is4SLwNujB38zFwdKvoxurJc7PvNdOo yC3v7HkTDd+vlFJJN8gJFfLfMMAF8jkvAFWJar2uUePBOKfSMbJeKe1Gk25+E5CSJyuq MJJwXWXCj/1srYzm7jPcpcdPtWxUrQVgn9CdlHsxhUQY4rHWZHrvou20KHOtSxpbUcVT 6nzMB+XWzh/oYFqBmzuaGFxmionUnlU2QxzyWfaX16BCXLYv6JT38DOM36db5IdqTmJy GOVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=gUAAQFKZm/4AQCPRUH7PAQYTLzlSP8EudxDx5BySHoI=; fh=XmY8az1z5a+LjrZQ1DQahIeB3Uro2SuOHb+6mIYcxXo=; b=OLnmIsdE6MExfdUlNzlMUvgv0DKnyq+VHez8ZinX/xlbhxCRxgt5Q/KqRqk8a52wM7 EehHMGXBQET0nJ2NtepRujz5q8D7fzSoC7f0MKZP6ve8jXMueiM9Ds0rHtkWgyR7GXvN RYTUPoFAPMSk9NGR2zRNV3Z7Jm6bY91zwN/op5JhpGOlhrljohRTTr6Qxlo/igd+D8OZ Nx/QcMtb6q2iGLCNPgKDkfMCxnQWfE+FCEIUS5xAHj7ZvM7wEGgjfwaE+/6nALrQejwu nUCnLlBPWAL/gwRG2ZtKswlXo5QbbQRXt1pHA9SRUKZk5iGFh6G/+Xv7cPpZl3hWFK8t 809A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=O5luuWiZ; spf=pass (google.com: domain of linux-kernel+bounces-5683-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5683-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z4-20020a0cd784000000b0067ed227e3e9si21272853qvi.448.2023.12.19.09.22.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:22:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5683-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=O5luuWiZ; spf=pass (google.com: domain of linux-kernel+bounces-5683-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5683-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6D8131C2471B for ; Tue, 19 Dec 2023 17:22:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 965883B781; Tue, 19 Dec 2023 17:19:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="O5luuWiZ" X-Original-To: linux-kernel@vger.kernel.org Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1F4D374CE; Tue, 19 Dec 2023 17:19:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To :From:subject:date:message-id:reply-to; bh=gUAAQFKZm/4AQCPRUH7PAQYTLzlSP8EudxDx5BySHoI=; b=O5luuWiZQkMMPrB0k4ShlsWyRX NFLKiiP6zWS1mVso7TGCKyZohscLty08HiRki2VHTr9psFhaexicFs+dD4pck+bPe0XtSUK53kHpk 1SrmcdE/7cMWxi7zdh43H5MUKu1H+llWLf6MCSpWgz7KRNjJAvXs6vi3BEZ22mcDsBuk=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:40128 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1rFdkU-0007Ao-PP; Tue, 19 Dec 2023 12:19:19 -0500 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, jringle@gridpoint.com, kubakici@wp.pl, phil@raspberrypi.org, bo.svangard@embeddedart.se Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, hugo@hugovil.com, Hugo Villeneuve , Andy Shevchenko Date: Tue, 19 Dec 2023 12:18:56 -0500 Message-Id: <20231219171903.3530985-13-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231219171903.3530985-1-hugo@hugovil.com> References: <20231219171903.3530985-1-hugo@hugovil.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Level: X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -0.0 T_SCC_BODY_TEXT_LINE No description available. Subject: [PATCH 12/18] serial: sc16is7xx: replace hardcoded divisor value with BIT() macro X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) From: Hugo Villeneuve To better show why the limit is what it is, since we have only 16 bits for the divisor. Suggested-by: Andy Shevchenko Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/sc16is7xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index feb50d9271ac..133538f91390 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -486,7 +486,7 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud) u8 prescaler = 0; unsigned long clk = port->uartclk, div = clk / 16 / baud; - if (div > 0xffff) { + if (div >= BIT(16)) { prescaler = SC16IS7XX_MCR_CLKSEL_BIT; div /= 4; } -- 2.39.2