set_color_region(): more meaningfull variable names

This commit is contained in:
Richard Sailer 2019-08-04 04:33:00 +02:00
parent 4c8fb9937f
commit 0a98818376

View file

@ -341,28 +341,28 @@ static int set_color(u32 region, u32 color)
return tuxedo_evaluate_wmi_method(SET_KB_LED, cmd, NULL); return tuxedo_evaluate_wmi_method(SET_KB_LED, cmd, NULL);
} }
static int set_color_region(const char *buffer, size_t size, u32 region) static int set_color_region(const char *color_string, size_t size, u32 region)
{ {
u32 val; u32 colorcode;
int err = kstrtouint(buffer, 0, &val); int err = kstrtouint(color_string, 0, &colorcode);
if (err) { if (err) {
return err; return err;
} }
if (!set_color(region, val)) { if (!set_color(region, colorcode)) {
switch (region) { switch (region) {
case REGION_LEFT: case REGION_LEFT:
keyboard.color.left = val; keyboard.color.left = colorcode;
break; break;
case REGION_CENTER: case REGION_CENTER:
keyboard.color.center = val; keyboard.color.center = colorcode;
break; break;
case REGION_RIGHT: case REGION_RIGHT:
keyboard.color.right = val; keyboard.color.right = colorcode;
break; break;
case REGION_EXTRA: case REGION_EXTRA:
keyboard.color.extra = val; keyboard.color.extra = colorcode;
break; break;
} }
} }