lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 15 Feb 2024 10:35:11 -0800
From: Florian Fainelli <florian.fainelli@...adcom.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Al Cooper <alcooperx@...il.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@...adcom.com>, Jiri Slaby <jirislaby@...nel.org>
Subject: Re: [PATCH v1 1/1] serial: 8250_bcm7271: Replace custom unit
 definitions

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@...ux.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


Download attachment "smime.p7s" of type "application/pkcs7-signature" (4221 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