All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH 2/2] seccomp: avoid shadowing of 'action' variable
Date: Fri, 29 Sep 2023 08:49:05 +0200	[thread overview]
Message-ID: <8734yxiie6.fsf@pond.sub.org> (raw)
In-Reply-To: <20230922160644.438631-3-berrange@redhat.com> ("Daniel P. Berrangé"'s message of "Fri, 22 Sep 2023 17:06:44 +0100")

Daniel P. Berrangé <berrange@redhat.com> writes:

> This is confusing as one 'action' variable is used for storing
> a SCMP_ enum value, while the other 'action' variable is used
> for storing a SECCOMP_ enum value.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  softmmu/qemu-seccomp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/softmmu/qemu-seccomp.c b/softmmu/qemu-seccomp.c
> index d66a2a1226..4d7439e7f7 100644
> --- a/softmmu/qemu-seccomp.c
> +++ b/softmmu/qemu-seccomp.c
> @@ -283,9 +283,9 @@ static uint32_t qemu_seccomp_update_action(uint32_t action)
>      if (action == SCMP_ACT_TRAP) {
>          static int kill_process = -1;
>          if (kill_process == -1) {
> -            uint32_t action = SECCOMP_RET_KILL_PROCESS;
> +            uint32_t testaction = SECCOMP_RET_KILL_PROCESS;
>  
> -            if (qemu_seccomp(SECCOMP_GET_ACTION_AVAIL, 0, &action) == 0) {
> +            if (qemu_seccomp(SECCOMP_GET_ACTION_AVAIL, 0, &testaction) == 0) {
>                  kill_process = 1;
>              } else {
>                  kill_process = 0;

I'd prefer @test_action.  Regardless:
Reviewed-by: Markus Armbruster <armbru@redhat.com>



  reply	other threads:[~2023-09-29  6:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22 16:06 [PATCH 0/2] remove some variable shadowing Daniel P. Berrangé
2023-09-22 16:06 ` [PATCH 1/2] crypto: remove shadowed 'ret' variable Daniel P. Berrangé
2023-09-22 18:15   ` Philippe Mathieu-Daudé
2023-09-22 16:06 ` [PATCH 2/2] seccomp: avoid shadowing of 'action' variable Daniel P. Berrangé
2023-09-29  6:49   ` Markus Armbruster [this message]
2023-09-29  6:49 ` [PATCH 0/2] remove some variable shadowing Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734yxiie6.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.