[PATCH 1/3] speakup:Multiple assignments should be avoided

Samuel Thibault samuel.thibault at ens-lyon.org
Mon Apr 17 14:48:02 EDT 2017


Hello,

Rishiraj Manwatkar, on lun. 17 avril 2017 17:42:46 +0000, wrote:
> 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


More information about the Speakup mailing list