public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@kernel.org>
To: Stephen Kitt <steve@sk2.org>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] hwmon/pmbus: use simple i2c probe function
Date: Fri, 7 Aug 2020 11:08:19 +0200	[thread overview]
Message-ID: <20200807090819.GA1178@kunai> (raw)
In-Reply-To: <20200807074526.14334-1-steve@sk2.org>

[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]

On Fri, Aug 07, 2020 at 09:45:26AM +0200, Stephen Kitt wrote:
> pmbus_do_probe doesn't use the id information provided in its second
> argument, so this can be removed, which then allows using the
> single-parameter i2c probe function ("probe_new") for probes.
> 
> This avoids scanning the identifier tables during probes.
> 
> Drivers which didn't use the id are converted as-is; drivers which did
> are modified as follows:
> 
> * if the information in i2c_client is sufficient, that's used instead
>   (client->name);
> * configured v. probed comparisons are performed by comparing the
>   configured name to the detected name, instead of the ids; this
>   involves strcmp but is still cheaper than comparing all the device
>   names when scanning the tables;
> * anything else is handled by calling i2c_match_id() with the same
>   level of error-handling (if any) as before.
> 
> Signed-off-by: Stephen Kitt <steve@sk2.org>

I haven't checked the patch in detail, just saying that the bulk move to
probe_new is much appreciated, so:

Acked-by: Wolfram Sang <wsa@kernel.org>

One thing hit my eye, though:

>  	if (md)
>  		vs = (enum versions)md;
> -	else if (id)
> -		vs = (enum versions)id->driver_data;
> +	else {
> +		id = i2c_match_id(ibm_cffps_id, client);
> +		if (id)
> +			vs = (enum versions)id->driver_data;
> +	}

Missing braces in the if-block here. 'checkpatch --strict' warns about
it:

CHECK: Unbalanced braces around else statement
#230: FILE: drivers/hwmon/pmbus/ibm-cffps.c:490:
+	else {


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-08-07  9:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07  7:45 [PATCH v2] hwmon/pmbus: use simple i2c probe function Stephen Kitt
2020-08-07  9:08 ` Wolfram Sang [this message]
2020-08-07 15:23 ` Guenter Roeck
2020-08-07 16:23   ` Stephen Kitt

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=20200807090819.GA1178@kunai \
    --to=wsa@kernel.org \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=steve@sk2.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