[PATCH] test-throttle: don't shadow 'index' variable in do_test_accounting()

Alberto Garcia posted 1 patch 7 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230922105742.81317-1-berto@igalia.com
Maintainers: Alberto Garcia <berto@igalia.com>
tests/unit/test-throttle.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] test-throttle: don't shadow 'index' variable in do_test_accounting()
Posted by Alberto Garcia 7 months, 1 week ago
Fixes build with -Wshadow=local

Signed-off-by: Alberto Garcia <berto@igalia.com>
---
 tests/unit/test-throttle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/unit/test-throttle.c b/tests/unit/test-throttle.c
index cb587e33e7..ac35d65d19 100644
--- a/tests/unit/test-throttle.c
+++ b/tests/unit/test-throttle.c
@@ -625,7 +625,7 @@ static bool do_test_accounting(bool is_ops, /* are we testing bps or ops */
     throttle_config_init(&cfg);
 
     for (i = 0; i < 3; i++) {
-        BucketType index = to_test[is_ops][i];
+        index = to_test[is_ops][i];
         cfg.buckets[index].avg = avg;
     }
 
-- 
2.39.2
Re: [PATCH] test-throttle: don't shadow 'index' variable in do_test_accounting()
Posted by Markus Armbruster 7 months ago
Alberto Garcia <berto@igalia.com> writes:

> Fixes build with -Wshadow=local
>
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
>  tests/unit/test-throttle.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/unit/test-throttle.c b/tests/unit/test-throttle.c
> index cb587e33e7..ac35d65d19 100644
> --- a/tests/unit/test-throttle.c
> +++ b/tests/unit/test-throttle.c
> @@ -625,7 +625,7 @@ static bool do_test_accounting(bool is_ops, /* are we testing bps or ops */
>      throttle_config_init(&cfg);
>  
>      for (i = 0; i < 3; i++) {
> -        BucketType index = to_test[is_ops][i];
> +        index = to_test[is_ops][i];
>          cfg.buckets[index].avg = avg;
>      }

Reviewed-by: Markus Armbruster <armbru@redhat.com>
and queued, thanks!