RE: [PATCH 4/6] bus: fsl-mc: fsl-mc-allocator: Improve error reporting

From: Leo Li
Date: Thu Jun 08 2023 - 19:10:54 EST




> -----Original Message-----
> From: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
> Sent: Thursday, June 8, 2023 5:54 PM
> To: Leo Li <leoyang.li@xxxxxxx>
> Cc: Nathan Chancellor <nathan@xxxxxxxxxx>; kernel@xxxxxxxxxxxxxx;
> llvm@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Stuart Yoder
> <stuyoder@xxxxxxxxx>; Laurentiu Tudor <laurentiu.tudor@xxxxxxx>
> Subject: Re: [PATCH 4/6] bus: fsl-mc: fsl-mc-allocator: Improve error
> reporting
>
> Hello,
>
> On Thu, Jun 08, 2023 at 10:00:13PM +0000, Leo Li wrote:
> > > Hmm, clang seems to be right, and I just confirmed that gcc
> > > (arm-linux- gnueabihf-gcc (Debian 12.2.0-14) 12.2.0) doesn't emit a
> > > warning. :-\
> > >
> > > My approach would be:
> > >
> > > diff --git a/drivers/bus/fsl-mc/fsl-mc-allocator.c
> > > b/drivers/bus/fsl-mc/fsl-mc- allocator.c index
> > > 0ad68099684e..991273f956ce 100644
> > > --- a/drivers/bus/fsl-mc/fsl-mc-allocator.c
> > > +++ b/drivers/bus/fsl-mc/fsl-mc-allocator.c
> > > @@ -103,14 +103,15 @@ static int __must_check
> > > fsl_mc_resource_pool_remove_device(struct fsl_mc_device
> > > struct fsl_mc_resource *resource;
> > > int error = -EINVAL;
> > >
> > > + mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent);
> > > + mc_bus = to_fsl_mc_bus(mc_bus_dev);
> > > +
> > > resource = mc_dev->resource;
> > > if (!resource || resource->data != mc_dev) {
> > > dev_err(&mc_bus_dev->dev, "resource mismatch\n");
> > > goto out;
> > > }
> > >
> > > - mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent);
> > > - mc_bus = to_fsl_mc_bus(mc_bus_dev);
> > > res_pool = resource->parent_pool;
> > > if (res_pool != &mc_bus->resource_pools[resource->type]) {
> > > dev_err(&mc_bus_dev->dev, "pool mismatch\n");
> > >
> > >
> > > Should I prepare a proper patch, or is it possible to squash this
> > > change into b3134039c5b3cf879841e3ec84c8cbf7675554ec?
> > >
> > > @Li Yang: Please advice.
> >
> > This looks fine. Please send a new patch and I can squash it to the original
> commit.
>
> I did send a proper patch already, see
>
> https://lore.kernel.org/all/20230605112025.80061-1-u.kleine-
> koenig@xxxxxxxxxxxxxx
>
> You can apply that on top of the broken commit, or if you prefer also squash
> it into the offending commit. Note that in the above thread there is another
> fix for an older commit.

Thanks. Both look good. Applied for next.

Regards,
Leo