]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/tidss: dispc: Get rid of FLD_GET
authorMaxime Ripard <mripard@kernel.org>
Wed, 27 Aug 2025 15:12:36 +0000 (17:12 +0200)
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Mon, 1 Sep 2025 07:37:19 +0000 (10:37 +0300)
The FLD_GET function is an equivalent to what FIELD_GET + GENMASK
provide, so let's drop it and switch to the latter.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-5-7689b664cc63@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
drivers/gpu/drm/tidss/tidss_dispc.c

index 43f8078a1effa2b5a09532cb069131dc0cbf3c10..b4ba342ac241a603db447d6c5ae147c981013be2 100644 (file)
@@ -594,13 +594,6 @@ void tidss_disable_oldi(struct tidss_device *tidss, u32 hw_videoport)
  * number. For example 7:0
  */
 
-#define FLD_GET(val, start, end)                                       \
-       ({                                                              \
-               int _end = (end);                                       \
-               u32 _ret_val = ((val) & GENMASK((start), _end)) >> _end; \
-               _ret_val;                                               \
-       })
-
 #define FLD_MOD(orig, val, start, end)                                 \
        ({                                                              \
                int _start = (start), _end = (end);                     \
@@ -610,7 +603,8 @@ void tidss_disable_oldi(struct tidss_device *tidss, u32 hw_videoport)
        })
 
 #define REG_GET(dispc, idx, start, end)                                        \
-       ((u32)FLD_GET(dispc_read((dispc), (idx)), (start), (end)))
+       ((u32)FIELD_GET(GENMASK((start), (end)),                        \
+                       dispc_read((dispc), (idx))))
 
 #define REG_FLD_MOD(dispc, idx, val, start, end)                       \
        ({                                                              \
@@ -622,7 +616,8 @@ void tidss_disable_oldi(struct tidss_device *tidss, u32 hw_videoport)
        })
 
 #define VID_REG_GET(dispc, hw_plane, idx, start, end)                  \
-       ((u32)FLD_GET(dispc_vid_read((dispc), (hw_plane), (idx)), (start), (end)))
+       ((u32)FIELD_GET(GENMASK((start), (end)),                        \
+                       dispc_vid_read((dispc), (hw_plane), (idx))))
 
 #define VID_REG_FLD_MOD(dispc, hw_plane, idx, val, start, end)         \
        ({                                                              \
@@ -635,7 +630,8 @@ void tidss_disable_oldi(struct tidss_device *tidss, u32 hw_videoport)
        })
 
 #define VP_REG_GET(dispc, vp, idx, start, end)                         \
-       ((u32)FLD_GET(dispc_vp_read((dispc), (vp), (idx)), (start), (end)))
+       ((u32)FIELD_GET(GENMASK((start), (end)),                        \
+                       dispc_vp_read((dispc), (vp), (idx))))
 
 #define VP_REG_FLD_MOD(dispc, vp, idx, val, start, end)                        \
        ({                                                              \