init_defs_builtins: /home/luca/public/coccinelle/standard.h ----------------------------------------------------------------------- processing semantic patch file: /home/luca/dev_priv_i915.spatch with isos from: /home/luca/public/coccinelle/standard.iso ----------------------------------------------------------------------- @macros_noargs@ iterator name with_intel_display_power_if_enabled; iterator name with_intel_display_power; iterator name for_each_power_domain; iterator name with_intel_pps_lock; iterator name for_each_pipe; iterator name for_each_intel_encoder; //iterator name for_each_engine; iterator name for_each_engine_masked; iterator name for_each_if; iterator name for_each_engine; iterator name for_each_engine_masked; iterator name for_each_uabi_engine; iterator name for_each_uabi_class_engine; iterator name __for_each_sgt_daddr; iterator name for_each_sgt_page; iterator name priolist_for_each_request; iterator name priolist_for_each_request_consume; iterator name for_each_waiter; iterator name for_each_signaler; iterator name for_each_until; iterator name for_each_ggtt_vma; iterator name for_each_memory_region; iterator name for_each_fw_domain_masked; iterator name for_each_fw_domain; identifier m; expression e =~ "dev_priv"; @@ #define m <+...e...+> @nested_macros@ identifier macros_noargs.m; identifier nm; identifier list il; @@ #define nm(il) <+...m...+> @@ identifier nested_macros.nm; identifier dev_priv, f; expression list el; @@ f(...) { ... struct drm_i915_private *dev_priv = ...; <+... nm( + dev_priv, el) ...+> } @@ identifier nested_macros.nm; identifier dev_priv, f; expression list el; @@ f(..., struct drm_i915_private *dev_priv, ...) { <+... nm( + dev_priv, el) ...+> } ----------------------------------------------------------------------- let's go ----------------------------------------------------------------------- ----------------------------------------------------------------------- ----------------------------------------------------------------------- macros_noargs = ----------------------------------------------------------------------- binding in = [] binding relevant in = [] ----------------------------------------------------------------------- nested_macros = ----------------------------------------------------------------------- binding in = [] binding relevant in = [] ----------------------------------------------------------------------- rule starting on line 42 = ----------------------------------------------------------------------- binding in = [] binding relevant in = [] ----------------------------------------------------------------------- rule starting on line 58 = ----------------------------------------------------------------------- binding in = [] binding relevant in = [] ----------------------------------------------------------------------- Finished ----------------------------------------------------------------------- HANDLING: ./drivers/gpu/drm/i915/display/intel_display_power.c remapping: for_each_engine to an ident in macro name remapping: for_each_engine_masked to an ident in macro name remapping: for_each_uabi_engine to an ident in macro name remapping: for_each_uabi_class_engine to an ident in macro name ERROR-RECOV: found sync end of #define, line 388 parsing pass2: try again ERROR-RECOV: found sync end of #define, line 388 parse error = File "./drivers/gpu/drm/i915/i915_drv.h", line 385, column 1, charpos = 9644 around = 'for', whole content = for ((id__) = 0; \ badcount: 7 bad: } bad: bad: /* Simple iterator over all initialised engines */ bad: #define for_each_engine(engine__, dev_priv__, id__) \ BAD:!!!!! for ((id__) = 0; \ bad: (id__) < I915_NUM_ENGINES; \ bad: (id__)++) \ bad: for_each_if ((engine__) = (dev_priv__)->engine[(id__)]) ERROR-RECOV: found sync end of #define, line 395 parsing pass2: try again ERROR-RECOV: found sync end of #define, line 395 parse error = File "./drivers/gpu/drm/i915/i915_drv.h", line 392, column 1, charpos = 9895 around = 'for', whole content = for ((tmp__) = (mask__) & (gt__)->info.engine_mask; \ badcount: 7 bad: for_each_if ((engine__) = (dev_priv__)->engine[(id__)]) bad: bad: /* Iterator over subset of engines selected by mask */ bad: #define for_each_engine_masked(engine__, gt__, mask__, tmp__) \ BAD:!!!!! for ((tmp__) = (mask__) & (gt__)->info.engine_mask; \ bad: (tmp__) ? \ bad: ((engine__) = (gt__)->engine[__mask_next_bit(tmp__)]), 1 : \ bad: 0;) ERROR-RECOV: found sync end of #define, line 403 parsing pass2: try again ERROR-RECOV: found sync end of #define, line 403 parse error = File "./drivers/gpu/drm/i915/i915_drv.h", line 401, column 1, charpos = 10182 around = 'for', whole content = for ((engine__) = rb_to_uabi_engine(rb_first(&(i915__)->uabi_engines));\ badcount: 5 bad: rb_entry_safe(rb, struct intel_engine_cs, uabi_node) bad: bad: #define for_each_uabi_engine(engine__, i915__) \ BAD:!!!!! for ((engine__) = rb_to_uabi_engine(rb_first(&(i915__)->uabi_engines));\ bad: (engine__); \ bad: (engine__) = rb_to_uabi_engine(rb_next(&(engine__)->uabi_node))) ERROR-RECOV: found sync end of #define, line 408 parsing pass2: try again ERROR-RECOV: found sync end of #define, line 408 parse error = File "./drivers/gpu/drm/i915/i915_drv.h", line 406, column 1, charpos = 10412 around = 'for', whole content = for ((engine__) = intel_engine_lookup_user((i915__), (class__), 0); \ badcount: 5 bad: (engine__) = rb_to_uabi_engine(rb_next(&(engine__)->uabi_node))) bad: bad: #define for_each_uabi_class_engine(engine__, class__, i915__) \ BAD:!!!!! for ((engine__) = intel_engine_lookup_user((i915__), (class__), 0); \ bad: (engine__) && (engine__)->uabi_class == (class__); \ bad: (engine__) = rb_to_uabi_engine(rb_next(&(engine__)->uabi_node))) ERROR-RECOV: found sync end of #define, line 662 parsing pass2: try again ERROR-RECOV: found sync end of #define, line 662 parse error = File "./drivers/gpu/drm/i915/i915_drv.h", line 662, column 40, charpos = 21985 around = ')', whole content = IS_GRAPHICS_STEP(__i915, since, until)) badcount: 4 bad: IS_GRAPHICS_STEP(__i915, since, until)) bad: bad: #define IS_TGL_GRAPHICS_STEP(__i915, since, until) \ bad: (IS_TIGERLAKE(__i915) && !IS_TGL_UY(__i915)) && \ BAD:!!!!! IS_GRAPHICS_STEP(__i915, since, until)) remapping: for_each_power_domain to an ident in macro name remapping: with_intel_display_power to an ident in macro name remapping: with_intel_display_power_if_enabled to an ident in macro name ERROR-RECOV: found sync end of #define, line 162 parsing pass2: try again ERROR-RECOV: found sync end of #define, line 162 parse error = File "./drivers/gpu/drm/i915/display/intel_display_power.h", line 161, column 1, charpos = 3932 around = 'for', whole content = for ((__domain) = 0; (__domain) < POWER_DOMAIN_NUM; (__domain)++) \ badcount: 4 bad: }; bad: bad: #define for_each_power_domain(__domain, __mask) \ BAD:!!!!! for ((__domain) = 0; (__domain) < POWER_DOMAIN_NUM; (__domain)++) \ bad: for_each_if(test_bit((__domain), (__mask)->bits)) ERROR-RECOV: found sync end of #define, line 282 parsing pass2: try again ERROR-RECOV: found sync end of #define, line 282 parse error = File "./drivers/gpu/drm/i915/display/intel_display_power.h", line 281, column 1, charpos = 8725 around = 'for', whole content = for ((wf) = intel_display_power_get((i915), (domain)); (wf); \ badcount: 4 bad: u8 req_slices); bad: bad: #define with_intel_display_power(i915, domain, wf) \ BAD:!!!!! for ((wf) = intel_display_power_get((i915), (domain)); (wf); \ bad: intel_display_power_put_async((i915), (domain), (wf)), (wf) = 0) ERROR-RECOV: found sync end of #define, line 286 parsing pass2: try again ERROR-RECOV: found sync end of #define, line 286 parse error = File "./drivers/gpu/drm/i915/display/intel_display_power.h", line 285, column 1, charpos = 8925 around = 'for', whole content = for ((wf) = intel_display_power_get_if_enabled((i915), (domain)); (wf); \ badcount: 4 bad: intel_display_power_put_async((i915), (domain), (wf)), (wf) = 0) bad: bad: #define with_intel_display_power_if_enabled(i915, domain, wf) \ BAD:!!!!! for ((wf) = intel_display_power_get_if_enabled((i915), (domain)); (wf); \ bad: intel_display_power_put_async((i915), (domain), (wf)), (wf) = 0) ERROR-RECOV: found sync end of #define, line 20 parsing pass2: try again ERROR-RECOV: found sync end of #define, line 20 parse error = File "./drivers/gpu/drm/i915/display/intel_display_power_well.h", line 20, column 23, charpos = 588 around = '', whole content = (__power_well)++) badcount: 6 bad: struct i915_power_well; bad: bad: #define for_each_power_well(__dev_priv, __power_well) \ bad: for ((__power_well) = (__dev_priv)->display.power.domains.power_wells; \ bad: (__power_well) - (__dev_priv)->display.power.domains.power_wells < \ bad: (__dev_priv)->display.power.domains.power_well_count; \ BAD:!!!!! (__power_well)++) ERROR-RECOV: found sync end of #define, line 26 parsing pass2: try again ERROR-RECOV: found sync end of #define, line 26 parse error = File "./drivers/gpu/drm/i915/display/intel_display_power_well.h", line 26, column 23, charpos = 903 around = '', whole content = (__power_well)--) badcount: 6 bad: (__power_well)++) bad: bad: #define for_each_power_well_reverse(__dev_priv, __power_well) \ bad: for ((__power_well) = (__dev_priv)->display.power.domains.power_wells + \ bad: (__dev_priv)->display.power.domains.power_well_count - 1; \ bad: (__power_well) - (__dev_priv)->display.power.domains.power_wells >= 0; \ BAD:!!!!! (__power_well)--) ERROR-RECOV: found sync end of #define, line 28 parsing pass2: try again ERROR-RECOV: found sync end of #define, line 28 parse error = File "./drivers/gpu/drm/i915/display/intel_display_power.c", line 28, column 2, charpos = 730 around = 'for_each_if', whole content = for_each_if(test_bit((__domain), (__power_well)->domains.bits)) badcount: 4 bad: #include "vlv_sideband.h" bad: bad: #define for_each_power_domain_well(__dev_priv, __power_well, __domain) \ bad: for_each_power_well(__dev_priv, __power_well) \ BAD:!!!!! for_each_if(test_bit((__domain), (__power_well)->domains.bits)) ERROR-RECOV: found sync end of #define, line 32 parsing pass2: try again ERROR-RECOV: found sync end of #define, line 32 parse error = File "./drivers/gpu/drm/i915/display/intel_display_power.c", line 32, column 2, charpos = 944 around = 'for_each_if', whole content = for_each_if(test_bit((__domain), (__power_well)->domains.bits)) badcount: 4 bad: for_each_if(test_bit((__domain), (__power_well)->domains.bits)) bad: bad: #define for_each_power_domain_well_reverse(__dev_priv, __power_well, __domain) \ bad: for_each_power_well_reverse(__dev_priv, __power_well) \ BAD:!!!!! for_each_if(test_bit((__domain), (__power_well)->domains.bits)) dependencies for rule macros_noargs satisfied: dependencies for rule nested_macros satisfied: dependencies for rule rule starting on line 42 satisfied: (ONCE) USING optional_qualifier builtin isomorphism dependencies for rule rule starting on line 58 satisfied: (ONCE) USING optional_storage builtin isomorphism Check duplication for 20 files