All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] delete double assignment
@ 2014-08-23 18:33 ` Julia Lawall
  0 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: linux-mips
  Cc: joe, kernel-janitors, linux-kernel, linux-fbdev, linux-serial, linux-usb

These patches fix cases where there are two adjacent assignments to the
same location.  In practice, many such occurrences appear to be
intentional, eg to initialize volatile memory, but these cases do not seem
to fall into that category.

The complete semantic match that finds these problems is as follows:

// <smpl>
@r@
expression i,f;
position p1,p2;
@@

(
 i = <+...f(...)...+>;
|
 i |= <+...f(...)...+>;
|
 i &= <+...f(...)...+>;
|
 i += <+...f(...)...+>;
|
 i -= <+...f(...)...+>;
|
 i *= <+...f(...)...+>;
|
 i /= <+...f(...)...+>;
|
 i %= <+...f(...)...+>;
|
 i ^= <+...f(...)...+>;
|
 i <<= <+...f(...)...+>;
|
 i >>= <+...f(...)...+>;
|
 i@p1 = ...;
|
 i@p1 |= ...;
|
 i@p1 &= ...;
|
 i@p1 += ...;
|
 i@p1 -= ...;
|
 i@p1 *= ...;
|
 i@p1 /= ...;
|
 i@p1 %= ...;
|
 i@p1 ^= ...;
|
 i@p1 <<= ...;
|
 i@p1 >>= ...;
|
 i@p1 ++;
|
 ++i@p1;
|
 i@p1 --;
|
 --i@p1;
)
(
 i = <+...i...+>;
|
 i = <+...f(...)...+>;
|
 i@p2 = ...;
)

@@
expression i,j,f;
position r.p1,r.p2;
@@

(
 (<+...i@p1...+>);
)
(
 (<+...\(j++\|++j\|j--\|--j\|f(...)\)...+>) = ...;
|
*i@p2 = ...;
)
// </smpl>


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

* [PATCH 0/7] delete double assignment
@ 2014-08-23 18:33 ` Julia Lawall
  0 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: linux-mips
  Cc: joe, kernel-janitors, linux-kernel, linux-fbdev, linux-serial, linux-usb

These patches fix cases where there are two adjacent assignments to the
same location.  In practice, many such occurrences appear to be
intentional, eg to initialize volatile memory, but these cases do not seem
to fall into that category.

The complete semantic match that finds these problems is as follows:

// <smpl>
@r@
expression i,f;
position p1,p2;
@@

(
 i = <+...f(...)...+>;
|
 i |= <+...f(...)...+>;
|
 i &= <+...f(...)...+>;
|
 i += <+...f(...)...+>;
|
 i -= <+...f(...)...+>;
|
 i *= <+...f(...)...+>;
|
 i /= <+...f(...)...+>;
|
 i %= <+...f(...)...+>;
|
 i ^= <+...f(...)...+>;
|
 i <<= <+...f(...)...+>;
|
 i >>= <+...f(...)...+>;
|
 i@p1 = ...;
|
 i@p1 |= ...;
|
 i@p1 &= ...;
|
 i@p1 += ...;
|
 i@p1 -= ...;
|
 i@p1 *= ...;
|
 i@p1 /= ...;
|
 i@p1 %= ...;
|
 i@p1 ^= ...;
|
 i@p1 <<= ...;
|
 i@p1 >>= ...;
|
 i@p1 ++;
|
 ++i@p1;
|
 i@p1 --;
|
 --i@p1;
)
(
 i = <+...i...+>;
|
 i = <+...f(...)...+>;
|
 i@p2 = ...;
)

@@
expression i,j,f;
position r.p1,r.p2;
@@

(
 (<+...i@p1...+>);
)
(
 (<+...\(j++\|++j\|j--\|--j\|f(...)\)...+>) = ...;
|
*i@p2 = ...;
)
// </smpl>


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

* [PATCH 1/7] video: fbdev: riva: delete double assignment
  2014-08-23 18:33 ` Julia Lawall
@ 2014-08-23 18:33   ` Julia Lawall
  -1 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: Antonino Daplas
  Cc: joe, kernel-janitors, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen, linux-fbdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Delete successive assignments to the same location.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
The patches in this series do not depend on each other.

 drivers/video/fbdev/riva/riva_hw.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/riva/riva_hw.c b/drivers/video/fbdev/riva/riva_hw.c
index 78fdbf5..8bdf37f 100644
--- a/drivers/video/fbdev/riva/riva_hw.c
+++ b/drivers/video/fbdev/riva/riva_hw.c
@@ -430,7 +430,6 @@ static char nv3_arb(nv3_fifo_info * res_info, nv3_sim_state * state,  nv3_arb_in
     int mmisses, gmisses, vmisses, eburst_size, mburst_size;
     int refresh_cycle;
 
-    refresh_cycle = 0;
     refresh_cycle = 2*(state->mclk_khz/state->pclk_khz) + 5;
     mmisses = 2;
     if (state->mem_aligned) gmisses = 2;


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

* [PATCH 1/7] video: fbdev: riva: delete double assignment
@ 2014-08-23 18:33   ` Julia Lawall
  0 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: Antonino Daplas
  Cc: joe, kernel-janitors, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen, linux-fbdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Delete successive assignments to the same location.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
The patches in this series do not depend on each other.

 drivers/video/fbdev/riva/riva_hw.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/riva/riva_hw.c b/drivers/video/fbdev/riva/riva_hw.c
index 78fdbf5..8bdf37f 100644
--- a/drivers/video/fbdev/riva/riva_hw.c
+++ b/drivers/video/fbdev/riva/riva_hw.c
@@ -430,7 +430,6 @@ static char nv3_arb(nv3_fifo_info * res_info, nv3_sim_state * state,  nv3_arb_in
     int mmisses, gmisses, vmisses, eburst_size, mburst_size;
     int refresh_cycle;
 
-    refresh_cycle = 0;
     refresh_cycle = 2*(state->mclk_khz/state->pclk_khz) + 5;
     mmisses = 2;
     if (state->mem_aligned) gmisses = 2;


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

* [PATCH 2/7] video: fbdev: intelfb: delete double assignment
  2014-08-23 18:33 ` Julia Lawall
@ 2014-08-23 18:33   ` Julia Lawall
  -1 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: Maik Broemme
  Cc: joe, kernel-janitors, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen, linux-fbdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Delete successive assignments to the same location.

In the second case, = is converted to |=, which looks appropriate based on
the values involved.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
The patches in this series do not depend on each other.

This changes the behavior of the code in the second case and is not tested.

 drivers/video/fbdev/intelfb/intelfbhw.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/intelfb/intelfbhw.c b/drivers/video/fbdev/intelfb/intelfbhw.c
index fbad61d..d31ed4e 100644
--- a/drivers/video/fbdev/intelfb/intelfbhw.c
+++ b/drivers/video/fbdev/intelfb/intelfbhw.c
@@ -1191,7 +1191,6 @@ int intelfbhw_mode_to_hw(struct intelfb_info *dinfo,
 	vsync_end = vsync_start + var->vsync_len;
 	vtotal = vsync_end + var->upper_margin;
 	vblank_start = vactive;
-	vblank_end = vtotal;
 	vblank_end = vsync_end + 1;
 
 	DBG_MSG("V: act %d, ss %d, se %d, tot %d bs %d, be %d\n",
@@ -1859,7 +1858,7 @@ void intelfbhw_cursor_init(struct intelfb_info *dinfo)
 		tmp = INREG(CURSOR_CONTROL);
 		tmp &= ~(CURSOR_FORMAT_MASK | CURSOR_GAMMA_ENABLE |
 			 CURSOR_ENABLE | CURSOR_STRIDE_MASK);
-		tmp = CURSOR_FORMAT_3C;
+		tmp |= CURSOR_FORMAT_3C;
 		OUTREG(CURSOR_CONTROL, tmp);
 		OUTREG(CURSOR_A_BASEADDR, dinfo->cursor.offset << 12);
 		tmp = (64 << CURSOR_SIZE_H_SHIFT) |


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

* [PATCH 2/7] video: fbdev: intelfb: delete double assignment
@ 2014-08-23 18:33   ` Julia Lawall
  0 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: Maik Broemme
  Cc: joe, kernel-janitors, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen, linux-fbdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Delete successive assignments to the same location.

In the second case, = is converted to |=, which looks appropriate based on
the values involved.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
The patches in this series do not depend on each other.

This changes the behavior of the code in the second case and is not tested.

 drivers/video/fbdev/intelfb/intelfbhw.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/intelfb/intelfbhw.c b/drivers/video/fbdev/intelfb/intelfbhw.c
index fbad61d..d31ed4e 100644
--- a/drivers/video/fbdev/intelfb/intelfbhw.c
+++ b/drivers/video/fbdev/intelfb/intelfbhw.c
@@ -1191,7 +1191,6 @@ int intelfbhw_mode_to_hw(struct intelfb_info *dinfo,
 	vsync_end = vsync_start + var->vsync_len;
 	vtotal = vsync_end + var->upper_margin;
 	vblank_start = vactive;
-	vblank_end = vtotal;
 	vblank_end = vsync_end + 1;
 
 	DBG_MSG("V: act %d, ss %d, se %d, tot %d bs %d, be %d\n",
@@ -1859,7 +1858,7 @@ void intelfbhw_cursor_init(struct intelfb_info *dinfo)
 		tmp = INREG(CURSOR_CONTROL);
 		tmp &= ~(CURSOR_FORMAT_MASK | CURSOR_GAMMA_ENABLE |
 			 CURSOR_ENABLE | CURSOR_STRIDE_MASK);
-		tmp = CURSOR_FORMAT_3C;
+		tmp |= CURSOR_FORMAT_3C;
 		OUTREG(CURSOR_CONTROL, tmp);
 		OUTREG(CURSOR_A_BASEADDR, dinfo->cursor.offset << 12);
 		tmp = (64 << CURSOR_SIZE_H_SHIFT) |


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

* [PATCH 3/7] serial: vr41xx_siu: delete double assignment
  2014-08-23 18:33 ` Julia Lawall
@ 2014-08-23 18:33   ` Julia Lawall
  -1 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: joe, kernel-janitors, Jiri Slaby, linux-serial, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Delete successive assignments to the same location.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
The patches in this series do not depend on each other.

Not compiled.

 drivers/tty/serial/vr41xx_siu.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/tty/serial/vr41xx_siu.c b/drivers/tty/serial/vr41xx_siu.c
index db0c8a4..d7f9d62 100644
--- a/drivers/tty/serial/vr41xx_siu.c
+++ b/drivers/tty/serial/vr41xx_siu.c
@@ -847,7 +847,6 @@ void __init vr41xx_siu_early_setup(struct uart_port *port)
 	siu_uart_ports[port->line].type = port->type;
 	siu_uart_ports[port->line].uartclk = SIU_BAUD_BASE * 16;
 	siu_uart_ports[port->line].mapbase = port->mapbase;
-	siu_uart_ports[port->line].mapbase = port->mapbase;
 	siu_uart_ports[port->line].ops = &siu_uart_ops;
 }
 


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

* [PATCH 3/7] serial: vr41xx_siu: delete double assignment
@ 2014-08-23 18:33   ` Julia Lawall
  0 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: joe, kernel-janitors, Jiri Slaby, linux-serial, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Delete successive assignments to the same location.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
The patches in this series do not depend on each other.

Not compiled.

 drivers/tty/serial/vr41xx_siu.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/tty/serial/vr41xx_siu.c b/drivers/tty/serial/vr41xx_siu.c
index db0c8a4..d7f9d62 100644
--- a/drivers/tty/serial/vr41xx_siu.c
+++ b/drivers/tty/serial/vr41xx_siu.c
@@ -847,7 +847,6 @@ void __init vr41xx_siu_early_setup(struct uart_port *port)
 	siu_uart_ports[port->line].type = port->type;
 	siu_uart_ports[port->line].uartclk = SIU_BAUD_BASE * 16;
 	siu_uart_ports[port->line].mapbase = port->mapbase;
-	siu_uart_ports[port->line].mapbase = port->mapbase;
 	siu_uart_ports[port->line].ops = &siu_uart_ops;
 }
 


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

* [PATCH 4/7] MIPS: BCM63xx: delete double assignment
  2014-08-23 18:33 ` Julia Lawall
@ 2014-08-23 18:33   ` Julia Lawall
  -1 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: joe, kernel-janitors, linux-mips, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Delete successive assignments to the same location.  In each case, the
duplicated assignment is modified to be in line with other nearby code.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
The patches in this series do not depend on each other.

Not compiled.  This patch changes the semantics of the code.

 arch/mips/bcm63xx/irq.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/bcm63xx/irq.c b/arch/mips/bcm63xx/irq.c
index 37eb2d1..b94bf44 100644
--- a/arch/mips/bcm63xx/irq.c
+++ b/arch/mips/bcm63xx/irq.c
@@ -434,7 +434,7 @@ static void bcm63xx_init_irq(void)
 		irq_stat_addr[0] += PERF_IRQSTAT_3368_REG;
 		irq_mask_addr[0] += PERF_IRQMASK_3368_REG;
 		irq_stat_addr[1] = 0;
-		irq_stat_addr[1] = 0;
+		irq_mask_addr[1] = 0;
 		irq_bits = 32;
 		ext_irq_count = 4;
 		ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_3368;
@@ -443,7 +443,7 @@ static void bcm63xx_init_irq(void)
 		irq_stat_addr[0] += PERF_IRQSTAT_6328_REG(0);
 		irq_mask_addr[0] += PERF_IRQMASK_6328_REG(0);
 		irq_stat_addr[1] += PERF_IRQSTAT_6328_REG(1);
-		irq_stat_addr[1] += PERF_IRQMASK_6328_REG(1);
+		irq_mask_addr[1] += PERF_IRQMASK_6328_REG(1);
 		irq_bits = 64;
 		ext_irq_count = 4;
 		is_ext_irq_cascaded = 1;


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

* [PATCH 4/7] MIPS: BCM63xx: delete double assignment
@ 2014-08-23 18:33   ` Julia Lawall
  0 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: joe, kernel-janitors, linux-mips, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Delete successive assignments to the same location.  In each case, the
duplicated assignment is modified to be in line with other nearby code.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
The patches in this series do not depend on each other.

Not compiled.  This patch changes the semantics of the code.

 arch/mips/bcm63xx/irq.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/bcm63xx/irq.c b/arch/mips/bcm63xx/irq.c
index 37eb2d1..b94bf44 100644
--- a/arch/mips/bcm63xx/irq.c
+++ b/arch/mips/bcm63xx/irq.c
@@ -434,7 +434,7 @@ static void bcm63xx_init_irq(void)
 		irq_stat_addr[0] += PERF_IRQSTAT_3368_REG;
 		irq_mask_addr[0] += PERF_IRQMASK_3368_REG;
 		irq_stat_addr[1] = 0;
-		irq_stat_addr[1] = 0;
+		irq_mask_addr[1] = 0;
 		irq_bits = 32;
 		ext_irq_count = 4;
 		ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_3368;
@@ -443,7 +443,7 @@ static void bcm63xx_init_irq(void)
 		irq_stat_addr[0] += PERF_IRQSTAT_6328_REG(0);
 		irq_mask_addr[0] += PERF_IRQMASK_6328_REG(0);
 		irq_stat_addr[1] += PERF_IRQSTAT_6328_REG(1);
-		irq_stat_addr[1] += PERF_IRQMASK_6328_REG(1);
+		irq_mask_addr[1] += PERF_IRQMASK_6328_REG(1);
 		irq_bits = 64;
 		ext_irq_count = 4;
 		is_ext_irq_cascaded = 1;


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

* [PATCH 5/7] wusb: delete double assignment
  2014-08-23 18:33 ` Julia Lawall
@ 2014-08-23 18:33   ` Julia Lawall
  -1 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: joe, kernel-janitors, linux-usb, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Delete successive assignments to the same location.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
The patches in this series do not depend on each other.

 drivers/usb/wusbcore/crypto.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/wusbcore/crypto.c b/drivers/usb/wusbcore/crypto.c
index 9a95b2d..50ce80d 100644
--- a/drivers/usb/wusbcore/crypto.c
+++ b/drivers/usb/wusbcore/crypto.c
@@ -222,8 +222,6 @@ static int wusb_ccm_mac(struct crypto_blkcipher *tfm_cbc,
 	WARN_ON(sizeof(ax) != sizeof(struct aes_ccm_block));
 
 	result = -ENOMEM;
-	zero_padding = sizeof(struct aes_ccm_block)
-		- blen % sizeof(struct aes_ccm_block);
 	zero_padding = blen % sizeof(struct aes_ccm_block);
 	if (zero_padding)
 		zero_padding = sizeof(struct aes_ccm_block) - zero_padding;


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

* [PATCH 5/7] wusb: delete double assignment
@ 2014-08-23 18:33   ` Julia Lawall
  0 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: joe, kernel-janitors, linux-usb, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Delete successive assignments to the same location.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
The patches in this series do not depend on each other.

 drivers/usb/wusbcore/crypto.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/wusbcore/crypto.c b/drivers/usb/wusbcore/crypto.c
index 9a95b2d..50ce80d 100644
--- a/drivers/usb/wusbcore/crypto.c
+++ b/drivers/usb/wusbcore/crypto.c
@@ -222,8 +222,6 @@ static int wusb_ccm_mac(struct crypto_blkcipher *tfm_cbc,
 	WARN_ON(sizeof(ax) != sizeof(struct aes_ccm_block));
 
 	result = -ENOMEM;
-	zero_padding = sizeof(struct aes_ccm_block)
-		- blen % sizeof(struct aes_ccm_block);
 	zero_padding = blen % sizeof(struct aes_ccm_block);
 	if (zero_padding)
 		zero_padding = sizeof(struct aes_ccm_block) - zero_padding;


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

* [PATCH 6/7] video: fbdev: sis: delete double assignment
  2014-08-23 18:33 ` Julia Lawall
@ 2014-08-23 18:33   ` Julia Lawall
  -1 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: Thomas Winischhofer
  Cc: joe, kernel-janitors, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen, linux-fbdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Delete successive assignments to the same location.  The second assignment
is changed to update a different field, as done in other nearby code.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
The patches in this series do not depend on each other.

This changes the semantics of the code and is not tested.

 drivers/video/fbdev/sis/init301.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c
index a89e3ca..295e0de 100644
--- a/drivers/video/fbdev/sis/init301.c
+++ b/drivers/video/fbdev/sis/init301.c
@@ -1714,7 +1714,7 @@ SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned sh
 			       SiS_Pr->PanelVCLKIdx315 = VCLK81_315; /* ? */
 			    } else {
 			       SiS_Pr->PanelHT   = 1688; SiS_Pr->PanelVT   =  802;
-			       SiS_Pr->PanelHRS  =   48; SiS_Pr->PanelHRS  =  112;
+			       SiS_Pr->PanelHRS  =   48; SiS_Pr->PanelHRE  =  112;
 			       SiS_Pr->PanelVRS  =    3; SiS_Pr->PanelVRE  =    6;
 			       SiS_Pr->PanelVCLKIdx300 = VCLK81_300;
 			       SiS_Pr->PanelVCLKIdx315 = VCLK81_315;


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

* [PATCH 6/7] video: fbdev: sis: delete double assignment
@ 2014-08-23 18:33   ` Julia Lawall
  0 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: Thomas Winischhofer
  Cc: joe, kernel-janitors, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen, linux-fbdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Delete successive assignments to the same location.  The second assignment
is changed to update a different field, as done in other nearby code.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
The patches in this series do not depend on each other.

This changes the semantics of the code and is not tested.

 drivers/video/fbdev/sis/init301.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c
index a89e3ca..295e0de 100644
--- a/drivers/video/fbdev/sis/init301.c
+++ b/drivers/video/fbdev/sis/init301.c
@@ -1714,7 +1714,7 @@ SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned sh
 			       SiS_Pr->PanelVCLKIdx315 = VCLK81_315; /* ? */
 			    } else {
 			       SiS_Pr->PanelHT   = 1688; SiS_Pr->PanelVT   =  802;
-			       SiS_Pr->PanelHRS  =   48; SiS_Pr->PanelHRS  =  112;
+			       SiS_Pr->PanelHRS  =   48; SiS_Pr->PanelHRE  =  112;
 			       SiS_Pr->PanelVRS  =    3; SiS_Pr->PanelVRE  =    6;
 			       SiS_Pr->PanelVCLKIdx300 = VCLK81_300;
 			       SiS_Pr->PanelVCLKIdx315 = VCLK81_315;


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

* [PATCH 7/7] MIPS: Alchemy: au1200fb: delete double assignment
  2014-08-23 18:33 ` Julia Lawall
@ 2014-08-23 18:33   ` Julia Lawall
  -1 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard
  Cc: joe, kernel-janitors, Tomi Valkeinen, linux-fbdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Delete successive assignments to the same location.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
The patches in this series do not depend on each other.

Not compiled.

 drivers/video/fbdev/au1200fb.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c
index 40494db..18600d4 100644
--- a/drivers/video/fbdev/au1200fb.c
+++ b/drivers/video/fbdev/au1200fb.c
@@ -1254,7 +1254,6 @@ static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata)
 			pdata->brightness = 30;
 		}
 		divider = (lcd->pwmdiv & 0x3FFFF) + 1;
-		hi1 = (lcd->pwmhi >> 16) + 1;
 		hi1 = (((pdata->brightness & 0xFF)+1) * divider >> 8);
 		lcd->pwmhi &= 0xFFFF;
 		lcd->pwmhi |= (hi1 << 16);


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

* [PATCH 7/7] MIPS: Alchemy: au1200fb: delete double assignment
@ 2014-08-23 18:33   ` Julia Lawall
  0 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-23 18:33 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard
  Cc: joe, kernel-janitors, Tomi Valkeinen, linux-fbdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Delete successive assignments to the same location.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
The patches in this series do not depend on each other.

Not compiled.

 drivers/video/fbdev/au1200fb.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c
index 40494db..18600d4 100644
--- a/drivers/video/fbdev/au1200fb.c
+++ b/drivers/video/fbdev/au1200fb.c
@@ -1254,7 +1254,6 @@ static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata)
 			pdata->brightness = 30;
 		}
 		divider = (lcd->pwmdiv & 0x3FFFF) + 1;
-		hi1 = (lcd->pwmhi >> 16) + 1;
 		hi1 = (((pdata->brightness & 0xFF)+1) * divider >> 8);
 		lcd->pwmhi &= 0xFFFF;
 		lcd->pwmhi |= (hi1 << 16);


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

* Re: [PATCH 6/7] video: fbdev: sis: delete double assignment
  2014-08-23 18:33   ` Julia Lawall
@ 2014-08-24 18:21     ` Geert Uytterhoeven
  -1 siblings, 0 replies; 30+ messages in thread
From: Geert Uytterhoeven @ 2014-08-24 18:21 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Thomas Winischhofer, Joe Perches, kernel-janitors,
	Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	Linux Fbdev development list, linux-kernel

On Sat, Aug 23, 2014 at 8:33 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> ---
> The patches in this series do not depend on each other.
>
> This changes the semantics of the code and is not tested.

Hence I think you should change the subject of the patch, so it's obvious
some bug is fixed, e.g. "video: fbdev: sis: Fix double assignment".

>  drivers/video/fbdev/sis/init301.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c
> index a89e3ca..295e0de 100644
> --- a/drivers/video/fbdev/sis/init301.c
> +++ b/drivers/video/fbdev/sis/init301.c
> @@ -1714,7 +1714,7 @@ SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned sh
>                                SiS_Pr->PanelVCLKIdx315 = VCLK81_315; /* ? */
>                             } else {
>                                SiS_Pr->PanelHT   = 1688; SiS_Pr->PanelVT   =  802;
> -                              SiS_Pr->PanelHRS  =   48; SiS_Pr->PanelHRS  =  112;
> +                              SiS_Pr->PanelHRS  =   48; SiS_Pr->PanelHRE  =  112;

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 6/7] video: fbdev: sis: delete double assignment
@ 2014-08-24 18:21     ` Geert Uytterhoeven
  0 siblings, 0 replies; 30+ messages in thread
From: Geert Uytterhoeven @ 2014-08-24 18:21 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Thomas Winischhofer, Joe Perches, kernel-janitors,
	Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	Linux Fbdev development list, linux-kernel

On Sat, Aug 23, 2014 at 8:33 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> ---
> The patches in this series do not depend on each other.
>
> This changes the semantics of the code and is not tested.

Hence I think you should change the subject of the patch, so it's obvious
some bug is fixed, e.g. "video: fbdev: sis: Fix double assignment".

>  drivers/video/fbdev/sis/init301.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c
> index a89e3ca..295e0de 100644
> --- a/drivers/video/fbdev/sis/init301.c
> +++ b/drivers/video/fbdev/sis/init301.c
> @@ -1714,7 +1714,7 @@ SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned sh
>                                SiS_Pr->PanelVCLKIdx315 = VCLK81_315; /* ? */
>                             } else {
>                                SiS_Pr->PanelHT   = 1688; SiS_Pr->PanelVT   =  802;
> -                              SiS_Pr->PanelHRS  =   48; SiS_Pr->PanelHRS  =  112;
> +                              SiS_Pr->PanelHRS  =   48; SiS_Pr->PanelHRE  =  112;

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 6/7] video: fbdev: sis: delete double assignment
  2014-08-24 18:21     ` Geert Uytterhoeven
@ 2014-08-24 18:40       ` Julia Lawall
  -1 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-24 18:40 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Julia Lawall, Thomas Winischhofer, Joe Perches, kernel-janitors,
	Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	Linux Fbdev development list, linux-kernel

On Sun, 24 Aug 2014, Geert Uytterhoeven wrote:

> On Sat, Aug 23, 2014 at 8:33 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> > ---
> > The patches in this series do not depend on each other.
> >
> > This changes the semantics of the code and is not tested.
> 
> Hence I think you should change the subject of the patch, so it's obvious
> some bug is fixed, e.g. "video: fbdev: sis: Fix double assignment".

Do you want me to resend this patch with the new subject, or just keep it 
in mind for the future?

thanks,
julia

> 
> >  drivers/video/fbdev/sis/init301.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c
> > index a89e3ca..295e0de 100644
> > --- a/drivers/video/fbdev/sis/init301.c
> > +++ b/drivers/video/fbdev/sis/init301.c
> > @@ -1714,7 +1714,7 @@ SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned sh
> >                                SiS_Pr->PanelVCLKIdx315 = VCLK81_315; /* ? */
> >                             } else {
> >                                SiS_Pr->PanelHT   = 1688; SiS_Pr->PanelVT   =  802;
> > -                              SiS_Pr->PanelHRS  =   48; SiS_Pr->PanelHRS  =  112;
> > +                              SiS_Pr->PanelHRS  =   48; SiS_Pr->PanelHRE  =  112;
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [PATCH 6/7] video: fbdev: sis: delete double assignment
@ 2014-08-24 18:40       ` Julia Lawall
  0 siblings, 0 replies; 30+ messages in thread
From: Julia Lawall @ 2014-08-24 18:40 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Julia Lawall, Thomas Winischhofer, Joe Perches, kernel-janitors,
	Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	Linux Fbdev development list, linux-kernel

On Sun, 24 Aug 2014, Geert Uytterhoeven wrote:

> On Sat, Aug 23, 2014 at 8:33 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> > ---
> > The patches in this series do not depend on each other.
> >
> > This changes the semantics of the code and is not tested.
> 
> Hence I think you should change the subject of the patch, so it's obvious
> some bug is fixed, e.g. "video: fbdev: sis: Fix double assignment".

Do you want me to resend this patch with the new subject, or just keep it 
in mind for the future?

thanks,
julia

> 
> >  drivers/video/fbdev/sis/init301.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c
> > index a89e3ca..295e0de 100644
> > --- a/drivers/video/fbdev/sis/init301.c
> > +++ b/drivers/video/fbdev/sis/init301.c
> > @@ -1714,7 +1714,7 @@ SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned sh
> >                                SiS_Pr->PanelVCLKIdx315 = VCLK81_315; /* ? */
> >                             } else {
> >                                SiS_Pr->PanelHT   = 1688; SiS_Pr->PanelVT   =  802;
> > -                              SiS_Pr->PanelHRS  =   48; SiS_Pr->PanelHRS  =  112;
> > +                              SiS_Pr->PanelHRS  =   48; SiS_Pr->PanelHRE  =  112;
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [PATCH 4/7] MIPS: BCM63xx: delete double assignment
  2014-08-23 18:33   ` Julia Lawall
@ 2014-08-25 11:27     ` Ralf Baechle
  -1 siblings, 0 replies; 30+ messages in thread
From: Ralf Baechle @ 2014-08-25 11:27 UTC (permalink / raw)
  To: Julia Lawall; +Cc: joe, kernel-janitors, linux-mips, linux-kernel

On Sat, Aug 23, 2014 at 08:33:25PM +0200, Julia Lawall wrote:

> Delete successive assignments to the same location.  In each case, the
> duplicated assignment is modified to be in line with other nearby code.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)

Looking good, applied.

Thanks,

  Ralf

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

* Re: [PATCH 4/7] MIPS: BCM63xx: delete double assignment
@ 2014-08-25 11:27     ` Ralf Baechle
  0 siblings, 0 replies; 30+ messages in thread
From: Ralf Baechle @ 2014-08-25 11:27 UTC (permalink / raw)
  To: Julia Lawall; +Cc: joe, kernel-janitors, linux-mips, linux-kernel

On Sat, Aug 23, 2014 at 08:33:25PM +0200, Julia Lawall wrote:

> Delete successive assignments to the same location.  In each case, the
> duplicated assignment is modified to be in line with other nearby code.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)

