Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gyeyoung Baek <gye976@gmail.com>
To: "Lucas De Marchi" <lucas.demarchi@intel.com>,
	"Oded Gabbay" <ogabbay@kernel.org>,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>
Cc: Gyeyoung Baek <gye976@gmail.com>,
	intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] drm/xe: Fix build error for XE_IOCTL_DBG macro
Date: Sun, 27 Oct 2024 13:57:52 +0900	[thread overview]
Message-ID: <20241027045752.10530-1-gye976@gmail.com> (raw)

In the previous code, there is build error.
if CONFIG_DRM_USE_DYNAMIC_DEBUG is set,
'drm_dbg' function is replaced with '__dynamic_func_call_cls',
which is replaced with a do while statement.

The problem is that,
XE_IOCTL_DBG uses this function for conditional expression.

so I fix the expression to be compatible with the do while statement,
by referring to "https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html".

Signed-off-by: Gyeyoung Baek <gye976@gmail.com>
---
 drivers/gpu/drm/xe/xe_macros.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_macros.h b/drivers/gpu/drm/xe/xe_macros.h
index daf56c846d03..58a9d1e33502 100644
--- a/drivers/gpu/drm/xe/xe_macros.h
+++ b/drivers/gpu/drm/xe/xe_macros.h
@@ -11,8 +11,8 @@
 #define XE_WARN_ON WARN_ON
 
 #define XE_IOCTL_DBG(xe, cond) \
-	((cond) && (drm_dbg(&(xe)->drm, \
-			    "Ioctl argument check failed at %s:%d: %s", \
-			    __FILE__, __LINE__, #cond), 1))
+	({drm_dbg(&(xe)->drm, \
+		"Ioctl argument check failed at %s:%d: %s", \
+		__FILE__, __LINE__, #cond); (cond); })
 
 #endif
-- 
2.34.1


             reply	other threads:[~2024-10-28 18:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-27  4:57 Gyeyoung Baek [this message]
2024-10-28 19:19 ` ✓ CI.Patch_applied: success for drm/xe: Fix build error for XE_IOCTL_DBG macro Patchwork
2024-10-28 19:20 ` ✓ CI.checkpatch: " Patchwork
2024-10-28 19:21 ` ✓ CI.KUnit: " Patchwork
2024-10-28 19:32 ` ✓ CI.Build: " Patchwork
2024-10-28 19:35 ` ✓ CI.Hooks: " Patchwork
2024-10-28 19:36 ` ✓ CI.checksparse: " Patchwork
2024-10-28 19:47 ` [PATCH] " Lucas De Marchi
2024-10-29  6:17   ` gyeyoung
2024-10-29  6:19 ` ✓ CI.Patch_applied: success for drm/xe: Fix build error for XE_IOCTL_DBG macro (rev2) Patchwork
2024-10-29  6:19 ` ✓ CI.checkpatch: " Patchwork
2024-10-29  6:20 ` ✓ CI.KUnit: " Patchwork
2024-10-29  6:32 ` ✓ CI.Build: " Patchwork
2024-10-29  6:34 ` ✓ CI.Hooks: " Patchwork
2024-10-29  6:35 ` ✓ CI.checksparse: " 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=20241027045752.10530-1-gye976@gmail.com \
    --to=gye976@gmail.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.demarchi@intel.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=ogabbay@kernel.org \
    --cc=thomas.hellstrom@linux.intel.com \
    --cc=tzimmermann@suse.de \
    /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