[PATCH] drm/panthor: fix building without CONFIG_DEBUG_FS

Arnd Bergmann arnd at arndb.de
Thu Apr 24 12:10:16 UTC 2025


On Thu, Apr 24, 2025, at 13:41, Boris Brezillon wrote:
> On Thu, 24 Apr 2025 13:25:47 +0200
>> +#ifdef CONFIG_DEBUG_FS
>>  	bo->debugfs.flags = usage_flags | PANTHOR_DEBUGFS_GEM_USAGE_FLAG_INITIALIZED;
>> -}
>> -
>> -#else
>> -void panthor_gem_debugfs_set_usage_flags(struct panthor_gem_object *bo, u32 usage_flags) {};
>>  #endif
>> +}
>>  
>
> Oops. I actually don't see a good reason to expose this function, so
> could we go for something like that instead?

I think moving it into pantor_gem.c makes sense, and it certainly
avoids the build warning.

>  #else
>  static void panthor_gem_debugfs_bo_add(struct panthor_device *ptdev,
>                                        struct panthor_gem_object *bo)
>  {}
>  static void panthor_gem_debugfs_bo_rm(struct panthor_gem_object *bo) {}
> +static void panthor_gem_debugfs_set_usage_flags(struct 
> panthor_gem_object *bo,
> +                                               u32 usage_flags)
> +{

Side note: I think the panthor_gem_debugfs_bo_{add,rm} stubs could
actually be replaced with an IS_ENABLED() check in the normal
functions, but that wouldn't work for
panthor_gem_debugfs_set_usage_flags or
panthor_gem_debugfs_print_bos().

    Arnd


More information about the dri-devel mailing list