Re: [PATCH v4 06/10] regmap: irq: Add support for chips without separate IRQ status

From: Andy Shevchenko
Date: Fri Feb 14 2025 - 11:03:17 EST


On Fri, Feb 14, 2025 at 04:49:57PM +0100, Mathieu Dubois-Briand wrote:
> On Fri Feb 14, 2025 at 4:18 PM CET, Andy Shevchenko wrote:
> > On Fri, Feb 14, 2025 at 12:49:56PM +0100, Mathieu Dubois-Briand wrote:

...

> > > +static irqreturn_t regmap_irq_thread(int irq, void *d)
> > > +{
> > > + struct regmap_irq_chip_data *data = d;
> > > + const struct regmap_irq_chip *chip = data->chip;
> > > + struct regmap *map = data->map;
> > > + int ret, i;
> >
> > unsigned int i;
> > ?
>
> I agree, but signed int index variables are used in all functions of
> this file. What would be the best approach here? Only fix it on code
> parts I modified? On the whole file?

I would change in the code you touched,

> > > + bool handled = false;
> > > + u32 reg;
> > > +
> > > + if (chip->handle_pre_irq)
> > > + chip->handle_pre_irq(chip->irq_drv_data);
> > > +
> > > + if (chip->runtime_pm) {
> > > + ret = pm_runtime_get_sync(map->dev);
> > > + if (ret < 0) {
> >
> > > + dev_err(map->dev, "IRQ thread failed to resume: %d\n",
> > > + ret);
> >
> > Can be one line.
>
> Yes. Kind of the same question here: should I fix only the code close to
> the parts I modified or the whole file?

Same, it falls under the "common sense" category.

--
With Best Regards,
Andy Shevchenko