public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Prabhakar <prabhakar.csengg@gmail.com>
Cc: Chris Brandt <chris.brandt@renesas.com>,
	Andi Shyti <andi.shyti@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Fabrizio Castro <fabrizio.castro.jz@renesas.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Subject: Re: [PATCH v3 7/8] i2c: riic: Use predefined macro and simplify clock tick calculation
Date: Sun, 29 Dec 2024 01:37:46 +0200	[thread overview]
Message-ID: <Z3CLypNNqqlSsabo@surfacebook.localdomain> (raw)
In-Reply-To: <20241227115154.56154-8-prabhakar.mahadev-lad.rj@bp.renesas.com>

Fri, Dec 27, 2024 at 11:51:53AM +0000, Prabhakar kirjoitti:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> 
> Replace the hardcoded `1000000000` with the predefined `NANO` macro for
> clarity. Simplify the code by introducing a `ns_per_tick` variable to
> store `NANO / rate`, reducing redundancy and improving readability.

...

> -	brl -= t->scl_fall_ns / (1000000000 / rate);
> -	brh -= t->scl_rise_ns / (1000000000 / rate);
> +	ns_per_tick = NANO / rate;

So, why NANO and not NSEC_PER_SEC?

> +	brl -= t->scl_fall_ns / ns_per_tick;
> +	brh -= t->scl_rise_ns / ns_per_tick;

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2024-12-28 23:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-27 11:51 [PATCH v3 0/8] i2c: riic: driver cleanup and improvements Prabhakar
2024-12-27 11:51 ` [PATCH v3 1/8] i2c: riic: Use dev_err_probe in probe and riic_init_hw functions Prabhakar
2024-12-28 23:32   ` Andy Shevchenko
2024-12-31 14:20     ` Lad, Prabhakar
2024-12-27 11:51 ` [PATCH v3 2/8] i2c: riic: Use local `dev` pointer in `dev_err_probe()` Prabhakar
2024-12-27 11:51 ` [PATCH v3 3/8] i2c: riic: Use BIT macro consistently Prabhakar
2024-12-28 23:34   ` Andy Shevchenko
2025-01-02  9:07     ` Lad, Prabhakar
2024-12-27 11:51 ` [PATCH v3 4/8] i2c: riic: Use GENMASK() macro for bitmask definitions Prabhakar
2024-12-28 23:36   ` Andy Shevchenko
2025-01-02  9:09     ` Lad, Prabhakar
2025-01-01 12:11   ` David Laight
2025-01-02  8:53     ` Lad, Prabhakar
2024-12-27 11:51 ` [PATCH v3 5/8] i2c: riic: Make use of devres helper to request deasserted reset line Prabhakar
2024-12-27 11:51 ` [PATCH v3 6/8] i2c: riic: Mark riic_irqs array as const Prabhakar
2024-12-27 11:51 ` [PATCH v3 7/8] i2c: riic: Use predefined macro and simplify clock tick calculation Prabhakar
2024-12-28 23:37   ` Andy Shevchenko [this message]
2025-01-02 10:05     ` Lad, Prabhakar
2024-12-27 11:51 ` [PATCH v3 8/8] i2c: riic: Add `riic_bus_barrier()` to check bus availability Prabhakar
2024-12-28 23:40   ` Andy Shevchenko
2025-01-02 10:32     ` Lad, Prabhakar
2024-12-27 22:10 ` [PATCH v3 0/8] i2c: riic: driver cleanup and improvements Andi Shyti
2024-12-28 23:40   ` Andy Shevchenko
2024-12-29 23:42     ` Andi Shyti

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=Z3CLypNNqqlSsabo@surfacebook.localdomain \
    --to=andy.shevchenko@gmail.com \
    --cc=andi.shyti@kernel.org \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=chris.brandt@renesas.com \
    --cc=claudiu.beznea.uj@bp.renesas.com \
    --cc=fabrizio.castro.jz@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=prabhakar.csengg@gmail.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=wsa+renesas@sang-engineering.com \
    /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