From: Martin Peres <martin.peres@linux.intel.com>
To: Simon Ser <simon.ser@intel.com>, igt-dev@lists.freedesktop.org
Cc: petri.latvala@intel.com
Subject: Re: [igt-dev] [PATCH i-g-t] lib/tests/igt_audio: fix bad-function-cast warning
Date: Wed, 12 Jun 2019 13:53:49 +0300 [thread overview]
Message-ID: <292745eb-cc76-185f-70ad-32360f6fd792@linux.intel.com> (raw)
In-Reply-To: <20190607110848.7516-1-simon.ser@intel.com>
On 07/06/2019 14:08, Simon Ser wrote:
> Cast a variable instead of the return value of the function.
>
> Signed-off-by: Simon Ser <simon.ser@intel.com>
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
> ---
> lib/tests/igt_audio.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/lib/tests/igt_audio.c b/lib/tests/igt_audio.c
> index 47e61adf74fe..eee4dd51f04c 100644
> --- a/lib/tests/igt_audio.c
> +++ b/lib/tests/igt_audio.c
> @@ -65,11 +65,14 @@ static void test_signal_detect_noise(struct audio_signal *signal)
> double buf[BUFFER_LEN];
> bool ok;
> size_t i;
> + long r;
>
> /* Generate random samples between -1 and 1 */
> srand(42);
> - for (i = 0; i < BUFFER_LEN; i++)
> - buf[i] = (double) random() / RAND_MAX * 2 - 1;
> + for (i = 0; i < BUFFER_LEN; i++) {
> + r = random();
> + buf[i] = (double) r / RAND_MAX * 2 - 1;
> + }
>
> ok = audio_signal_detect(signal, SAMPLING_RATE, 0, buf, BUFFER_LEN);
>
> --
> 2.21.0
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
prev parent reply other threads:[~2019-06-12 10:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-07 11:08 [igt-dev] [PATCH i-g-t] lib/tests/igt_audio: fix bad-function-cast warning Simon Ser
2019-06-07 11:44 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-06-09 21:24 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-06-10 7:42 ` Ser, Simon
2019-06-10 10:15 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/tests/igt_audio: fix bad-function-cast warning (rev2) Patchwork
2019-06-10 22:15 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-06-12 10:53 ` Martin Peres [this message]
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=292745eb-cc76-185f-70ad-32360f6fd792@linux.intel.com \
--to=martin.peres@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=petri.latvala@intel.com \
--cc=simon.ser@intel.com \
/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