linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: use uninitialized_var instead setting 'flags' to 0 directly.
@ 2014-09-22  5:52 Xiubo Li
  0 siblings, 0 replies; only message in thread
From: Xiubo Li @ 2014-09-22  5:52 UTC (permalink / raw)
  To: mturquette; +Cc: linux-kernel, Xiubo Li

Setting 'flags' to zero will be certainly a misleading way to avoid
warning of 'flags' may be used uninitialized. uninitialized_var is
a correct way because the warning is a false possitive.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
 drivers/clk/clk-gate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c
index 4a58c55..51fd87f 100644
--- a/drivers/clk/clk-gate.c
+++ b/drivers/clk/clk-gate.c
@@ -45,7 +45,7 @@ static void clk_gate_endisable(struct clk_hw *hw, int enable)
 {
 	struct clk_gate *gate = to_clk_gate(hw);
 	int set = gate->flags & CLK_GATE_SET_TO_DISABLE ? 1 : 0;
-	unsigned long flags = 0;
+	unsigned long uninitialized_var(flags);
 	u32 reg;
 
 	set ^= enable;
-- 
2.1.0.27.g96db324


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-09-22  5:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-22  5:52 [PATCH] clk: use uninitialized_var instead setting 'flags' to 0 directly Xiubo Li

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).