lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 24 Nov 2012 18:55:55 +0100
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Qing Xu <qingx@...vell.com>
Cc:	"lrg@...com" <lrg@...com>,
	"haojian.zhuang@...il.com" <haojian.zhuang@...il.com>,
	Chao Xie <cxie4@...vell.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] regulator: max8925: fix compiler warnings

On Fri, Nov 23, 2012 at 10:27:12AM +0800, Qing Xu wrote:

> But, in fact, it is not necessary to initialize regulator_idx.

>         for (i = 0; i < ARRAY_SIZE(max8925_regulator_info); i++) {
>                 ri = &max8925_regulator_info[i];
>                 if (ri->vol_reg == res->start) {

> ****** if regulator_idx can not get a match "i" here, it will return
> -EINVAL in below code

>                         regulator_idx = i;
>                         break;
>                 }
>         }

>         if (i == ARRAY_SIZE(max8925_regulator_info)) {
>                 dev_err(&pdev->dev, "Failed to find regulator %llu\n",
>                         (unsigned long long)res->start);
>                 return -EINVAL;
>         }

> How to solve such compiler warning?

Typically by reporting a compiler bug, though sometimes in the process
of doing that one finds out that there's some non-obvious way in which
the code can break.

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