intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Promote make_u64 macro to .h file
@ 2024-02-13 21:05 Michal Wajdeczko
  2024-02-13 21:43 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Michal Wajdeczko @ 2024-02-13 21:05 UTC (permalink / raw)
  To: intel-xe; +Cc: Michal Wajdeczko

We shouldn't hide generic macros inside .c files as this may lead
to unnecessary code duplication if similar functionality is needed
elsewhere.  Promote make_u64 to .h as soon we will want to reuse it.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 drivers/gpu/drm/xe/xe_gt_pagefault.c | 2 --
 drivers/gpu/drm/xe/xe_macros.h       | 8 ++++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_gt_pagefault.c b/drivers/gpu/drm/xe/xe_gt_pagefault.c
index c26e4fcca01e..76a018ec8136 100644
--- a/drivers/gpu/drm/xe/xe_gt_pagefault.c
+++ b/drivers/gpu/drm/xe/xe_gt_pagefault.c
@@ -557,8 +557,6 @@ static int handle_acc(struct xe_gt *gt, struct acc *acc)
 	return ret;
 }
 
-#define make_u64(hi__, low__)  ((u64)(hi__) << 32 | (u64)(low__))
-
 #define ACC_MSG_LEN_DW        4
 
 static bool get_acc(struct acc_queue *acc_queue, struct acc *acc)
diff --git a/drivers/gpu/drm/xe/xe_macros.h b/drivers/gpu/drm/xe/xe_macros.h
index daf56c846d03..b79d775c737e 100644
--- a/drivers/gpu/drm/xe/xe_macros.h
+++ b/drivers/gpu/drm/xe/xe_macros.h
@@ -7,6 +7,7 @@
 #define _XE_MACROS_H_
 
 #include <linux/bug.h>
+#include <linux/types.h>
 
 #define XE_WARN_ON WARN_ON
 
@@ -15,4 +16,11 @@
 			    "Ioctl argument check failed at %s:%d: %s", \
 			    __FILE__, __LINE__, #cond), 1))
 
+/**
+ * make_u64 - make u64 value from two u32 values
+ * @hi__: value representing upper 32 bits
+ * @lo__: value representing lower 32 bits
+ */
+#define make_u64(hi__, low__)  ((u64)(hi__) << 32 | (u64)(low__))
+
 #endif
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-04-10 11:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-13 21:05 [PATCH] drm/xe: Promote make_u64 macro to .h file Michal Wajdeczko
2024-02-13 21:43 ` ✓ CI.Patch_applied: success for " Patchwork
2024-02-13 21:43 ` ✓ CI.checkpatch: " Patchwork
2024-02-13 21:44 ` ✓ CI.KUnit: " Patchwork
2024-02-13 21:55 ` ✓ CI.Build: " Patchwork
2024-02-13 21:56 ` ✗ CI.Hooks: failure " Patchwork
2024-02-13 21:58 ` ✓ CI.checksparse: success " Patchwork
2024-02-13 22:19 ` [PATCH] " Rodrigo Vivi
2024-02-14 13:36   ` Jani Nikula
2024-04-08 12:20     ` Michal Wajdeczko
2024-04-10 11:40       ` Jani Nikula
2024-02-13 22:20 ` ✓ CI.BAT: success for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).