All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Remove multiple assignments
@ 2016-02-13  6:14 Bhumika Goyal
  2016-02-13  6:18 ` [PATCH 1/2] Staging: wlan-ng: " Bhumika Goyal
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Bhumika Goyal @ 2016-02-13  6:14 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Bhumika Goyal

This patchset removes multiple assignment by factorizing them.
Made a coccinelle script to match cases:
@@
identifier a,b;
constant c;
@@
-a=b=c;
+a=c;
+b=c;

Bhumika Goyal (2):
  Staging: wlan-ng: Remove multiple assignments
  Staging: media: Remove multiple assignments

 drivers/staging/media/davinci_vpfe/dm365_isif.c | 3 ++-
 drivers/staging/wlan-ng/p80211wep.c             | 6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] Staging: wlan-ng: Remove multiple assignments
  2016-02-13  6:14 [PATCH 0/2] Remove multiple assignments Bhumika Goyal
@ 2016-02-13  6:18 ` Bhumika Goyal
  2016-02-13  6:19 ` [PATCH 2/2] Staging: media: " Bhumika Goyal
  2016-02-13  6:31 ` [Outreachy kernel] [PATCH 0/2] " Julia Lawall
  2 siblings, 0 replies; 6+ messages in thread
From: Bhumika Goyal @ 2016-02-13  6:18 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Bhumika Goyal

Remove multiple assignments by factorizing them.
Made a coccinelle script to match cases:
@@
identifier a,b;
constant c;
@@
-a=b=c;
+a=c;
+b=c;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/staging/wlan-ng/p80211wep.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211wep.c b/drivers/staging/wlan-ng/p80211wep.c
index e9f990a..22c7970 100644
--- a/drivers/staging/wlan-ng/p80211wep.c
+++ b/drivers/staging/wlan-ng/p80211wep.c
@@ -188,7 +188,8 @@ int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, int key_override,
 
 	/* Apply the RC4 to the data, update the CRC32 */
 	crc = ~0;