Looking good, applied.

Thanks,

  Ralf

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

* Re: [PATCH 6/7] video: fbdev: sis: delete double assignment
  2014-08-24 18:40       ` Julia Lawall
@ 2014-08-25 11:36         ` Geert Uytterhoeven
  -1 siblings, 0 replies; 30+ messages in thread
From: Geert Uytterhoeven @ 2014-08-25 11:36 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Thomas Winischhofer, Joe Perches, kernel-janitors,
	Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	Linux Fbdev development list, linux-kernel

Hi Julia,

On Sun, Aug 24, 2014 at 8:40 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>> On Sat, Aug 23, 2014 at 8:33 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
>> > ---
>> > The patches in this series do not depend on each other.
>> >
>> > This changes the semantics of the code and is not tested.
>>
>> Hence I think you should change the subject of the patch, so it's obvious
>> some bug is fixed, e.g. "video: fbdev: sis: Fix double assignment".
>
> Do you want me to resend this patch with the new subject, or just keep it
> in mind for the future?

That's up to the fbdev maintainer.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 6/7] video: fbdev: sis: delete double assignment
@ 2014-08-25 11:36         ` Geert Uytterhoeven
  0 siblings, 0 replies; 30+ messages in thread
From: Geert Uytterhoeven @ 2014-08-25 11:36 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Thomas Winischhofer, Joe Perches, kernel-janitors,
	Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	Linux Fbdev development list, linux-kernel

Hi Julia,

On Sun, Aug 24, 2014 at 8:40 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>> On Sat, Aug 23, 2014 at 8:33 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
>> > ---
>> > The patches in this series do not depend on each other.
>> >
>> > This changes the semantics of the code and is not tested.
>>
>> Hence I think you should change the subject of the patch, so it's obvious
>> some bug is fixed, e.g. "video: fbdev: sis: Fix double assignment".
>
> Do you want me to resend this patch with the new subject, or just keep it
> in mind for the future?

That's up to the fbdev maintainer.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 4/7] MIPS: BCM63xx: delete double assignment
  2014-08-25 11:27     ` Ralf Baechle
