* [PATCH] staging: speakup: Fix multiple assignments on a single line
@ 2019-10-27 5:06 Frank A. Cancio Bello
2019-10-27 5:35 ` [Outreachy kernel] " Julia Lawall
2019-10-27 7:13 ` Greg KH
0 siblings, 2 replies; 5+ messages in thread
From: Frank A. Cancio Bello @ 2019-10-27 5:06 UTC (permalink / raw)
To: gregkh
Cc: William Hubbs, Chris Brannon, Kirk Reiser, Samuel Thibault,
outreachy-kernel, saiprakash.ranjan, joel
checkpatch message: "multiple assignments should be avoided"
Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com>
---
This is the second patch that I send for "Outreachy December 2019 to
March 2020".
drivers/staging/speakup/main.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index 488f2539aa9a..6f5a58bd1f81 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -263,9 +263,12 @@ static unsigned char get_attributes(struct vc_data *vc, u16 *pos)
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;
+ spk_cx = vc->vc_x;
+ spk_x = spk_cx;
+ spk_cy = vc->vc_y;
+ spk_y = spk_cy;
+ spk_cp = vc->vc_pos;
+ spk_pos = spk_cp;
spk_old_attr = spk_attr;
spk_attr = get_attributes(vc, (u_short *)spk_pos);
}
@@ -1672,9 +1675,12 @@ static int speak_highlight(struct vc_data *vc)
spk_do_flush();
spkup_write(speakup_console[vc_num]->ht.highbuf[hc],
speakup_console[vc_num]->ht.highsize[hc]);
- 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];
+ spk_cp = speakup_console[vc_num]->ht.rpos[hc];
+ spk_pos = spk_cp;
+ spk_cx = speakup_console[vc_num]->ht.rx[hc];
+ spk_x = spk_cx;
+ spk_cy = speakup_console[vc_num]->ht.ry[hc];
+ spk_y = spk_cy;
return 1;
}
return 0;
@@ -2117,7 +2123,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;
spk_keydown++;
spk_parked &= 0xfe;
goto no_map;
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [Outreachy kernel] [PATCH] staging: speakup: Fix multiple assignments on a single line
2019-10-27 5:06 [PATCH] staging: speakup: Fix multiple assignments on a single line Frank A. Cancio Bello
@ 2019-10-27 5:35 ` Julia Lawall
2019-10-27 7:13 ` Greg KH
1 sibling, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2019-10-27 5:35 UTC (permalink / raw)
To: Frank A. Cancio Bello
Cc: gregkh, William Hubbs, Chris Brannon, Kirk Reiser,
Samuel Thibault, outreachy-kernel, saiprakash.ranjan, joel
On Sun, 27 Oct 2019, Frank A. Cancio Bello wrote:
> checkpatch message: "multiple assignments should be avoided"
Despite the comment of checkpatch, I think it was clearer before. Maybe
there is some way to rewrite the code so that not so many variables are
needed, but since they seem to be globa variables, that may not be
possible.
>
> Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com>
> ---
>
> This is the second patch that I send for "Outreachy December 2019 to
> March 2020".
This comment isn't needed. The git logs show what patches you have gotten
accepted.
julia
> drivers/staging/speakup/main.c | 21 ++++++++++++++-------
> 1 file changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
> index 488f2539aa9a..6f5a58bd1f81 100644
> --- a/drivers/staging/speakup/main.c
> +++ b/drivers/staging/speakup/main.c
> @@ -263,9 +263,12 @@ static unsigned char get_attributes(struct vc_data *vc, u16 *pos)
>
> 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;
> + spk_cx = vc->vc_x;
> + spk_x = spk_cx;
> + spk_cy = vc->vc_y;
> + spk_y = spk_cy;
> + spk_cp = vc->vc_pos;
> + spk_pos = spk_cp;
> spk_old_attr = spk_attr;
> spk_attr = get_attributes(vc, (u_short *)spk_pos);
> }
> @@ -1672,9 +1675,12 @@ static int speak_highlight(struct vc_data *vc)
> spk_do_flush();
> spkup_write(speakup_console[vc_num]->ht.highbuf[hc],
> speakup_console[vc_num]->ht.highsize[hc]);
> - 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];
> + spk_cp = speakup_console[vc_num]->ht.rpos[hc];
> + spk_pos = spk_cp;
> + spk_cx = speakup_console[vc_num]->ht.rx[hc];
> + spk_x = spk_cx;
> + spk_cy = speakup_console[vc_num]->ht.ry[hc];
> + spk_y = spk_cy;
> return 1;
> }
> return 0;
> @@ -2117,7 +2123,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;
> spk_keydown++;
> spk_parked &= 0xfe;
> goto no_map;
> --
> 2.17.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20191027050640.GA24283%40linux-kernel-dev.
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Outreachy kernel] [PATCH] staging: speakup: Fix multiple assignments on a single line
2019-10-27 5:06 [PATCH] staging: speakup: Fix multiple assignments on a single line Frank A. Cancio Bello
2019-10-27 5:35 ` [Outreachy kernel] " Julia Lawall
@ 2019-10-27 7:13 ` Greg KH
2019-10-27 11:10 ` Samuel Thibault
1 sibling, 1 reply; 5+ messages in thread
From: Greg KH @ 2019-10-27 7:13 UTC (permalink / raw)
To: Frank A. Cancio Bello
Cc: William Hubbs, Chris Brannon, Kirk Reiser, Samuel Thibault,
outreachy-kernel, saiprakash.ranjan, joel
On Sun, Oct 27, 2019 at 05:06:40AM +0000, Frank A. Cancio Bello wrote:
> checkpatch message: "multiple assignments should be avoided"
>
> Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com>
> ---
>
> This is the second patch that I send for "Outreachy December 2019 to
> March 2020".
>
> drivers/staging/speakup/main.c | 21 ++++++++++++++-------
> 1 file changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
> index 488f2539aa9a..6f5a58bd1f81 100644
> --- a/drivers/staging/speakup/main.c
> +++ b/drivers/staging/speakup/main.c
> @@ -263,9 +263,12 @@ static unsigned char get_attributes(struct vc_data *vc, u16 *pos)
>
> 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;
> + spk_cx = vc->vc_x;
> + spk_x = spk_cx;
> + spk_cy = vc->vc_y;
> + spk_y = spk_cy;
> + spk_cp = vc->vc_pos;
> + spk_pos = spk_cp;
As Julia said, the original is better here.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Outreachy kernel] [PATCH] staging: speakup: Fix multiple assignments on a single line
2019-10-27 7:13 ` Greg KH
@ 2019-10-27 11:10 ` Samuel Thibault
2019-10-28 2:11 ` Frank A. Cancio Bello
0 siblings, 1 reply; 5+ messages in thread
From: Samuel Thibault @ 2019-10-27 11:10 UTC (permalink / raw)
To: Greg KH
Cc: Frank A. Cancio Bello, William Hubbs, Chris Brannon, Kirk Reiser,
outreachy-kernel, saiprakash.ranjan, joel
Greg KH, le dim. 27 oct. 2019 08:13:10 +0100, a ecrit:
> As Julia said, the original is better here.
Confirmed, we have already had this patch suggestion in the past, but we
prefer the original version.
Thanks for your contribution anyway!
Samuel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: speakup: Fix multiple assignments on a single line
2019-10-27 11:10 ` Samuel Thibault
@ 2019-10-28 2:11 ` Frank A. Cancio Bello
0 siblings, 0 replies; 5+ messages in thread
From: Frank A. Cancio Bello @ 2019-10-28 2:11 UTC (permalink / raw)
To: Samuel Thibault
Cc: Greg KH, William Hubbs, Chris Brannon, Kirk Reiser,
outreachy-kernel, saiprakash.ranjan, joel
On Sun, Oct 27, 2019 at 12:10:53PM +0100, Samuel Thibault wrote:
> Greg KH, le dim. 27 oct. 2019 08:13:10 +0100, a ecrit:
> > As Julia said, the original is better here.
>
> Confirmed, we have already had this patch suggestion in the past, but we
> prefer the original version.
>
> Thanks for your contribution anyway!
>
Thank you all for your quick response and advice.
frank a.
> Samuel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-10-28 2:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-27 5:06 [PATCH] staging: speakup: Fix multiple assignments on a single line Frank A. Cancio Bello
2019-10-27 5:35 ` [Outreachy kernel] " Julia Lawall
2019-10-27 7:13 ` Greg KH
2019-10-27 11:10 ` Samuel Thibault
2019-10-28 2:11 ` Frank A. Cancio Bello
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.