From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [RFC 3/3] drm/i915: Kill GEN_FOREVER
Date: Tue, 23 Oct 2018 16:36:20 -0700 [thread overview]
Message-ID: <20181023233620.10159-3-rodrigo.vivi@intel.com> (raw)
In-Reply-To: <20181023233620.10159-1-rodrigo.vivi@intel.com>
commit ac657f6461e5 ("drm/i915: Introduce IS_GEN macro") introduced
GEN_FOREVER that was never used.
My first attempt was to rename it to FOREVER since GEN is
already part of the macro. Then I used coccinelle to change all
-INTEL_GEN(e1) >= e2
+INTEL_GEN_RANGE(e1, e2, FOREVER)
-INTEL_GEN(e1) <= e2
+INTEL_GEN_RANGE(e1, 0, e2)
and I liked it.
However I didn't like very much the remaining
INTEL_GEN(dev_priv) < n
and:
INTEL_GEN(e1) < n
INTEL_GEN_RANGE(e1, 0, n - 1)
didn't make much sense either.
So INTEL_GEN use for > or < seems a better unified way for unlimited
bounds. So, no reason to keep GEN_FOREVER here.
Let's kill before someone start using it.
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/i915/i915_drv.h | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index f766bb1e873b..24f17e711772 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2373,14 +2373,10 @@ intel_info(const struct drm_i915_private *dev_priv)
#define REVID_FOREVER 0xff
#define INTEL_REVID(dev_priv) ((dev_priv)->drm.pdev->revision)
-#define GEN_FOREVER (0)
-
#define INTEL_GEN_MASK(s, e) ( \
BUILD_BUG_ON_ZERO(!__builtin_constant_p(s)) + \
BUILD_BUG_ON_ZERO(!__builtin_constant_p(e)) + \
- GENMASK((e) != GEN_FOREVER ? (e) - 1 : BITS_PER_LONG - 1, \
- (s) != GEN_FOREVER ? (s) - 1 : 0) \
-)
+ GENMASK((e) - 1, (s) - 1))
/*
* Returns true if Gen is in inclusive range [Start, End].
--
2.19.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-10-23 23:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-23 23:36 [RFC 1/3] drm/i915: Rename IS_GEN to IS_GEN_RANGE Rodrigo Vivi
2018-10-23 23:36 ` [RFC 2/3] drm/i915: Prefer IS_GEN<n> check with bitmask Rodrigo Vivi
2018-10-24 10:22 ` Ville Syrjälä
2018-10-24 14:54 ` Julia Lawall
2018-10-24 15:15 ` Ville Syrjälä
2018-10-24 23:41 ` Rodrigo Vivi
2018-10-25 10:59 ` Ville Syrjälä
2018-10-25 11:11 ` Julia Lawall
2018-10-26 19:40 ` Rodrigo Vivi
2018-10-26 19:47 ` Julia Lawall
2018-10-26 19:55 ` Rodrigo Vivi
2018-10-23 23:36 ` Rodrigo Vivi [this message]
2018-10-24 12:31 ` [RFC 3/3] drm/i915: Kill GEN_FOREVER Daniel Vetter
2018-10-23 23:50 ` ✗ Fi.CI.SPARSE: warning for series starting with [RFC,1/3] drm/i915: Rename IS_GEN to IS_GEN_RANGE Patchwork
2018-10-24 0:07 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-24 4:50 ` ✓ Fi.CI.IGT: " Patchwork
2018-10-29 10:19 ` [RFC 1/3] " Jani Nikula
2018-10-29 17:52 ` Rodrigo Vivi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181023233620.10159-3-rodrigo.vivi@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox