[Intel-gfx] [RFC 2/3] drm/i915: Prefer IS_GEN<n> check with bitmask.

Ville Syrjälä ville.syrjala at linux.intel.com
Wed Oct 24 15:15:01 UTC 2018


On Wed, Oct 24, 2018 at 03:54:56PM +0100, Julia Lawall wrote:
> > I wish it would look something more like this:
> >
> > @@
> > identifier old	=~ "^INTEL_GEN$";
> > expression exp;
> > constant gen;
> > fresh identifier new = "IS_GEN" ## gen;
> > @@
> > - old(exp) == gen
> > + new(exp)
> >
> > But coccinelle doesn't seem to accept the constant in the fresh
> > identifier thing.
> 
> I think that the idea was to be sure that there would be no whitespace in
> the middle of the variable name.  But a constant should indeed be fine.  I
> can adjust that, in case it's useful in the future.

I think I had another similar case recently where I also wanted
a constant in there. Ah yes, now I remember. I was trying to
convert "n * 1024" to "SZ_nK" etc.

-- 
Ville Syrjälä
Intel


More information about the Intel-gfx mailing list