All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 5/5] drm/i915: Warn on obsolete revision checks
Date: Fri, 08 Jun 2018 14:51:26 +0100	[thread overview]
Message-ID: <152846588669.1522.853599793482624688@mail.alporthouse.com> (raw)
In-Reply-To: <20180608134205.6452-5-mika.kuoppala@linux.intel.com>

Quoting Mika Kuoppala (2018-06-08 14:42:05)
> If we are doing revision checks against a preproduction
> range, when there is already a product, it is a sign
> that there is code to be removed.
> 
> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_chipset.h | 30 +++++++++++++++++++++-------
>  1 file changed, 23 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_chipset.h b/drivers/gpu/drm/i915/intel_chipset.h
> index 946c889c0118..bc9ff02dc8df 100644
> --- a/drivers/gpu/drm/i915/intel_chipset.h
> +++ b/drivers/gpu/drm/i915/intel_chipset.h
> @@ -131,6 +131,12 @@
>  #define IS_PREPRODUCTION_HW(dev_priv)   (INTEL_REVID(dev_priv) < FIRST_PRODUCT_REVID(INTEL_INFO(dev_priv)))
>  #define IS_PLATFORM_SUPPORT_ALPHA(intel_info) (FIRST_PRODUCT_REVID(intel_info) == PRODUCT_REVID_UNKNOWN)
>  
> +#define BUILD_BUG_ON_REVID_LT(revid, production_revid) ({ \

BUILD_BUG_ON_PREPRODUCTION()

It doesn't look that general, or widely useful to say REVID_LT. Sort of
implies we will have REVID_GTE etc later.

> +               BUILD_BUG_ON((production_revid) != PRODUCT_REVID_UNKNOWN && \
> +                            (revid) < (production_revid)); \

I'd prefer (!BUILD_BUG_ON_ZERO()) (Or push the
!BUILD_BUG_ON_PREPRODUCTION to the caller as that's easier to read).

That avoids the ({block}) making it less likely to cause problems.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-06-08 13:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-08 13:42 [PATCH 1/5] drm/i915: Move chipset definitions to intel_chipset.h Mika Kuoppala
2018-06-08 13:42 ` [PATCH 2/5] drm/i915: Store first production revid into device info Mika Kuoppala
2018-06-08 14:30   ` Chris Wilson
2018-06-08 13:42 ` [PATCH 3/5] drm/i915: Use unknown production revid as alpha quality flag Mika Kuoppala
2018-06-08 13:53   ` Chris Wilson
2018-06-11 11:23   ` Joonas Lahtinen
2018-06-11 12:22     ` Jani Nikula
2018-06-08 13:42 ` [PATCH 4/5] drm/i915: Remove kbl preproduction workarounds Mika Kuoppala
2018-06-08 13:52   ` Chris Wilson
2018-06-08 13:42 ` [PATCH 5/5] drm/i915: Warn on obsolete revision checks Mika Kuoppala
2018-06-08 13:51   ` Chris Wilson [this message]
2018-06-11 12:26   ` Jani Nikula
2018-06-08 13:56 ` [PATCH 1/5] drm/i915: Move chipset definitions to intel_chipset.h Chris Wilson
2018-06-08 14:06 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/5] " Patchwork
2018-06-08 14:08 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-06-08 14:26 ` ✓ Fi.CI.BAT: success " Patchwork
2018-06-08 15:04 ` [PATCH 1/5] " Michal Wajdeczko
2018-06-11  8:35   ` Tvrtko Ursulin
2018-06-08 17:56 ` ✓ Fi.CI.IGT: success for series starting with [1/5] " Patchwork

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=152846588669.1522.853599793482624688@mail.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.