On Mon, 07 Sep 2026, Albert Esteve <[email protected]> wrote:
> This helper was originally static inline. INLINE_IFN_KUNIT only added
> inline for KUnit builds, which dropped that hint from production.
>
> There is no equivalent in kunit/visibility.h, and tests do not need
> one: they call the exported symbol from another translation unit.
> Use an unconditional inline with VISIBLE_IF_KUNIT instead so
> production stays static inline.

FWIW, using inline in a .c file is pointless in most cases, and the
compiler usually does the right thing. It might inline at a better
granularity than the manual one. (You could see what difference having
the inline makes, if any.)

BR,
Jani.


>
> kernel-doc already strips inline, so the dedicated xform can go too.
>
> Signed-off-by: Albert Esteve <[email protected]>
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 2 +-
>  drivers/gpu/drm/amd/display/dc/dm_helpers.h             | 7 -------
>  tools/lib/python/kdoc/xforms_lists.py                   | 1 -
>  3 files changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> index e3f4ee6e8380..eea7e7dcfa30 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> @@ -173,7 +173,7 @@ void amdgpu_dm_init_color_mod(void)
>  }
>  EXPORT_SYMBOL_IF_KUNIT(amdgpu_dm_init_color_mod);
>  
> -VISIBLE_IF_KUNIT INLINE_IFN_KUNIT
> +VISIBLE_IF_KUNIT inline
>  struct fixed31_32 amdgpu_dm_fixpt_from_s3132(__u64 x)
>  {
>       struct fixed31_32 val;
> diff --git a/drivers/gpu/drm/amd/display/dc/dm_helpers.h 
> b/drivers/gpu/drm/amd/display/dc/dm_helpers.h
> index 6d7cdab1006f..cabcbc2599e6 100644
> --- a/drivers/gpu/drm/amd/display/dc/dm_helpers.h
> +++ b/drivers/gpu/drm/amd/display/dc/dm_helpers.h
> @@ -194,13 +194,6 @@ void dm_helpers_mccs_vcp_set(
>               struct dc_link *link,
>               struct dc_sink *sink);
>  
> -#if IS_ENABLED(CONFIG_DRM_AMD_DC_KUNIT_TEST)
> -#define INLINE_IFN_KUNIT inline
> -
> -#else
> -#define INLINE_IFN_KUNIT
> -#endif
> -
>  bool dm_helpers_submit_i2c_over_aux(
>       struct ddc_service *ddc,
>       uint32_t address,
> diff --git a/tools/lib/python/kdoc/xforms_lists.py 
> b/tools/lib/python/kdoc/xforms_lists.py
> index b49b81da74d9..cab4a49e4fc4 100644
> --- a/tools/lib/python/kdoc/xforms_lists.py
> +++ b/tools/lib/python/kdoc/xforms_lists.py
> @@ -105,7 +105,6 @@ class CTransforms:
>          (CMatch("__attribute_const__"), ""),
>          (CMatch("__attribute__"), ""),
>          (CMatch("VISIBLE_IF_KUNIT"), ""),
> -        (CMatch("INLINE_IFN_KUNIT"), ""),
>  
>          #
>          # HACK: this is similar to process_export() hack. It is meant to

-- 
Jani Nikula, Intel

Reply via email to