video: fbdev: sis: delete double assignment

Started by Julia Lawall on Aug 23, 2014 · 5 messages from 3 authors · Last reply Aug 26, 2014

Subsystems (3)

Maintainers (2)

STALE4464d

open the first message on its own page

Message details and related content
From: Julia Lawall <redacted>

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

---
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;
Message details and related content
On Sat, Aug 23, 2014 at 8:33 PM, Julia Lawall [off-list ref] 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".
quoted hunk
 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
Message details and related content
On Sun, 24 Aug 2014, Geert Uytterhoeven wrote:
On Sat, Aug 23, 2014 at 8:33 PM, Julia Lawall [off-list ref] wrote:
quoted
---
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
quoted
 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
Message details and related content
Hi Julia,

On Sun, Aug 24, 2014 at 8:40 PM, Julia Lawall [off-list ref] wrote:
quoted
On Sat, Aug 23, 2014 at 8:33 PM, Julia Lawall [off-list ref] wrote:
quoted
---
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
Message details and related content
On 24/08/14 21:21, Geert Uytterhoeven wrote:
On Sat, Aug 23, 2014 at 8:33 PM, Julia Lawall [off-list ref] wrote:
quoted
---
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

Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help