From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424565AbcBRBjD (ORCPT ); Wed, 17 Feb 2016 20:39:03 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:27878 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424516AbcBRBiy (ORCPT ); Wed, 17 Feb 2016 20:38:54 -0500 X-AuditID: cbfec7f4-f79026d00000418a-a3-56c520ab7ce7 Subject: Re: [PATCH v2] regulator: s2mps11: Simplify expression used in BUILD_BUG_ON To: Andi Shyti References: <1455755707-16844-1-git-send-email-k.kozlowski@samsung.com> <20160218013705.GI10719@samsunx.samsung> Cc: Sangbeom Kim , Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, jacob.e.keller@intel.com, Arnd Bergmann From: Krzysztof Kozlowski Message-id: <56C520A7.40201@samsung.com> Date: Thu, 18 Feb 2016 10:38:47 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-version: 1.0 In-reply-to: <20160218013705.GI10719@samsunx.samsung> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBLMWRmVeSWpSXmKPExsVy+t/xK7qrFY6GGdw7JWax/cgzVou/k46x W0x9+ITN4sSxhSwWr18YWny70sFkcXnXHDaLGef3MVlcXPGFyYHT4/evSYweO2fdZfdYvOcl k8emVZ1sHn1bVjF6fN4kF8AWxWWTkpqTWZZapG+XwJXRcvcCU8EJ9ooLN9eyNDD2sXUxcnJI CJhIzDzayghhi0lcuLceKM7FISSwlFHi9OtLTBDOU0aJ7U/3glUJC4RJzF04HaxbREBdYsne rcwgtpBAkUTn8hvMIA3MAm8YJf79+8oOkmATMJbYvHwJWAOvgIbEo5ZpYINYBFQl7rbcAouL CkRIHO7sYoeoEZT4MfkeSxcjBwengKnE5znBICazgJ7E/YtaIBXMAvISm9e8ZZ7AKDALScMs hKpZSKoWMDKvYhRNLU0uKE5KzzXUK07MLS7NS9dLzs/dxAgJ/y87GBcfszrEKMDBqMTDy/H6 SJgQa2JZcWXuIUYJDmYlEV5fvqNhQrwpiZVVqUX58UWlOanFhxilOViUxHnn7nofIiSQnliS mp2aWpBaBJNl4uCUamBsy5orbny/aObPO2VViyc71PY9XMDxVuCjd4BPy5VaYZc4rbly6QIP lu9xaDpjkye+ZF7r3q186hoHg547NF09lfhhXx/vjoev732afZF5Ck/Eee2C9NPlH9wf/J14 VKx25c3IU7Wcdiue/HXtbJHKu214zdD29ZRvy7ZGeFwrbjv631Xiq8BqJZbijERDLeai4kQA uhkREXsCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> Signed-off-by: Krzysztof Kozlowski >> > > [...] > >> 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