Refactoring: more meaningfull local variable names

This commit is contained in:
Richard Sailer 2019-08-04 04:10:59 +02:00
parent 2071710a71
commit 4c8fb9937f

View file

@ -284,10 +284,10 @@ static ssize_t set_brightness_fs(struct device *child,
{ {
unsigned int val; unsigned int val;
// hier unsigned? // hier unsigned?
int ret = kstrtouint(buffer, 0, &val);
if (ret) { int err = kstrtouint(buffer, 0, &val);
return ret; if (err) {
return err;
} }
val = clamp_t(u8, val, BRIGHTNESS_MIN, BRIGHTNESS_MAX); 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) const char *buffer, size_t size)
{ {
unsigned int val; unsigned int val;
int ret = kstrtouint(buffer, 0, &val);
if (ret) { int err = kstrtouint(buffer, 0, &val);
return ret; if (err) {
return err;
} }
val = clamp_t(u8, val, 0, 1); 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) static int set_color_region(const char *buffer, size_t size, u32 region)
{ {
u32 val; u32 val;
int ret = kstrtouint(buffer, 0, &val); int err = kstrtouint(buffer, 0, &val);
if (ret) { if (err) {
return ret; return err;
} }
if (!set_color(region, val)) { 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) const char *buffer, size_t size)
{ {
unsigned int val; unsigned int val;
int ret = kstrtouint(buffer, 0, &val);
if (ret) { int err = kstrtouint(buffer, 0, &val);
return ret; if (err) {
return err;
} }
val = clamp_t(u8, val, 0, ARRAY_SIZE(blinking_patterns) - 1); val = clamp_t(u8, val, 0, ARRAY_SIZE(blinking_patterns) - 1);