Re: [PATCH 2/5] drm/i915: replace IS_GEN<N> with IS_GEN(..., N)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 01, 2018 at 01:17:07PM +0200, Jani Nikula wrote:
> On Thu, 01 Nov 2018, Lucas De Marchi <lucas.demarchi@xxxxxxxxx> wrote:
> > Now that IS_GEN can accept 1 or 2 parameters, replace the use
> > of IS_GEN<N> by passing N as argument. This was generated with:
> 
> Ignoring the naming and all the contentious stuff about using the same
> macro for ranges and single gen, I think there's a useful discussion to
> be had here about defining IS_GEN<N> macros for every new generation
> vs. passing the gen to a macro.
> 
> I do prefer one IS_GEN(i915, N) over N instances of IS_GEN<N>(i915).

#define _IS_GEN(n) \
static inline bool IS_GEN ## n (... i915) { return IS_GEN(i915, n); }

_IS_GEN(2)
_IS_GEN(3)
...

I guess that's not much better apart from making typos harder to make.

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux