qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Malc <av1474@comtv.ru>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] audio: Fix warning from static code analysis
Date: Sat, 22 Sep 2012 23:24:28 +0200	[thread overview]
Message-ID: <505E2C8C.3070408@weilnetz.de> (raw)
In-Reply-To: <1346700316-26625-1-git-send-email-sw@weilnetz.de>

Am 03.09.2012 21:25, schrieb Stefan Weil:
> smatch report:
> audio/audio_template.h:416 AUD_open_out(18) warn:
>   variable dereferenced before check 'as' (see line 414)
>
> Moving the ldebug statement after the statement which checks 'as'
> fixes that warning.
>
> Signed-off-by: Stefan Weil<sw@weilnetz.de>
> ---
>
> This patch fails when checked by checkpatch.pl because
> it preserves the coding style used for QEMU audio code.
>
> Please apply the patch after QEMU 1.2 was released.
>
> Thanks,
>
> Stefan Weil
>
>   audio/audio_template.h |    6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/audio/audio_template.h b/audio/audio_template.h
> index 519432a..16f7880 100644
> --- a/audio/audio_template.h
> +++ b/audio/audio_template.h
> @@ -410,15 +410,15 @@ SW *glue (AUD_open_, TYPE) (
>       SW *old_sw = NULL;
>   #endif
>
> -    ldebug ("open %s, freq %d, nchannels %d, fmt %d\n",
> -            name, as->freq, as->nchannels, as->fmt);
> -
>       if (audio_bug (AUDIO_FUNC, !card || !name || !callback_fn || !as)) {
>           dolog ("card=%p name=%p callback_fn=%p as=%p\n",
>                  card, name, callback_fn, as);
>           goto fail;
>       }
>
> +    ldebug ("open %s, freq %d, nchannels %d, fmt %d\n",
> +            name, as->freq, as->nchannels, as->fmt);
> +
>       if (audio_bug (AUDIO_FUNC, audio_validate_settings (as))) {
>           audio_print_settings (as);
>           goto fail;
>    

Ping?

  reply	other threads:[~2012-09-22 21:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-03 19:25 [Qemu-devel] [PATCH] audio: Fix warning from static code analysis Stefan Weil
2012-09-22 21:24 ` Stefan Weil [this message]
2012-09-22 21:43   ` malc

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=505E2C8C.3070408@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=av1474@comtv.ru \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).