Re: [PATCH] regulator: max8925: fix compiler warnings

2012-11-25 Thread Qing Xu
On 11/25/2012 01:55 AM, Mark Brown wrote: 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 = _regulator_info[i]; if

Re: [PATCH] regulator: max8925: fix compiler warnings

2012-11-25 Thread Qing Xu
On 11/25/2012 01:55 AM, Mark Brown wrote: 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];

Re: [PATCH] regulator: max8925: fix compiler warnings

2012-11-24 Thread Mark Brown
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 = _regulator_info[i]; > if (ri->vol_reg == res->start) { > **

Re: [PATCH] regulator: max8925: fix compiler warnings

2012-11-24 Thread Mark Brown
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

Re: [PATCH] regulator: max8925: fix compiler warnings

2012-11-22 Thread Qing Xu
On 11/23/2012 09:41 AM, Mark Brown wrote: On Thu, Nov 22, 2012 at 10:11:06AM +0800, Qing Xu wrote: - int i, regulator_idx; + int i; + int regulator_idx = 0; This sort of fix is rarely good without some analysis as to why this is a sensible initialisation to do, just

Re: [PATCH] regulator: max8925: fix compiler warnings

2012-11-22 Thread Mark Brown
On Thu, Nov 22, 2012 at 10:11:06AM +0800, Qing Xu wrote: > - int i, regulator_idx; > + int i; > + int regulator_idx = 0; This sort of fix is rarely good without some analysis as to why this is a sensible initialisation to do, just unconditionally initialising may be masking a real

[PATCH] regulator: max8925: fix compiler warnings

2012-11-22 Thread Qing Xu
From: Qing Xu Fixed following compiler warning: - drivers/regulator/max8925-regulator.c:269:51: warning: 'regulator_idx' may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Qing Xu --- drivers/regulator/max8925-regulator.c |3 ++- 1 files changed, 2

[PATCH] regulator: max8925: fix compiler warnings

2012-11-22 Thread Qing Xu
From: Qing Xu qi...@marvell.com Fixed following compiler warning: - drivers/regulator/max8925-regulator.c:269:51: warning: 'regulator_idx' may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Qing Xu qi...@marvell.com --- drivers/regulator/max8925-regulator.c |

Re: [PATCH] regulator: max8925: fix compiler warnings

2012-11-22 Thread Mark Brown
On Thu, Nov 22, 2012 at 10:11:06AM +0800, Qing Xu wrote: - int i, regulator_idx; + int i; + int regulator_idx = 0; This sort of fix is rarely good without some analysis as to why this is a sensible initialisation to do, just unconditionally initialising may be masking a real issue

Re: [PATCH] regulator: max8925: fix compiler warnings

2012-11-22 Thread Qing Xu
On 11/23/2012 09:41 AM, Mark Brown wrote: On Thu, Nov 22, 2012 at 10:11:06AM +0800, Qing Xu wrote: - int i, regulator_idx; + int i; + int regulator_idx = 0; This sort of fix is rarely good without some analysis as to why this is a sensible initialisation to do, just