From: Uwe Kleine-König Date: Fri, 10 Mar 2023 22:41:25 +0000 (+0100) Subject: bus: fsl-mc: fsl-mc-allocator: Drop if block with always wrong condition X-Git-Tag: v6.6.7~2513^2^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0ac89361cfb45d7c84de81563367745d2056f16;p=platform%2Fkernel%2Flinux-starfive.git bus: fsl-mc: fsl-mc-allocator: Drop if block with always wrong condition If fsl_mc_is_allocatable(mc_dev) evaluates to false, the driver won't have bound to that device and then fsl_mc_allocator_remove() is never called for that device. fsl_mc_allocator_remove() is the only caller of fsl_mc_resource_pool_remove_device(), so the same check can be removed from there. Signed-off-by: Uwe Kleine-König Reviewed-by: Ioana Ciornei Tested-by: Ioana Ciornei # sanity checks Reviewed-by: Laurentiu Tudor Tested-by: Laurentiu Tudor Signed-off-by: Li Yang --- diff --git a/drivers/bus/fsl-mc/fsl-mc-allocator.c b/drivers/bus/fsl-mc/fsl-mc-allocator.c index dced427..e60faf8 100644 --- a/drivers/bus/fsl-mc/fsl-mc-allocator.c +++ b/drivers/bus/fsl-mc/fsl-mc-allocator.c @@ -103,9 +103,6 @@ static int __must_check fsl_mc_resource_pool_remove_device(struct fsl_mc_device struct fsl_mc_resource *resource; int error = -EINVAL; - if (!fsl_mc_is_allocatable(mc_dev)) - goto out; - resource = mc_dev->resource; if (!resource || resource->data != mc_dev) goto out; @@ -613,9 +610,6 @@ static int fsl_mc_allocator_remove(struct fsl_mc_device *mc_dev) { int error; - if (!fsl_mc_is_allocatable(mc_dev)) - return -EINVAL; - if (mc_dev->resource) { error = fsl_mc_resource_pool_remove_device(mc_dev); if (error < 0)