@ 2014-08-25 19:09       ` Jonas Gorski
  -1 siblings, 0 replies; 30+ messages in thread
From: Jonas Gorski @ 2014-08-25 19:09 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: Julia Lawall, joe, kernel-janitors, MIPS Mailing List, linux-kernel

On Mon, Aug 25, 2014 at 1:27 PM, Ralf Baechle <ralf@linux-mips.org> wrote:
> On Sat, Aug 23, 2014 at 08:33:25PM +0200, Julia Lawall wrote:
>
>> Delete successive assignments to the same location.  In each case, the
>> duplicated assignment is modified to be in line with other nearby code.
>>
>> A simplified version of the semantic match that finds this problem is as
>> follows: (http://coccinelle.lip6.fr/)
>
> Looking good, applied.

Huh, somehow gmail decided the original emails were spam.

> Thanks,
>
>   Ralf

Also thanks from me for cleaning up behind me! These mistakes were
definitely mine.


Jonas

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

* Re: [PATCH 4/7] MIPS: BCM63xx: delete double assignment
@ 2014-08-25 19:09       ` Jonas Gorski
  0 siblings, 0 replies; 30+ messages in thread
From: Jonas Gorski @ 2014-08-25 19:09 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: Julia Lawall, joe, kernel-janitors, MIPS Mailing List, linux-kernel

