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:	Thu, 18 Feb 2016 10:38:47 +0900
From:	Krzysztof Kozlowski <k.kozlowski@...sung.com>
To:	Andi Shyti <andi.shyti@...sung.com>
Cc:	Sangbeom Kim <sbkim73@...sung.com>,
	Liam Girdwood <lgirdwood@...il.com>,
	Mark Brown <broonie@...nel.org>, linux-kernel@...r.kernel.org,
	linux-samsung-soc@...r.kernel.org, jacob.e.keller@...el.com,
	Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH v2] regulator: s2mps11: Simplify expression used in
 BUILD_BUG_ON

On 18.02.2016 10:37, Andi Shyti wrote:
> Hi Krzysztof,
> 
>> Following BUILD_BUG_ON using a variable fails for some of the compilers
>> and optimization levels (reported for gcc 4.9):
>> 	var = ARRAY_SIZE(s2mps15_regulators);
>> 	BUILD_BUG_ON(S2MPS_REGULATOR_MAX < var);
>> Fix this by using ARRAY_SIZE directly.
>>
>> Additionally add missing BUILD_BUG_ON check for S2MPS15 device (the
>> check ensures that internal arrays are big enough to hold data for all
>> of regulators on all devices).
>>
>> Reported-by: Arnd Bergmann <arnd@...db.de>
>> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@...sung.com>
>>
> 
> [...]
> 
>>  	case S2MPS11X:
>>  		s2mps11->rdev_num = ARRAY_SIZE(s2mps11_regulators);
> 
> Why don't we remove rdev_num at all? It's not used that much
> other than in the probe function.

Remove from probe? It is used in probe and removal would make the code
more complicated than it should be.

Best regards,
Krzysztof

Powered by blists - more mailing lists