Message ID | 20240215160234.653305-1-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-67257-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp78033dyb; Thu, 15 Feb 2024 11:41:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVxBIBf8UU7ihSAOCOzstlm1oP4f+96g2tuzCF94hfzMtSPbecigGAuImGv4p2xtv3tlaTJu7oojA3DorP5LGJCYa0ncA== X-Google-Smtp-Source: AGHT+IHiiddflOyMcQXiaVh2sy8m9/cQZjoDX37SEcDOf3Td+7ZY50tyDBgRSnIqQ//tg7G/DRbk X-Received: by 2002:a17:906:370b:b0:a3d:254d:5aaa with SMTP id d11-20020a170906370b00b00a3d254d5aaamr2033652ejc.63.1708026088326; Thu, 15 Feb 2024 11:41:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708026088; cv=pass; d=google.com; s=arc-20160816; b=KLLXeT+8f+xArJmXWBmvUnRnq1mftgNii0gpH4BQc929Jya2WviAUyeQrzN7c/cI5z i2JjEDwX7uWYC0nN3JEA9O9q7Sy9a6LGbuzue2H8dANWwNsy5O0tW9d0e2g0L1wQ3GsK BWcJKjQOUJ4Vc9Dh9e7EWbT7nhEyc7yeo+X95pif0d7UfDKpwbCi+lRQkJqFPp5U2oPX MurZTKUobxorwJtV+pgAvoeZhUGyjc/i0gn7pVXVdkZ5bsLfmvWSOXYa2FqvgwMX7dB7 voeAQCStgYuuIQ+hVtoizYYX3UToWVho23KS39Zf4fpv2vgSh5nypaXhCr9ej7VbfR54 vpLg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=OldPF9L+rY5w0i+Q9TdCR/46BzeuB7xYpR4MSBUWcOM=; fh=YAgezEXqsUq+pvDV68VSBvrjcIzrj3qB20PyjMqeSHk=; b=Zvy1uTAGsRpsuLhdZiMBGBM6gNsSOzEdZLL6ppbqfV2u41ucIXh0pjYhwETmBVqkuh PhTdhtRthVR3QtthBEdWkxV2rRh85+tIgDWtWp2MIbn8fJnlqNAptIyyvKe9KSXG6/Lu VQF/L7Np6SC9GZvrCB9hYUmASh6FTZYp2aN5rIbMNySe6UsFo4CEEXaT/h+z7E4u98sk 9dHj9rcQq+lLpM2E5SZpPhBAG6cZzDvXa199k6moi3D8FqHZ03/Cr3o7syVDkOzM51dA oRxH5yBzicjxxHYqK3rC0i9OzlrfDFiQRq+QwM/QqGAc2nPSpnorbj8HXlJ01OCGTg/P H1PA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AvvRB9ip; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-67257-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67257-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id lo19-20020a170906fa1300b00a3d39b3cf35si880849ejb.331.2024.02.15.11.41.28 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 11:41:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67257-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AvvRB9ip; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-67257-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67257-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id BD8291F25F58 for <ouuuleilei@gmail.com>; Thu, 15 Feb 2024 16:04:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 57F971353FE; Thu, 15 Feb 2024 16:02:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="AvvRB9ip" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 12015134CDD; Thu, 15 Feb 2024 16:02:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708012965; cv=none; b=n4QffQSPGyT9xO/96rst4auUuW8iY55SZVQD+P/QORNOqzkLXQsJbyYDONgjUUrGLga3cXJf39ZjhZp/BOWra6UvQWStUMxZS2/OskqVDBLpePezr/qpxom1BBNNnEiKm19SjqKYpJOvd8r9def0GGxWpKTLG0yzj+6KrU0O5jg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708012965; c=relaxed/simple; bh=ge/zuWB1BjZSun2O80x3sHKgvzwxKxsHTgxhF2+KWu8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WFcaeIqNmSp5ZUlgM5lkG5STL53/ScE4tSPsnXtmeHNKmN+lUEPziHkf4YAvrUElSsGQcNxxlDKnvxkjLOtZ0HWXXsjG0U+JyrQAQlLyob9QrvIs1sf3EaTe4nIIAMi4SsHaP9iOYYO88NQie541afqbGzExwfGCKcfTGUeYR5Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=AvvRB9ip; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708012965; x=1739548965; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ge/zuWB1BjZSun2O80x3sHKgvzwxKxsHTgxhF2+KWu8=; b=AvvRB9ipm2VovBhACaqhXNciyHsepHb41AXcPSPGv9LrvQAnruXGP7cW H+xROfhSo423E+WHmQeJwHcTQNBoB3JQp1kNckuLU5Asd7HLYmHSHz706 rHTFvutW8yL8lRE+/iH9jPmXdhSPr+H/6X6B/tO0zOy7OQkNNu7JOQ3pC LgqETMu+azO1QV1ucKfFMJerwIVpL5oz7WLfZmMXPjZZCkU77JmQcIlLV wAxffkxjhLZMtFCl2WUVfMCLd/9w5+x3KqGa40WCK00COZvvQH4mYMW3z /wxeAqQSLdJgdqcBhPaTqYDCtRq+nvXBufovhurMTD7mab43V/gr2yUal g==; X-IronPort-AV: E=McAfee;i="6600,9927,10984"; a="19525816" X-IronPort-AV: E=Sophos;i="6.06,162,1705392000"; d="scan'208";a="19525816" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2024 08:02:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10984"; a="935684857" X-IronPort-AV: E=Sophos;i="6.06,162,1705392000"; d="scan'208";a="935684857" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 15 Feb 2024 08:02:37 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id DBD95204; Thu, 15 Feb 2024 18:02:35 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Al Cooper <alcooperx@gmail.com>, Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, Jiri Slaby <jirislaby@kernel.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com> Subject: [PATCH v1 1/1] serial: 8250_bcm7271: Replace custom unit definitions Date: Thu, 15 Feb 2024 18:02:34 +0200 Message-ID: <20240215160234.653305-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790993952546123785 X-GMAIL-MSGID: 1790995163390447229 |
Series |
[v1,1/1] serial: 8250_bcm7271: Replace custom unit definitions
|
|
Commit Message
Andy Shevchenko
Feb. 15, 2024, 4:02 p.m. UTC
Replace custom unit definitions that are available via units.h.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/tty/serial/8250/8250_bcm7271.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
Comments
On 2/15/24 11:21, Andy Shevchenko wrote: > On Thu, Feb 15, 2024 at 10:35:11AM -0800, Florian Fainelli wrote: >> On 2/15/24 08:02, Andy Shevchenko wrote: > > ... > >>> -#define KHZ 1000 >>> -#define MHZ(x) ((x) * KHZ * KHZ) >>> static const u32 brcmstb_rate_table[] = { >>> - MHZ(81), >>> - MHZ(108), >>> - MHZ(64), /* Actually 64285715 for some chips */ >>> - MHZ(48), >>> + 81 * HZ_PER_MHZ, >>> + 108 * HZ_PER_MHZ, >>> + 64 * HZ_PER_MHZ, /* Actually 64285715 for some chips */ >>> + 48 * HZ_PER_MHZ, >> >> The previous notation was IMHO more readable, > > I tend to disagree as we read in plain text "frequency is 64 MHz", > the patch follows natural language. > >> can we meet in the middle and do: >> >> #define MHZ(x) ((x) * HZ_PER_MHZ >> >> and avoid touching the tables entirely? > > I don't like the intermediate layer which hides the implementation of MHZ(). > What does it do exactly? You need to look at the internals, with the patch > applied you immediately see that these are just constants. > OK, I suppose today's color is blue for the bike shed. Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
diff --git a/drivers/tty/serial/8250/8250_bcm7271.c b/drivers/tty/serial/8250/8250_bcm7271.c index 504c4c020857..1532fa2e8ec4 100644 --- a/drivers/tty/serial/8250/8250_bcm7271.c +++ b/drivers/tty/serial/8250/8250_bcm7271.c @@ -22,6 +22,7 @@ #include <linux/delay.h> #include <linux/clk.h> #include <linux/debugfs.h> +#include <linux/units.h> #include "8250.h" @@ -187,21 +188,19 @@ #define TX_BUF_SIZE 4096 #define RX_BUF_SIZE 4096 #define RX_BUFS_COUNT 2 -#define KHZ 1000 -#define MHZ(x) ((x) * KHZ * KHZ) static const u32 brcmstb_rate_table[] = { - MHZ(81), - MHZ(108), - MHZ(64), /* Actually 64285715 for some chips */ - MHZ(48), + 81 * HZ_PER_MHZ, + 108 * HZ_PER_MHZ, + 64 * HZ_PER_MHZ, /* Actually 64285715 for some chips */ + 48 * HZ_PER_MHZ, }; static const u32 brcmstb_rate_table_7278[] = { - MHZ(81), - MHZ(108), + 81 * HZ_PER_MHZ, + 108 * HZ_PER_MHZ, 0, - MHZ(48), + 48 * HZ_PER_MHZ, }; struct brcmuart_priv {