pwm: sysfs: Remove unnecessary temporary variable
authorOlliver Schinagl <[email protected]>
Mon, 26 Oct 2015 21:32:36 +0000 (22:32 +0100)
committerThierry Reding <[email protected]>
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 <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
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,