From: Florian Fainelli <florian.fainelli@broadcom.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
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>
Subject: Re: [PATCH v1 1/1] serial: 8250_bcm7271: Replace custom unit definitions
Date: Thu, 15 Feb 2024 10:35:11 -0800 [thread overview]
Message-ID: <7132d989-533f-47ef-803b-6001de3aff33@broadcom.com> (raw)
In-Reply-To: <20240215160234.653305-1-andriy.shevchenko@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1312 bytes --]
On 2/15/24 08:02, Andy Shevchenko wrote:
> 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(-)
>
> 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,
The previous notation was IMHO more readable, can we meet in the middle
and do:
#define MHZ(x) ((x) * HZ_PER_MHZ
and avoid touching the tables entirely?
--
Florian
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]
next prev parent reply other threads:[~2024-02-15 18:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-15 16:02 [PATCH v1 1/1] serial: 8250_bcm7271: Replace custom unit definitions Andy Shevchenko
2024-02-15 16:32 ` Ilpo Järvinen
2024-02-15 18:35 ` Florian Fainelli [this message]
2024-02-15 19:21 ` Andy Shevchenko
2024-02-15 19:27 ` Florian Fainelli
2024-02-15 19:40 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7132d989-533f-47ef-803b-6001de3aff33@broadcom.com \
--to=florian.fainelli@broadcom.com \
--cc=alcooperx@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox