# Re: \[PATCH v2 09/13\] lib/fonts: Compare font data for equality with font\_data\_is\_equal()

- From: Thomas Zimmermann \<tzimmermann@suse.de\>
- Date: 2026-03-05 09:31:21 
- List: linux-fbdev
- Page: https://ratatoskr.run/linux-fbdev/2026/03/3441750
- Thread: https://ratatoskr.run/linux-fbdev/2026/03/3435599/t.md

```text
Hi

Am 05.03.26 um 01:23 schrieb Nathan Chancellor:
[...]
>>   
>> +static bool font_data_is_internal(font_data_t *fd)
>> +{
>> +	return is_kernel_rodata((unsigned long)fd);
>> +}
>> +
[...]
>>
>> This breaks the build when CONFIG_FONT_SUPPORT is a module.
>>
>>    $ cat allno.config
>>    CONFIG_MODULES=y
>>    CONFIG_DRM=m
>>    CONFIG_DRM_PANIC=y
>>
>>    $ make -skj"$(nproc)" ARCH=x86_64 CROSS_COMPILE=x86_64-linux- KCONFIG_ALLCONFIG=1 allnoconfig all
>>    ERROR: modpost: "__end_rodata" [lib/fonts/font.ko] undefined!
>>    make[4]: *** [scripts/Makefile.modpost:147: Module.symvers] Error 1
>>    ...
>>
>>    $ scripts/config -s FONT_SUPPORT
>>    m

Thanks for testing. The attached patch fixes the problem for me. Could you please test?

Best regards
Thomas

>>
>> Cheers,
>> Nathan
>>
>>
>> +	if (font_data_size(lhs) != font_data_size(rhs))
>> +		return false;
>> +	if (FNTSUM(lhs) && FNTSUM(rhs) && FNTSUM(lhs) != FNTSUM(rhs))
>> +		return false;
>> +
>> +	return !memcmp(lhs, rhs, FNTSIZE(lhs));
>> +}
>> +EXPORT_SYMBOL_GPL(font_data_is_equal);
>> +
>>   /*
>>    * Font lookup
>>    */
>> -- 
>> 2.53.0
>>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)

```

## Attachments

- [0001-test-for-internal-fonts-by-refcount.patch](https://ratatoskr.run/linux-fbdev/2026/03/3441750/attachment/0) (text/x-patch, 927 bytes)
