Thread (23 messages) flat view 23 messages, 3 authors, 2026-03-05

Re: [PATCH v2 09/13] lib/fonts: Compare font data for equality with font_data_is_equal()

From: Nathan Chancellor <nathan@kernel.org>
Date: 2026-03-05 20:12:32
Also in: dri-devel, lkml

On Thu, Mar 05, 2026 at 10:31:13AM +0100, Thomas Zimmermann wrote:
Thanks for testing. The attached patch fixes the problem for me. Could you
please test?
Yeah, that appears to work for me as well.

Tested-by: Nathan Chancellor <nathan@kernel.org> # build

It seems like the asm/sections.h include can be dropped as well, since
that was only included for is_kernel_rodata() AFAICT.
quoted hunk ↗ jump to hunk
From 8dc48d2e676d1437584794f4df3dd20d08878655 Mon Sep 17 00:00:00 2001
From: Thomas Zimmermann <tzimmermann@suse.de>
Date: Thu, 5 Mar 2026 09:28:28 +0100
Subject: [PATCH] test for internal fonts by refcount

Internal font data is 'static const'. Hence test against the refcount
being zero.
---
 lib/fonts/fonts.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/lib/fonts/fonts.c b/lib/fonts/fonts.c
index 198aae869be2..b73d74b977ec 100644
--- a/lib/fonts/fonts.c
+++ b/lib/fonts/fonts.c
@@ -45,14 +45,11 @@ static struct font_data *to_font_data_struct(font_data_t *fd)
 
 static bool font_data_is_internal(font_data_t *fd)
 {
-	return is_kernel_rodata((unsigned long)fd);
+	return !REFCOUNT(fd); /* internal fonts have no reference counting */
 }
 
 static void font_data_free(font_data_t *fd)
 {
-	if (WARN_ON(font_data_is_internal(fd)))
-		return;
-
 	kfree(to_font_data_struct(fd));
 }
 
-- 
2.53.0
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help