From: Geert Uytterhoeven Date: Thu, 28 Aug 2014 09:03:14 +0000 (+0200) Subject: pwm: Fix uninitialized warnings in pwm_get() X-Git-Tag: fixes-against-v3.18-rc2~24^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70145f87139fbc43b726f873813cd91dce371899;p=pandora-kernel.git pwm: Fix uninitialized warnings in pwm_get() 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 Signed-off-by: Thierry Reding --- Reading git-diff-tree failed