From 4c8fb9937f4c91e7f78b20d0301f7781b0f24b12 Mon Sep 17 00:00:00 2001 From: Richard Sailer Date: Sun, 4 Aug 2019 04:10:59 +0200 Subject: [PATCH] Refactoring: more meaningfull local variable names --- src/tuxedo_keyboard.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/tuxedo_keyboard.c b/src/tuxedo_keyboard.c index 5b3b8e9..13f9812 100644 --- a/src/tuxedo_keyboard.c +++ b/src/tuxedo_keyboard.c @@ -284,10 +284,10 @@ static ssize_t set_brightness_fs(struct device *child, { unsigned int val; // hier unsigned? - int ret = kstrtouint(buffer, 0, &val); - if (ret) { - return ret; + int err = kstrtouint(buffer, 0, &val); + if (err) { + return err; } val = clamp_t(u8, val, BRIGHTNESS_MIN, BRIGHTNESS_MAX); @@ -316,10 +316,10 @@ static ssize_t set_state_fs(struct device *child, struct device_attribute *attr, const char *buffer, size_t size) { unsigned int val; - int ret = kstrtouint(buffer, 0, &val); - if (ret) { - return ret; + int err = kstrtouint(buffer, 0, &val); + if (err) { + return err; } val = clamp_t(u8, val, 0, 1); @@ -344,10 +344,10 @@ static int set_color(u32 region, u32 color) static int set_color_region(const char *buffer, size_t size, u32 region) { u32 val; - int ret = kstrtouint(buffer, 0, &val); + int err = kstrtouint(buffer, 0, &val); - if (ret) { - return ret; + if (err) { + return err; } if (!set_color(region, val)) { @@ -422,10 +422,10 @@ static ssize_t set_blinking_pattern_fs(struct device *child, const char *buffer, size_t size) { unsigned int val; - int ret = kstrtouint(buffer, 0, &val); - if (ret) { - return ret; + int err = kstrtouint(buffer, 0, &val); + if (err) { + return err; } val = clamp_t(u8, val, 0, ARRAY_SIZE(blinking_patterns) - 1);