[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZxuXU3nTuEwoTFiH@smile.fi.intel.com>
Date: Fri, 25 Oct 2024 16:04:19 +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 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)?
Btw, have you ever seen this check somewhere else? (I don't, but I haven't
covered full kernel sources, of course.)
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists