Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [ardb:efi-libstub-guid-conversion 4/4] drivers/firmware/efi/libstub/printk.c:104:12: error: 'const u8 *' (aka 'const unsigned char *') and 'const char *' are not pointers to compatible types
@ 2026-09-05 18:55 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-05 18:55 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git efi-libstub-guid-conversion
head:   5701341f80f05258b56124f47fdde4e10ca3e2aa
commit: 5701341f80f05258b56124f47fdde4e10ca3e2aa [4/4] efi/libstub: Factor out utf8-to-utf16 conversion from efi_puts()
config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20260906/202609060200.riINTkvQ-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260906/202609060200.riINTkvQ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609060200.riINTkvQ-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/firmware/efi/libstub/printk.c:81:43: error: unknown type name 'efi_char_16_t'; did you mean 'efi_char16_t'?
      81 | size_t efi_utf8_to_utf16(const char *str, efi_char_16_t *buf, size_t lim)
         |                                           ^~~~~~~~~~~~~
         |                                           efi_char16_t
   include/linux/efi.h:50:13: note: 'efi_char16_t' declared here
      50 | typedef u16 efi_char16_t;               /* UNICODE character */
         |             ^
>> drivers/firmware/efi/libstub/printk.c:104:12: error: 'const u8 *' (aka 'const unsigned char *') and 'const char *' are not pointers to compatible types
     104 |         return s8 - str;
         |                ~~ ^ ~~~
   drivers/firmware/efi/libstub/printk.c:81:8: warning: no previous prototype for function 'efi_utf8_to_utf16' [-Wmissing-prototypes]
      81 | size_t efi_utf8_to_utf16(const char *str, efi_char_16_t *buf, size_t lim)
         |        ^
   drivers/firmware/efi/libstub/printk.c:81:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
      81 | size_t efi_utf8_to_utf16(const char *str, efi_char_16_t *buf, size_t lim)
         | ^
         | static 
   1 warning and 2 errors generated.


vim +104 drivers/firmware/efi/libstub/printk.c

    70	
    71	/**
    72	 * efi_str_to_utf16 - Convert a UTF-8 string to UTF-16
    73	 * @str:	UTF-8 encoded string
    74	 * @buf:	The buffer to store the converted UTF-16
    75	 * @lim:	The size of the buffer in UTF-16 characters
    76	 *
    77	 * Converts as many UTF-8 characters as will fit into the buffer,
    78	 * and terminates it with a NULL wchar. Returns the number of bytes
    79	 * consumed from the input string.
    80	 */
    81	size_t efi_utf8_to_utf16(const char *str, efi_char_16_t *buf, size_t lim)
    82	{
    83		const u8 *s8 = (const u8 *)str;
    84		size_t pos = 0;
    85		u32 c32;
    86	
    87		while (*s8 && pos + 2 < lim) {
    88			if (*s8 == '\n')
    89				buf[pos++] = L'\r';
    90			c32 = utf8_to_utf32(&s8);
    91			if (c32 < 0x10000) {
    92				/* Characters in plane 0 use a single word. */
    93				buf[pos++] = c32;
    94			} else {
    95				/*
    96				 * Characters in other planes encode into a surrogate
    97				 * pair.
    98				 */
    99				buf[pos++] = (0xd800 - (0x10000 >> 10)) + (c32 >> 10);
   100				buf[pos++] = 0xdc00 + (c32 & 0x3ff);
   101			}
   102		}
   103		buf[pos] = L'\0';
 > 104		return s8 - str;
   105	}
   106	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-05 18:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-05 18:55 [ardb:efi-libstub-guid-conversion 4/4] drivers/firmware/efi/libstub/printk.c:104:12: error: 'const u8 *' (aka 'const unsigned char *') and 'const char *' are not pointers to compatible types kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox