public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: claudiu beznea <claudiu.beznea@tuxon.dev>
To: Andi Shyti <andi.shyti@kernel.org>
Cc: chris.brandt@renesas.com, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, geert+renesas@glider.be,
	magnus.damm@gmail.com, p.zabel@pengutronix.de,
	wsa+renesas@sang-engineering.com,
	linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Subject: Re: [PATCH v4 08/11] i2c: riic: Add support for fast mode plus
Date: Tue, 20 Aug 2024 10:32:29 +0300	[thread overview]
Message-ID: <96265c60-5b16-4a02-a991-ac0e06f7baf3@tuxon.dev> (raw)
In-Reply-To: <hu4yt2a7ipxrqd7ciqqyg4izei2dr7yerpgf7j53quepxj4ed6@gzlv7l3etpqb>

Hi, Andi,

On 19.08.2024 23:12, Andi Shyti wrote:
> Hi Claudiu,
> 
> ...
> 
>>  struct riic_dev {
>> @@ -311,11 +315,14 @@ static int riic_init_hw(struct riic_dev *riic)
>>  	int total_ticks, cks, brl, brh;
>>  	struct i2c_timings *t = &riic->i2c_t;
>>  	struct device *dev = riic->adapter.dev.parent;
>> +	const struct riic_of_data *info = riic->info;
> 
> Because you are only using info->fast_mode_plus, perhaps you can
> directly take:
> 
> 	fast_mode_plus = riic->info->fast_mode_plus;
> 
> and you make it even more compact.
> 
>>  
>> -	if (t->bus_freq_hz > I2C_MAX_FAST_MODE_FREQ) {
>> +	if ((!info->fast_mode_plus && t->bus_freq_hz > I2C_MAX_FAST_MODE_FREQ) ||
>> +	    (info->fast_mode_plus && t->bus_freq_hz > I2C_MAX_FAST_MODE_PLUS_FREQ)) {
>>  		dev_err(&riic->adapter.dev,
>> -			"unsupported bus speed (%dHz). %d max\n",
>> -			t->bus_freq_hz, I2C_MAX_FAST_MODE_FREQ);
>> +			"unsupported bus speed (%dHz). %d max\n", t->bus_freq_hz,
> 
> super nitpick: can you please put t->bus_freq_hz on a new line,
> it looks better to either have everything put in columns or not.
> 
>> +			info->fast_mode_plus ? I2C_MAX_FAST_MODE_PLUS_FREQ :
>> +			I2C_MAX_FAST_MODE_FREQ);
> 
> another super-nitpick: can you please align
> I2C_MAX_FAST_MODE_PLUS_FREQ with I2C_MAX_FAST_MODE_FREQ? It makes
> more clear that there is a "? ... :" statement.

I'll adjust everything as suggested.

Thank you,
Claudiu Beznea

> 
> Thanks,
> Andi
> 
>>  		return -EINVAL;
>>  	}

  reply	other threads:[~2024-08-20  7:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-19 10:23 [PATCH v4 00/11] i2c: riic: Add support for Renesas RZ/G3S Claudiu
2024-08-19 10:23 ` [PATCH v4 01/11] i2c: riic: Use temporary variable for struct device Claudiu
2024-08-19 10:23 ` [PATCH v4 02/11] i2c: riic: Call pm_runtime_get_sync() when need to access registers Claudiu
2024-08-19 10:23 ` [PATCH v4 03/11] i2c: riic: Use pm_runtime_resume_and_get() Claudiu
2024-08-19 10:23 ` [PATCH v4 04/11] i2c: riic: Enable runtime PM autosuspend support Claudiu
2024-08-19 10:23 ` [PATCH v4 05/11] i2c: riic: Add suspend/resume support Claudiu
2024-08-19 19:37   ` Andi Shyti
2024-08-20  7:25     ` claudiu beznea
2024-08-19 10:23 ` [PATCH v4 06/11] i2c: riic: Define individual arrays to describe the register offsets Claudiu
2024-08-19 20:20   ` Andi Shyti
2024-08-19 10:23 ` [PATCH v4 07/11] dt-bindings: i2c: renesas,riic: Document the R9A08G045 support Claudiu
2024-08-19 11:05   ` Krzysztof Kozlowski
2024-08-19 11:10     ` claudiu beznea
2024-08-19 11:22       ` Krzysztof Kozlowski
2024-08-19 16:39         ` Conor Dooley
2024-08-19 20:01           ` Andi Shyti
2024-08-20  7:45           ` claudiu beznea
2024-08-20 16:44             ` Conor Dooley
2024-08-19 10:23 ` [PATCH v4 08/11] i2c: riic: Add support for fast mode plus Claudiu
2024-08-19 20:12   ` Andi Shyti
2024-08-20  7:32     ` claudiu beznea [this message]
2024-08-19 10:23 ` [PATCH v4 09/11] arm64: dts: renesas: r9a08g045: Add I2C nodes Claudiu
2024-08-19 10:23 ` [PATCH v4 10/11] arm64: dts: renesas: rzg3s-smarc: Enable i2c0 node Claudiu
2024-08-19 10:23 ` [PATCH v4 11/11] arm64: dts: renesas: rzg3s-smarc-som: Enable i2c1 node Claudiu
2024-08-19 20:23 ` [PATCH v4 00/11] i2c: riic: Add support for Renesas RZ/G3S Andi Shyti
2024-08-20 10:16   ` claudiu beznea

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=96265c60-5b16-4a02-a991-ac0e06f7baf3@tuxon.dev \
    --to=claudiu.beznea@tuxon.dev \
    --cc=andi.shyti@kernel.org \
    --cc=chris.brandt@renesas.com \
    --cc=claudiu.beznea.uj@bp.renesas.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=krzk+dt@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --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