* [PATCH] bus: fsl-mc: remove unused free_count variable
@ 2023-03-31 0:12 Tom Rix
2023-04-07 18:13 ` Nick Desaulniers
0 siblings, 1 reply; 2+ messages in thread
From: Tom Rix @ 2023-03-31 0:12 UTC (permalink / raw)
To: stuyoder, laurentiu.tudor, nathan, ndesaulniers
Cc: linux-kernel, llvm, Tom Rix
clang with W=1 reports
drivers/bus/fsl-mc/fsl-mc-allocator.c:560:6: error: variable
'free_count' set but not used [-Werror,-Wunused-but-set-variable]
int free_count = 0;
^
This variable is not used so remove it.
Signed-off-by: Tom Rix <trix@redhat.com>
---
drivers/bus/fsl-mc/fsl-mc-allocator.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/bus/fsl-mc/fsl-mc-allocator.c b/drivers/bus/fsl-mc/fsl-mc-allocator.c
index dced427ca8ba..f1351237a9d5 100644
--- a/drivers/bus/fsl-mc/fsl-mc-allocator.c
+++ b/drivers/bus/fsl-mc/fsl-mc-allocator.c
@@ -557,12 +557,9 @@ static void fsl_mc_cleanup_resource_pool(struct fsl_mc_device *mc_bus_dev,
struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_bus_dev);
struct fsl_mc_resource_pool *res_pool =
&mc_bus->resource_pools[pool_type];
- int free_count = 0;
- list_for_each_entry_safe(resource, next, &res_pool->free_list, node) {
- free_count++;
+ list_for_each_entry_safe(resource, next, &res_pool->free_list, node)
devm_kfree(&mc_bus_dev->dev, resource);
- }
}
void fsl_mc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev)
--
2.27.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] bus: fsl-mc: remove unused free_count variable
2023-03-31 0:12 [PATCH] bus: fsl-mc: remove unused free_count variable Tom Rix
@ 2023-04-07 18:13 ` Nick Desaulniers
0 siblings, 0 replies; 2+ messages in thread
From: Nick Desaulniers @ 2023-04-07 18:13 UTC (permalink / raw)
To: Tom Rix; +Cc: stuyoder, laurentiu.tudor, nathan, linux-kernel, llvm
On Thu, Mar 30, 2023 at 5:12 PM Tom Rix <trix@redhat.com> wrote:
>
> clang with W=1 reports
> drivers/bus/fsl-mc/fsl-mc-allocator.c:560:6: error: variable
> 'free_count' set but not used [-Werror,-Wunused-but-set-variable]
> int free_count = 0;
> ^
> This variable is not used so remove it.
>
> Signed-off-by: Tom Rix <trix@redhat.com>
Thanks for the patch!
Fixes: commit d8e026a44919 ("staging: fsl-mc: remove some superfluous WARN_ONs")
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Check out
commit 364069556901 ("staging: fsl-mc: move resource pool init/cleanup
into allocator")
to see the original logic.
> ---
> drivers/bus/fsl-mc/fsl-mc-allocator.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/bus/fsl-mc/fsl-mc-allocator.c b/drivers/bus/fsl-mc/fsl-mc-allocator.c
> index dced427ca8ba..f1351237a9d5 100644
> --- a/drivers/bus/fsl-mc/fsl-mc-allocator.c
> +++ b/drivers/bus/fsl-mc/fsl-mc-allocator.c
> @@ -557,12 +557,9 @@ static void fsl_mc_cleanup_resource_pool(struct fsl_mc_device *mc_bus_dev,
> struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_bus_dev);
> struct fsl_mc_resource_pool *res_pool =
> &mc_bus->resource_pools[pool_type];
> - int free_count = 0;
>
> - list_for_each_entry_safe(resource, next, &res_pool->free_list, node) {
> - free_count++;
> + list_for_each_entry_safe(resource, next, &res_pool->free_list, node)
> devm_kfree(&mc_bus_dev->dev, resource);
> - }
> }
>
> void fsl_mc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev)
> --
> 2.27.0
>
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-07 18:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31 0:12 [PATCH] bus: fsl-mc: remove unused free_count variable Tom Rix
2023-04-07 18:13 ` Nick Desaulniers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®