Skip to content

Commit

Permalink
pwm: fix used-uninitialized warning in pwm_get()
Browse files Browse the repository at this point in the history
Some versions of GCC don't seem no notice that the initialization of the
index variable is tied to that of the chip variable and falsely report
it as potentially being used uninitialized. However, to save anybody
else from tripping over this, we now initialize the index variable
unconditionally.

Originally-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
  • Loading branch information
Thierry Reding committed Jul 23, 2012
1 parent 2132fa8 commit d295b12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pwm/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,9 @@ struct pwm_device *pwm_get(struct device *dev, const char *con_id)
struct pwm_device *pwm = ERR_PTR(-EPROBE_DEFER);
const char *dev_id = dev ? dev_name(dev): NULL;
struct pwm_chip *chip = NULL;
unsigned int index = 0;
unsigned int best = 0;
struct pwm_lookup *p;
unsigned int index;
unsigned int match;

/* look up via DT first */
Expand Down

0 comments on commit d295b12

Please sign in to comment.