On Mon, Aug 25, 2014 at 1:27 PM, Ralf Baechle <ralf@linux-mips.org> wrote:
> On Sat, Aug 23, 2014 at 08:33:25PM +0200, Julia Lawall wrote:
>
>> Delete successive assignments to the same location.  In each case, the
>> duplicated assignment is modified to be in line with other nearby code.
>>
>> A simplified version of the semantic match that finds this problem is as
>> follows: (http://coccinelle.lip6.fr/)
>
> Looking good, applied.

Huh, somehow gmail decided the original emails were spam.

> Thanks,
>
>   Ralf

Also thanks from me for cleaning up behind me! These mistakes were
definitely mine.


Jonas

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

* Re: [PATCH 6/7] video: fbdev: sis: delete double assignment
  2014-08-24 18:21     ` Geert Uytterhoeven
@ 2014-08-26 10:51       ` Tomi Valkeinen
  -1 siblings, 0 replies; 30+ messages in thread
From: Tomi Valkeinen @ 2014-08-26 10:51 UTC (permalink / raw)
  To: Geert Uytterhoeven, Julia Lawall
  Cc: Thomas Winischhofer, Joe Perches, kernel-janitors,
	Jean-Christophe Plagniol-Villard, Linux Fbdev development list,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 665 bytes --]