-	i = j = 0;
+	i = 0;
+	j = 0;
 	for (k = 0; k < len; k++) {
 		i = (i + 1) & 0xff;
 		j = (j + s[i]) & 0xff;
@@ -260,7 +261,8 @@ int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum,
 
 	/* Update CRC32 then apply RC4 to the data */
 	crc = ~0;
-	i = j = 0;
+	i = 0;
+	j = 0;
 	for (k = 0; k < len; k++) {
 		crc = wep_crc32_table[(crc ^ buf[k]) & 0xff] ^ (crc >> 8);
 		i = (i + 1) & 0xff;
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] Staging: media: Remove multiple assignments
  2016-02-13  6:14 [PATCH 0/2] Remove multiple assignments Bhumika Goyal
  2016-02-13  6:18 ` [PATCH 1/2] Staging: wlan-ng: " Bhumika Goyal
@ 2016-02-13  6:19 ` Bhumika Goyal
  2016-02-13  6:31 ` [Outreachy kernel] [PATCH 0/2] " Julia Lawall
  2 siblings, 0 replies; 6+ messages in thread
From: Bhumika Goyal @ 2016-02-13  6:19 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Bhumika Goyal

Remove multiple assignments by factorizing them.
Made a coccinelle script to match cases:
@@
identifier a,b;
constant c;
@@
-a=b=c;
+a=c;
+b=c;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/staging/media/davinci_vpfe/dm365_isif.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/davinci_vpfe/dm365_isif.c b/drivers/staging/media/davinci_vpfe/dm365_isif.c
index 65f6ce3..cfad426 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_isif.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_isif.c
@@ -1239,7 +1239,8 @@ static int isif_config_ycbcr(struct v4l2_subdev *sd, int mode)
 	 * a lot of registers that we didn't touch
 	 */
 	/* start with all bits zero */
-	ccdcfg = modeset = 0;
+	ccdcfg = 0;
+	modeset = 0;
 	pix_fmt = isif_get_pix_fmt(format->code);
 	if (pix_fmt < 0) {
 		pr_debug("Invalid pix_fmt(input mode)\n");
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Outreachy kernel] [PATCH 0/2] Remove multiple assignments
  2016-02-13  6:14 [PATCH 0/2] Remove multiple assignments Bhumika Goyal
  2016-02-13  6:18 ` [PATCH 1/2] Staging: wlan-ng: " Bhumika Goyal
  2016-02-13  6:19 ` [PATCH 2/2] Staging: media: " Bhumika Goyal
@ 2016-02-13  6:31 ` Julia Lawall
  2016-02-13  8:28   ` Bhumika Goyal
  2 siblings, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2016-02-13  6:31 UTC (permalink / raw)
  To: Bhumika Goyal; +Cc: outreachy-kernel

On Sat, 13 Feb 2016, Bhumika Goyal wrote:

> This patchset removes multiple assignment by factorizing them.
> Made a coccinelle script to match cases:
> @@
> identifier a,b;
> constant c;
> @@
> -a=b=c;
> +a=c;
> +b=c;

The double assgnments are actually a bit annoying from a Coccinelle point 
of view.  But probably from a human developer point of view, the original 
code is better, because it is more concise, and anyway the assignments are 
completely trivial.

julia

> 
> Bhumika Goyal (2):
>   Staging: wlan-ng: Remove multiple assignments
>   Staging: media: Remove multiple assignments
> 
>  drivers/staging/media/davinci_vpfe/dm365_isif.c | 3 ++-
>  drivers/staging/wlan-ng/p80211wep.c             | 6 ++++--
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 
> -- 
> 1.9.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 post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/cover.1455343091.git.bhumirks%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Outreachy kernel] [PATCH 0/2] Remove multiple assignments
  2016-02-13  6:31 ` [Outreachy kernel] [PATCH 0/2] " Julia Lawall
@ 2016-02-13  8:28   ` Bhumika Goyal
  2016-02-13 18:31     ` Julia Lawall
  0 siblings, 1 reply; 6+ messages in thread
From: Bhumika Goyal @ 2016-02-13  8:28 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: bhumirks


[-- Attachment #1.1: Type: text/plain, Size: 1647 bytes --]



On Saturday, February 13, 2016 at 12:01:09 PM UTC+5:30, Julia Lawall wrote:
>
> On Sat, 13 Feb 2016, Bhumika Goyal wrote: 
>
> > This patchset removes multiple assignment by factorizing them. 
> > Made a coccinelle script to match cases: 
> > @@ 
> > identifier a,b; 
> > constant c; 
> > @@ 
> > -a=b=c; 
> > +a=c; 
> > +b=c; 
>
> The double assgnments are actually a bit annoying from a Coccinelle point 
> of view.  But probably from a human developer point of view, the original 
> code is better, because it is more concise, and anyway the assignments are 
> completely trivial. 
>   
>
     Ok will keep that in mind. But then checkpatch warning for double 
assignments is false positive ?

    Thanks
    Bhumika 

> julia 
>
> > 
> > Bhumika Goyal (2): 
> >   Staging: wlan-ng: Remove multiple assignments 
> >   Staging: media: Remove multiple assignments 
> > 
> >  drivers/staging/media/davinci_vpfe/dm365_isif.c | 3 ++- 
> >  drivers/staging/wlan-ng/p80211wep.c             | 6 ++++-- 
> >  2 files changed, 6 insertions(+), 3 deletions(-) 
> > 
> > -- 
> > 1.9.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-kern...@googlegroups.com <javascript:>. 
> > To post to this group, send email to outreach...@googlegroups.com 
> <javascript:>. 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/cover.1455343091.git.bhumirks%40gmail.com. 
>
> > For more options, visit https://groups.google.com/d/optout. 
> > 
>

[-- Attachment #1.2: Type: text/html, Size: 3220 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Outreachy kernel] [PATCH 0/2] Remove multiple assignments
  2016-02-13  8:28   ` Bhumika Goyal
@ 2016-02-13 18:31     ` Julia Lawall
  0 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2016-02-13 18:31 UTC (permalink / raw)
  To: Bhumika Goyal; +Cc: outreachy-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1821 bytes --]

>      Ok will keep that in mind. But then checkpatch warning for double
> assignments is false positive ?

Ah ok, I didn't realize that checkpatch complains about this.  I guess the 
change is fine in that case.

julia

> 
>     Thanks
>     Bhumika
>       julia
> 
>       >
>       > Bhumika Goyal (2):
>       >   Staging: wlan-ng: Remove multiple assignments
>       >   Staging: media: Remove multiple assignments
>       >
>       >  drivers/staging/media/davinci_vpfe/dm365_isif.c | 3 ++-
>       >  drivers/staging/wlan-ng/p80211wep.c             | 6 ++++--
>       >  2 files changed, 6 insertions(+), 3 deletions(-)
>       >
>       > --
>       > 1.9.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-kern...@googlegroups.com.
>       > To post to this group, send email to
>       outreach...@googlegroups.com.
>       > To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/cover.1455343091.git.bhu
>       mirks%40gmail.com.
>       > For more options, visit https://groups.google.com/d/optout.
>       >
> 
> --
> 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 post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/8615600f-b029-4b7c-bcdb-
> aee18a663cc8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-02-13 18:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-13  6:14 [PATCH 0/2] Remove multiple assignments Bhumika Goyal
2016-02-13  6:18 ` [PATCH 1/2] Staging: wlan-ng: " Bhumika Goyal
2016-02-13  6:19 ` [PATCH 2/2] Staging: media: " Bhumika Goyal
2016-02-13  6:31 ` [Outreachy kernel] [PATCH 0/2] " Julia Lawall
2016-02-13  8:28   ` Bhumika Goyal
2016-02-13 18:31     ` Julia Lawall

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.