pwm: sysfs: Remove unnecessary temporary variable
authorOlliver Schinagl <oliver@schinagl.nl>
Mon, 26 Oct 2015 21:32:36 +0000 (22:32 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Tue, 10 Nov 2015 12:06:45 +0000 (13:06 +0100)
Use the result of pwm_is_enabled() directly instead of storing it in a
temporary variable.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/sysfs.c

index c472772f00a7880611e23e62cfbd1731d04dfa27..ba67845b9063b599277a40c89db5268fbe6abe13 100644 (file)
@@ -97,9 +97,8 @@ static ssize_t pwm_enable_show(struct device *child,
                               char *buf)
 {
        const struct pwm_device *pwm = child_to_pwm_device(child);
-       int enabled = pwm_is_enabled(pwm);
 
-       return sprintf(buf, "%d\n", enabled);
+       return sprintf(buf, "%d\n", pwm_is_enabled(pwm));
 }
 
 static ssize_t pwm_enable_store(struct device *child,