On 24/08/14 21:21, Geert Uytterhoeven wrote:
> On Sat, Aug 23, 2014 at 8:33 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
>> ---
>> The patches in this series do not depend on each other.
>>
>> This changes the semantics of the code and is not tested.
> 
> Hence I think you should change the subject of the patch, so it's obvious
> some bug is fixed, e.g. "video: fbdev: sis: Fix double assignment".

Well, to me "fix double assignment" sounds the same as "delete double
assignment".

Looking at the code, I think what's done here is "fix 1280x768 panel
timings".

I can apply this and do the change to subject, if nobody complains.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 6/7] video: fbdev: sis: delete double assignment
@ 2014-08-26 10:51       ` Tomi Valkeinen
  0 siblings, 0 replies; 30+ messages in thread
From: Tomi Valkeinen @ 2014-08-26 10:51 UTC (permalink / raw)
  To: Geert Uytterhoeven, Julia Lawall
  Cc: Thomas Winischhofer, Joe Perches, kernel-janitors,
	Jean-Christophe Plagniol-Villard, Linux Fbdev development list,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 665 bytes --]

On 24/08/14 21:21, Geert Uytterhoeven wrote:
> On Sat, Aug 23, 2014 at 8:33 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
>> ---
>> The patches in this series do not depend on each other.
>>
>> This changes the semantics of the code and is not tested.
> 
> Hence I think you should change the subject of the patch, so it's obvious
> some bug is fixed, e.g. "video: fbdev: sis: Fix double assignment".

Well, to me "fix double assignment" sounds the same as "delete double
assignment".

Looking at the code, I think what's done here is "fix 1280x768 panel
timings".

I can apply this and do the change to subject, if nobody complains.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 2/7] video: fbdev: intelfb: delete double assignment
  2014-08-23 18:33   ` Julia Lawall
@ 2014-08-26 10:56     ` Tomi Valkeinen
  -1 siblings, 0 replies; 30+ messages in thread
From: Tomi Valkeinen @ 2014-08-26 10:56 UTC (permalink / raw)
  To: Julia Lawall, Maik Broemme
  Cc: joe, kernel-janitors, Jean-Christophe Plagniol-Villard,
	linux-fbdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1990 bytes --]

On 23/08/14 21:33, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Delete successive assignments to the same location.
> 
> In the second case, = is converted to |=, which looks appropriate based on
> the values involved.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> expression i;
> @@
> 
> *i = ...;
>  i = ...;
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
> The patches in this series do not depend on each other.
> 
> This changes the behavior of the code in the second case and is not tested.

In this patch, as in the sis one, the behavior is changed. The subject
might perhaps be "fix cursor initialization"?

The patch does look like it could cause a regression, though. Anyone
able to test this?

 Tomi

> 
>  drivers/video/fbdev/intelfb/intelfbhw.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/video/fbdev/intelfb/intelfbhw.c b/drivers/video/fbdev/intelfb/intelfbhw.c
> index fbad61d..d31ed4e 100644
> --- a/drivers/video/fbdev/intelfb/intelfbhw.c
> +++ b/drivers/video/fbdev/intelfb/intelfbhw.c
> @@ -1191,7 +1191,6 @@ int intelfbhw_mode_to_hw(struct intelfb_info *dinfo,
>  	vsync_end = vsync_start + var->vsync_len;
>  	vtotal = vsync_end + var->upper_margin;
>  	vblank_start = vactive;
> -	vblank_end = vtotal;
>  	vblank_end = vsync_end + 1;
>  
>  	DBG_MSG("V: act %d, ss %d, se %d, tot %d bs %d, be %d\n",
> @@ -1859,7 +1858,7 @@ void intelfbhw_cursor_init(struct intelfb_info *dinfo)
>  		tmp = INREG(CURSOR_CONTROL);
>  		tmp &= ~(CURSOR_FORMAT_MASK | CURSOR_GAMMA_ENABLE |
>  			 CURSOR_ENABLE | CURSOR_STRIDE_MASK);
> -		tmp = CURSOR_FORMAT_3C;
> +		tmp |= CURSOR_FORMAT_3C;
>  		OUTREG(CURSOR_CONTROL, tmp);
>  		OUTREG(CURSOR_A_BASEADDR, dinfo->cursor.offset << 12);
>  		tmp = (64 << CURSOR_SIZE_H_SHIFT) |
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 2/7] video: fbdev: intelfb: delete double assignment
@ 2014-08-26 10:56     ` Tomi Valkeinen
  0 siblings, 0 replies; 30+ messages in thread
