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

From: Uwe Kleine-König
Date: Thu Jun 08 2023 - 18:54:13 EST


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.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |

Attachment: signature.asc
Description: PGP signature