Discussion:
[PATCH 1/3] speakup:Multiple assignments should be avoided
Samuel Thibault
2017-04-17 18:48:02 UTC
Permalink
Hello,
As suggested by checkpatch.pl, multiple assignments of variables should be avoided.
"shouldn" doesn't mean "must :)
static void speakup_date(struct vc_data *vc)
{
- spk_x = spk_cx = vc->vc_x;
- spk_y = spk_cy = vc->vc_y;
- spk_pos = spk_cp = vc->vc_pos;
Multiple assignment is more readable here
- spk_pos = spk_cp = speakup_console[vc_num]->ht.rpos[hc];
- spk_x = spk_cx = speakup_console[vc_num]->ht.rx[hc];
- spk_y = spk_cy = speakup_console[vc_num]->ht.ry[hc];
And there.
@@ -2108,7 +2114,8 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym,
spk_keydown = 0;
goto out;
}
- value = spk_lastkey = pad_chars[value];
+ spk_lastkey = pad_chars[value];
+ value = spk_lastkey;
There it's more questionable indeed, I'm fine with seen this part of the
patch applied.

Samuel

Loading...