From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 2/2] drm/i915: add bool type checks in PIPE_CONF_CHECK_*
Date: Wed, 29 Nov 2023 14:25:25 -0500 [thread overview]
Message-ID: <ZWeQJR3IarIGJJEG@intel.com> (raw)
In-Reply-To: <20231129173317.1192269-2-jani.nikula@intel.com>
On Wed, Nov 29, 2023 at 07:33:17PM +0200, Jani Nikula wrote:
> Avoid bool/int mismatches in state checker macros.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_display.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index d62cdae7ab6b..7d48bcdd5797 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -4923,6 +4923,8 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
>
> #define PIPE_CONF_CHECK_X(name) do { \
> if (current_config->name != pipe_config->name) { \
> + BUILD_BUG_ON_MSG(__same_type(current_config->name, bool), \
> + __stringify(name) " is bool"); \
> pipe_config_mismatch(fastset, crtc, __stringify(name), \
> "(expected 0x%08x, found 0x%08x)", \
> current_config->name, \
> @@ -4933,6 +4935,8 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
>
> #define PIPE_CONF_CHECK_X_WITH_MASK(name, mask) do { \
> if ((current_config->name & (mask)) != (pipe_config->name & (mask))) { \
> + BUILD_BUG_ON_MSG(__same_type(current_config->name, bool), \
> + __stringify(name) " is bool"); \
> pipe_config_mismatch(fastset, crtc, __stringify(name), \
> "(expected 0x%08x, found 0x%08x)", \
> current_config->name & (mask), \
> @@ -4943,6 +4947,8 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
>
> #define PIPE_CONF_CHECK_I(name) do { \
> if (current_config->name != pipe_config->name) { \
> + BUILD_BUG_ON_MSG(__same_type(current_config->name, bool), \
> + __stringify(name) " is bool"); \
> pipe_config_mismatch(fastset, crtc, __stringify(name), \
> "(expected %i, found %i)", \
> current_config->name, \
> @@ -4953,6 +4959,8 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
>
> #define PIPE_CONF_CHECK_BOOL(name) do { \
> if (current_config->name != pipe_config->name) { \
> + BUILD_BUG_ON_MSG(!__same_type(current_config->name, bool), \
> + __stringify(name) " is not bool"); \
> pipe_config_mismatch(fastset, crtc, __stringify(name), \
> "(expected %s, found %s)", \
> str_yes_no(current_config->name), \
> --
> 2.39.2
>
next prev parent reply other threads:[~2023-11-29 19:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-29 17:33 [Intel-gfx] [PATCH v2 1/2] drm/i915: use PIPE_CONF_CHECK_BOOL() for bool members Jani Nikula
2023-11-29 17:33 ` [Intel-gfx] [PATCH v2 2/2] drm/i915: add bool type checks in PIPE_CONF_CHECK_* Jani Nikula
2023-11-29 19:25 ` Rodrigo Vivi [this message]
2023-11-29 19:23 ` [Intel-gfx] [PATCH v2 1/2] drm/i915: use PIPE_CONF_CHECK_BOOL() for bool members Rodrigo Vivi
2023-12-01 8:49 ` Jani Nikula
2023-11-30 5:01 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [v2,1/2] " Patchwork
2023-12-01 5:58 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=ZWeQJR3IarIGJJEG@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@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.