]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/i915/display: hide global state iterators, remove unused
authorJani Nikula <jani.nikula@intel.com>
Thu, 31 Jul 2025 09:19:20 +0000 (12:19 +0300)
committerJani Nikula <jani.nikula@intel.com>
Wed, 6 Aug 2025 08:51:18 +0000 (11:51 +0300)
for_each_{new,old,oldnew}_global_obj_in_state() are only used within
intel_global_state.c, hide them there. intel_for_each_global_obj() is
unused, remove it.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/a23212d9298423d8971d6ad62f961386f7f927cc.1753953530.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_global_state.c
drivers/gpu/drm/i915/display/intel_global_state.h

index 000a898c94805b39700bf6a92ebe8f2db6d2c134..3df55ab353f2f9ecbcea0ccef95e56bbbc15d178 100644 (file)
 #include "intel_display_types.h"
 #include "intel_global_state.h"
 
+#define for_each_new_global_obj_in_state(__state, obj, new_obj_state, __i) \
+       for ((__i) = 0; \
+            (__i) < (__state)->num_global_objs && \
+                    ((obj) = (__state)->global_objs[__i].ptr, \
+                     (new_obj_state) = (__state)->global_objs[__i].new_state, 1); \
+            (__i)++) \
+               for_each_if(obj)
+
+#define for_each_old_global_obj_in_state(__state, obj, old_obj_state, __i) \
+       for ((__i) = 0; \
+            (__i) < (__state)->num_global_objs && \
+                    ((obj) = (__state)->global_objs[__i].ptr, \
+                     (old_obj_state) = (__state)->global_objs[__i].old_state, 1); \
+            (__i)++) \
+               for_each_if(obj)
+
+#define for_each_oldnew_global_obj_in_state(__state, obj, old_obj_state, new_obj_state, __i) \
+       for ((__i) = 0; \
+            (__i) < (__state)->num_global_objs && \
+                    ((obj) = (__state)->global_objs[__i].ptr, \
+                     (old_obj_state) = (__state)->global_objs[__i].old_state, \
+                     (new_obj_state) = (__state)->global_objs[__i].new_state, 1); \
+            (__i)++) \
+               for_each_if(obj)
+
 struct intel_global_commit {
        struct kref ref;
        struct completion done;
index d42fb2547ee94295a2d247f4961d6c82a6931726..e24fea1c9dbc78fa098442f97cb12aa0ba66acbb 100644 (file)
@@ -26,34 +26,6 @@ struct intel_global_obj {
        const struct intel_global_state_funcs *funcs;
 };
 
-#define intel_for_each_global_obj(obj, dev_priv) \
-       list_for_each_entry(obj, &(dev_priv)->display.global.obj_list, head)
-
-#define for_each_new_global_obj_in_state(__state, obj, new_obj_state, __i) \
-       for ((__i) = 0; \
-            (__i) < (__state)->num_global_objs && \
-                    ((obj) = (__state)->global_objs[__i].ptr, \
-                     (new_obj_state) = (__state)->global_objs[__i].new_state, 1); \
-            (__i)++) \
-               for_each_if(obj)
-
-#define for_each_old_global_obj_in_state(__state, obj, old_obj_state, __i) \
-       for ((__i) = 0; \
-            (__i) < (__state)->num_global_objs && \
-                    ((obj) = (__state)->global_objs[__i].ptr, \
-                     (old_obj_state) = (__state)->global_objs[__i].old_state, 1); \
-            (__i)++) \
-               for_each_if(obj)
-
-#define for_each_oldnew_global_obj_in_state(__state, obj, old_obj_state, new_obj_state, __i) \
-       for ((__i) = 0; \
-            (__i) < (__state)->num_global_objs && \
-                    ((obj) = (__state)->global_objs[__i].ptr, \
-                     (old_obj_state) = (__state)->global_objs[__i].old_state, \
-                     (new_obj_state) = (__state)->global_objs[__i].new_state, 1); \
-            (__i)++) \
-               for_each_if(obj)
-
 struct intel_global_commit;
 
 struct intel_global_state {