(__i)++)                                                           \
                for_each_if ((__state)->connectors[__i].ptr &&                  \
                             ((connector) = (__state)->connectors[__i].ptr,     \
+                            (void)(connector) /* Only to avoid unused-but-set-variable warning */, \
                             (old_connector_state) = (__state)->connectors[__i].old_state,      \
                             (new_connector_state) = (__state)->connectors[__i].new_state, 1))
 
             (__i)++)                                                           \
                for_each_if ((__state)->connectors[__i].ptr &&                  \
                             ((connector) = (__state)->connectors[__i].ptr,     \
+                            (void)(connector) /* Only to avoid unused-but-set-variable warning */, \
                             (old_connector_state) = (__state)->connectors[__i].old_state, 1))
 
 /**
             (__i)++)                                                           \
                for_each_if ((__state)->connectors[__i].ptr &&                  \
                             ((connector) = (__state)->connectors[__i].ptr,     \
-                            (new_connector_state) = (__state)->connectors[__i].new_state, 1))
+                            (void)(connector) /* Only to avoid unused-but-set-variable warning */, \
+                            (new_connector_state) = (__state)->connectors[__i].new_state, \
+                            (void)(new_connector_state) /* Only to avoid unused-but-set-variable warning */, 1))
 
 /**
  * for_each_oldnew_crtc_in_state - iterate over all CRTCs in an atomic update
             (__i)++)                                                   \
                for_each_if ((__state)->crtcs[__i].ptr &&               \
                             ((crtc) = (__state)->crtcs[__i].ptr,       \
+                             (void)(crtc) /* Only to avoid unused-but-set-variable warning */, \
                             (old_crtc_state) = (__state)->crtcs[__i].old_state, \
+                            (void)(old_crtc_state) /* Only to avoid unused-but-set-variable warning */, \
                             (new_crtc_state) = (__state)->crtcs[__i].new_state, 1))
 
 /**
             (__i)++)                                                   \
                for_each_if ((__state)->crtcs[__i].ptr &&               \
                             ((crtc) = (__state)->crtcs[__i].ptr,       \
-                            (new_crtc_state) = (__state)->crtcs[__i].new_state, 1))
+                            (void)(crtc) /* Only to avoid unused-but-set-variable warning */, \
+                            (new_crtc_state) = (__state)->crtcs[__i].new_state, \
+                            (void)(new_crtc_state) /* Only to avoid unused-but-set-variable warning */, 1))
 
 /**
  * for_each_oldnew_plane_in_state - iterate over all planes in an atomic update
             (__i)++)                                                   \
                for_each_if ((__state)->planes[__i].ptr &&              \
                             ((plane) = (__state)->planes[__i].ptr,     \
+                             (void)(plane) /* Only to avoid unused-but-set-variable warning */, \
                              (old_plane_state) = (__state)->planes[__i].old_state,\
                              (new_plane_state) = (__state)->planes[__i].new_state, 1))
 
             (__i)++)                                                   \
                for_each_if ((__state)->planes[__i].ptr &&              \
                             ((plane) = (__state)->planes[__i].ptr,     \
-                             (new_plane_state) = (__state)->planes[__i].new_state, 1))
+                             (void)(plane) /* Only to avoid unused-but-set-variable warning */, \
+                             (new_plane_state) = (__state)->planes[__i].new_state, \
+                             (void)(new_plane_state) /* Only to avoid unused-but-set-variable warning */, 1))
 
 /**
  * for_each_oldnew_private_obj_in_state - iterate over all private objects in an atomic update