[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Zxup7PnsWFTABBqN@smile.fi.intel.com>
Date: Fri, 25 Oct 2024 17:23:40 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Uwe Kleine-König <u.kleine-koenig@...libre.com>
Cc: linux-pwm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 1/1] pwm: core: use device_match_name() instead of
strcmp(dev_name(...
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
Powered by blists - more mailing lists