From: Fabrice Gasnier <fabrice.gasnier@st.com>
To: <lee.jones@linaro.org>, <thierry.reding@gmail.com>
Cc: <rdunlap@infradead.org>, <sfr@canb.auug.org.au>,
<gerald.baeza@st.com>, <alexandre.torgue@st.com>,
<mcoquelin.stm32@gmail.com>, <linux-next@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <linux-pwm@vger.kernel.org>
Subject: [PATCH 2/2] pwm: stm32: initialize raw local variables
Date: Fri, 18 May 2018 17:24:04 +0200 [thread overview]
Message-ID: <1526657044-14879-3-git-send-email-fabrice.gasnier@st.com> (raw)
In-Reply-To: <1526657044-14879-1-git-send-email-fabrice.gasnier@st.com>
This removes build warning when COMPILE_TEST=y and MFD_STM32_TIMERS=n
in drivers/pwm/pwm-stm32.c. In function 'stm32_pwm_capture' 'raw_prd' and
'raw_dty' may be used uninitialized in this function
[-Wmaybe-uninitialized]
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
---
drivers/pwm/pwm-stm32.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
index 60bfc07..09383c6 100644
--- a/drivers/pwm/pwm-stm32.c
+++ b/drivers/pwm/pwm-stm32.c
@@ -170,7 +170,7 @@ static int stm32_pwm_capture(struct pwm_chip *chip, struct pwm_device *pwm,
unsigned long long prd, div, dty;
unsigned long rate;
unsigned int psc = 0, icpsc, scale;
- u32 raw_prd, raw_dty;
+ u32 raw_prd = 0, raw_dty = 0;
int ret = 0;
mutex_lock(&priv->lock);
--
1.9.1
next prev parent reply other threads:[~2018-05-18 15:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-18 15:24 [PATCH 0/2] Fix STM32 PWM capture build with COMPILE_TEST Fabrice Gasnier
2018-05-18 15:24 ` [PATCH 1/2] mfd: stm32-timers: fix pwm-stm32 linker issue " Fabrice Gasnier
2018-05-18 16:56 ` Randy Dunlap
2018-06-04 6:13 ` Lee Jones
2018-05-18 15:24 ` Fabrice Gasnier [this message]
2018-05-18 16:56 ` [PATCH 2/2] pwm: stm32: initialize raw local variables Randy Dunlap
2018-05-18 22:05 ` Thierry Reding
2018-06-04 6:12 ` Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1526657044-14879-3-git-send-email-fabrice.gasnier@st.com \
--to=fabrice.gasnier@st.com \
--cc=alexandre.torgue@st.com \
--cc=gerald.baeza@st.com \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=mcoquelin.stm32@gmail.com \
--cc=rdunlap@infradead.org \
--cc=sfr@canb.auug.org.au \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).