[PATCH] lib: fwts_cpu: initialize variable, stop coverity warning
IvanHu
ivan.hu at canonical.com
Thu May 16 03:18:48 UTC 2013
On 05/07/2013 07:11 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Coverity CID #997324, Uninitialized scalar variable (UNINIT)
>
> We really don't care about initializing the loop counter as
> we are just burning up CPU cycles. But to keep coverity happy
> we may as well initialize it.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/lib/src/fwts_cpu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_cpu.c b/src/lib/src/fwts_cpu.c
> index 282bc42..44711fd 100644
> --- a/src/lib/src/fwts_cpu.c
> +++ b/src/lib/src/fwts_cpu.c
> @@ -385,7 +385,7 @@ int fwts_cpu_performance(
> static void fwts_cpu_consume_cycles(void)
> {
> signal(SIGUSR1, fwts_cpu_consume_sighandler);
> - uint64_t i;
> + uint64_t i = 0;
>
> for (;;) {
> fwts_cpu_burn_cycles();
>
Acked-by: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list