All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <Julia.Lawall@lip6.fr>
To: Maik Broemme <mbroemme@plusserver.de>
Cc: joe@perches.com, kernel-janitors@vger.kernel.org,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/7] video: fbdev: intelfb: delete double assignment
Date: Sat, 23 Aug 2014 20:33:23 +0200	[thread overview]
Message-ID: <1408818808-18850-3-git-send-email-Julia.Lawall@lip6.fr> (raw)
In-Reply-To: <1408818808-18850-1-git-send-email-Julia.Lawall@lip6.fr>

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) |


WARNING: multiple messages have this Message-ID (diff)
From: Julia Lawall <Julia.Lawall@lip6.fr>
To: Maik Broemme <mbroemme@plusserver.de>
Cc: joe@perches.com, kernel-janitors@vger.kernel.org,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/7] video: fbdev: intelfb: delete double assignment
Date: Sat, 23 Aug 2014 18:33:23 +0000	[thread overview]
Message-ID: <1408818808-18850-3-git-send-email-Julia.Lawall@lip6.fr> (raw)
In-Reply-To: <1408818808-18850-1-git-send-email-Julia.Lawall@lip6.fr>

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) |


  parent reply	other threads:[~2014-08-23 18:37 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Julia Lawall [this message]
2014-08-23 18:33   ` [PATCH 2/7] video: fbdev: intelfb: " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1408818808-18850-3-git-send-email-Julia.Lawall@lip6.fr \
    --to=julia.lawall@lip6.fr \
    --cc=joe@perches.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbroemme@plusserver.de \
    --cc=plagnioj@jcrosoft.com \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.