Re: [PATCH] pwm: Fix uninitialized warnings in pwm_get()

From: Thierry Reding
Date: Fri Aug 29 2014 - 04:24:44 EST


On Thu, Aug 28, 2014 at 11:03:14AM +0200, Geert Uytterhoeven wrote:
> With some versions of gcc (e.g. 4.1.2):
>
> drivers/pwm/core.c: In function âpwm_getâ:
> drivers/pwm/core.c:610: warning: âpolarityâ may be used uninitialized in this function
> drivers/pwm/core.c:609: warning: âperiodâ may be used uninitialized in this function
>
> While these are false positives, we can get rid of them by refactoring
> the code to store a pointer to the best match, as suggested before by
> Thierry Reding. This does require moving the mutex_unlock() down.
>
> Fixes: d717ea73e36dd565 ("pwm: Fix period and polarity in pwm_get() for non-perfect matches")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
> ---
> drivers/pwm/core.c | 29 ++++++++++++++---------------
> 1 file changed, 14 insertions(+), 15 deletions(-)

Applied, thanks.

Thierry

Attachment: pgp5IPw9vzP8N.pgp
Description: PGP signature