From: Tomi Valkeinen @ 2014-08-26 10:56 UTC (permalink / raw)
  To: Julia Lawall, Maik Broemme
  Cc: joe, kernel-janitors, Jean-Christophe Plagniol-Villard,
	linux-fbdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1990 bytes --]

On 23/08/14 21:33, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Delete successive assignments to the same location.
> 
> In the second case, = is converted to |=, which looks appropriate based on
> the values involved.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> expression i;
> @@
> 
> *i = ...;
>  i = ...;
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
> The patches in this series do not depend on each other.
> 
> This changes the behavior of the code in the second case and is not tested.

In this patch, as in the sis one, the behavior is changed. The subject
might perhaps be "fix cursor initialization"?

The patch does look like it could cause a regression, though. Anyone
able to test this?

 Tomi

> 
>  drivers/video/fbdev/intelfb/intelfbhw.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/video/fbdev/intelfb/intelfbhw.c b/drivers/video/fbdev/intelfb/intelfbhw.c
> index fbad61d..d31ed4e 100644
> --- a/drivers/video/fbdev/intelfb/intelfbhw.c
> +++ b/drivers/video/fbdev/intelfb/intelfbhw.c
> @@ -1191,7 +1191,6 @@ int intelfbhw_mode_to_hw(struct intelfb_info *dinfo,
>  	vsync_end = vsync_start + var->vsync_len;
>  	vtotal = vsync_end + var->upper_margin;
>  	vblank_start = vactive;
> -	vblank_end = vtotal;
>  	vblank_end = vsync_end + 1;
>  
>  	DBG_MSG("V: act %d, ss %d, se %d, tot %d bs %d, be %d\n",
> @@ -1859,7 +1858,7 @@ void intelfbhw_cursor_init(struct intelfb_info *dinfo)
>  		tmp = INREG(CURSOR_CONTROL);
>  		tmp &= ~(CURSOR_FORMAT_MASK | CURSOR_GAMMA_ENABLE |
>  			 CURSOR_ENABLE | CURSOR_STRIDE_MASK);
> -		tmp = CURSOR_FORMAT_3C;
> +		tmp |= CURSOR_FORMAT_3C;
>  		OUTREG(CURSOR_CONTROL, tmp);
>  		OUTREG(CURSOR_A_BASEADDR, dinfo->cursor.offset << 12);
>  		tmp = (64 << CURSOR_SIZE_H_SHIFT) |
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2014-08-26 10:56 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-23 18:33 [PATCH 0/7] delete double assignment Julia Lawall
2014-08-23 18:33 ` Julia Lawall
2014-08-23 18:33 ` [PATCH 1/7] video: fbdev: riva: " Julia Lawall
2014-08-23 18:33   ` Julia Lawall
2014-08-23 18:33 ` [PATCH 2/7] video: fbdev: intelfb: " Julia Lawall
2014-08-23 18:33   ` Julia Lawall
2014-08-26 10:56   ` Tomi Valkeinen
2014-08-26 10:56     ` Tomi Valkeinen
2014-08-23 18:33 ` [PATCH 3/7] serial: vr41xx_siu: " Julia Lawall
2014-08-23 18:33   ` Julia Lawall
2014-08-23 18:33 ` [PATCH 4/7] MIPS: BCM63xx: " Julia Lawall
2014-08-23 18:33   ` Julia Lawall
2014-08-25 11:27   ` Ralf Baechle
2014-08-25 11:27     ` Ralf Baechle
2014-08-25 19:09     ` Jonas Gorski
2014-08-25 19:09       ` Jonas Gorski
2014-08-23 18:33 ` [PATCH 5/7] wusb: " Julia Lawall
2014-08-23 18:33   ` Julia Lawall
2014-08-23 18:33 ` [PATCH 6/7] video: fbdev: sis: " Julia Lawall
2014-08-23 18:33   ` Julia Lawall
2014-08-24 18:21   ` Geert Uytterhoeven
2014-08-24 18:21     ` Geert Uytterhoeven
2014-08-24 18:40     ` Julia Lawall
2014-08-24 18:40       ` Julia Lawall
2014-08-25 11:36       ` Geert Uytterhoeven
2014-08-25 11:36         ` Geert Uytterhoeven
2014-08-26 10:51     ` Tomi Valkeinen
2014-08-26 10:51       ` Tomi Valkeinen
2014-08-23 18:33 ` [PATCH 7/7] MIPS: Alchemy: au1200fb: " Julia Lawall
2014-08-23 18:33   ` 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.