dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [patch 1/2] drivers/gpu/drm/i915: remove duplicate structure field initialization
@ 2010-07-20 22:22 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2010-07-20 22:22 UTC (permalink / raw)
  To: airlied; +Cc: akpm, julia, dri-devel

From: Julia Lawall <julia@diku.dk>

In each case, is_mobile is defined twice to 1.  Drop one initialization.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
identifier I, s, fld;
position p0,p;
expression E;
@@

struct I s =@p0 { ... .fld@p = E, ...};

@s@
identifier I, s, r.fld;
position r.p0,p;
expression E;
@@

struct I s =@p0 { ... .fld@p = E, ...};

@script:python@
p0 << r.p0;
fld << r.fld;
ps << s.p;
pr << r.p;
@@

if int(ps[0].line)<int(pr[0].line) or int(ps[0].column)<int(pr[0].column):
  cocci.print_main(fld,p0)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/gpu/drm/i915/i915_drv.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/gpu/drm/i915/i915_drv.c~drivers-gpu-drm-i915-remove-duplicate-structure-field-initialization drivers/gpu/drm/i915/i915_drv.c
--- a/drivers/gpu/drm/i915/i915_drv.c~drivers-gpu-drm-i915-remove-duplicate-structure-field-initialization
+++ a/drivers/gpu/drm/i915/i915_drv.c
@@ -97,7 +97,7 @@ static const struct intel_device_info in
 };
 
 static const struct intel_device_info intel_i965gm_info = {
-	.is_i965g = 1, .is_mobile = 1, .is_i965gm = 1, .is_i9xx = 1,
+	.is_i965g = 1, .is_i965gm = 1, .is_i9xx = 1,
 	.is_mobile = 1, .has_fbc = 1, .has_rc6 = 1,
 	.has_hotplug = 1,
 };
@@ -114,7 +114,7 @@ static const struct intel_device_info in
 };
 
 static const struct intel_device_info intel_gm45_info = {
-	.is_i965g = 1, .is_mobile = 1, .is_g4x = 1, .is_i9xx = 1,
+	.is_i965g = 1, .is_g4x = 1, .is_i9xx = 1,
 	.is_mobile = 1, .need_gfx_hws = 1, .has_fbc = 1, .has_rc6 = 1,
 	.has_pipe_cxsr = 1,
 	.has_hotplug = 1,
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-07-20 22:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-20 22:22 [patch 1/2] drivers/gpu/drm/i915: remove duplicate structure field initialization akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox