All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [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
Date: Sun, 06 Sep 2026 02:55:53 +0800	[thread overview]
Message-ID: <202609060200.riINTkvQ-lkp@intel.com> (raw)

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

                 reply	other threads:[~2026-09-05 18:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202609060200.riINTkvQ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ardb@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.