All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 1/1] pwm: core: use device_match_name() instead of strcmp(dev_name(...
Date: Fri, 25 Oct 2024 17:23:40 +0300	[thread overview]
Message-ID: <Zxup7PnsWFTABBqN@smile.fi.intel.com> (raw)
In-Reply-To: <d7ytkx4ncytkup7pxu4kjxhbh75szwoeafyxg2prem7vfjausj@5ea2nebshemg>

On Fri, Oct 25, 2024 at 04:17:04PM +0200, Uwe Kleine-König wrote:
> On Fri, Oct 25, 2024 at 04:04:19PM +0300, Andy Shevchenko wrote:
> > On Thu, Oct 24, 2024 at 10:55:36PM +0200, Uwe Kleine-König wrote:
> > > On Thu, Oct 24, 2024 at 06:19:05PM +0300, Andy Shevchenko wrote:

...

> > > >  	idr_for_each_entry_ul(&pwm_chips, chip, tmp, id) {
> > > > -		const char *chip_name = dev_name(pwmchip_parent(chip));
> > > > -
> > > > -		if (chip_name && strcmp(chip_name, name) == 0)
> > > > +		if (device_match_name(pwmchip_parent(chip), name))
> > > 
> > > This theoretically changes behaviour in a few cases. For example if
> > > dev_name(pwmchip_parent(chip)) is NULL the new code would crash. Can
> > > this happen? 
> > 
> > Please, tell me how
> > (looking at the of device_add() and kobject_set_name_vargs() implementations)?
> 
> This is unfair, I intended to let you do the work and you just give it
> back to me :-)

Unfair to ask me about this code as you should know better as the maintainer
than me why this code is there, no? :-)

> ... a bit later ...
> 
> ok, willing to merge if you update the commit log to mention that the
> theoretical changes (no check for NULL, more lax check (trailing \n))
> don't matter.

Okay.

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2024-10-25 14:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24 15:19 [PATCH v1 1/1] pwm: core: use device_match_name() instead of strcmp(dev_name( Andy Shevchenko
2024-10-24 20:55 ` Uwe Kleine-König
2024-10-25 13:04   ` Andy Shevchenko
2024-10-25 14:17     ` Uwe Kleine-König
2024-10-25 14:23       ` Andy Shevchenko [this message]

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=Zxup7PnsWFTABBqN@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=u.kleine-koenig@baylibre.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.