Skip to contentSkip to conversation

drivers/nvmem/qnap-mcu-eeprom.c:28:15: warning: assignment to 'u8 *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast

PATCH kernel test robot 1 participant 1 message Aug 19, 2025

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/srini/nvmem.git for-next
head:   117c3f3014a929464c01622cb95b566bd27244f8
commit: 117c3f3014a929464c01622cb95b566bd27244f8 [1/1] nvmem: add driver for the eeprom in qnap-mcu controllers
config: um-allyesconfig (https://download.01.org/0day-ci/archive/20250819/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250819/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

In file included from drivers/nvmem/qnap-mcu-eeprom.c:12:
include/linux/mfd/qnap-mcu.h:13:9: error: unknown type name 'u32'

      13 |         u32 baud_rate;
         |         ^~~
   include/linux/mfd/qnap-mcu.h:17:9: error: unknown type name 'bool'
      17 |         bool usb_led;
         |         ^~~~
   include/linux/mfd/qnap-mcu.h:21:25: error: unknown type name 'u8'
      21 |                   const u8 *cmd_data, size_t cmd_data_size,
         |                         ^~
   include/linux/mfd/qnap-mcu.h:21:39: error: unknown type name 'size_t'
      21 |                   const u8 *cmd_data, size_t cmd_data_size,
         |                                       ^~~~~~
   include/linux/mfd/qnap-mcu.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
     +++ |+#include <stddef.h>
       1 | /* SPDX-License-Identifier: GPL-2.0+ */
   include/linux/mfd/qnap-mcu.h:22:19: error: unknown type name 'u8'
      22 |                   u8 *reply_data, size_t reply_data_size);
         |                   ^~
   include/linux/mfd/qnap-mcu.h:22:35: error: unknown type name 'size_t'
      22 |                   u8 *reply_data, size_t reply_data_size);
         |                                   ^~~~~~
   include/linux/mfd/qnap-mcu.h:22:35: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
   include/linux/mfd/qnap-mcu.h:24:34: error: unknown type name 'u8'
      24 |                            const u8 *cmd_data, size_t cmd_data_size);
         |                                  ^~
   include/linux/mfd/qnap-mcu.h:24:48: error: unknown type name 'size_t'
      24 |                            const u8 *cmd_data, size_t cmd_data_size);
         |                                                ^~~~~~
   include/linux/mfd/qnap-mcu.h:24:48: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
   drivers/nvmem/qnap-mcu-eeprom.c: In function 'qnap_mcu_eeprom_read_block':
   drivers/nvmem/qnap-mcu-eeprom.c:28:17: error: implicit declaration of function 'kzalloc' [-Werror=implicit-function-declaration]
      28 |         reply = kzalloc(bytes + sizeof(cmd), GFP_KERNEL);
         |                 ^~~~~~~
>> drivers/nvmem/qnap-mcu-eeprom.c:28:15: warning: assignment to 'u8 *' {aka 'unsigned char *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
      28 |         reply = kzalloc(bytes + sizeof(cmd), GFP_KERNEL);
         |               ^
   drivers/nvmem/qnap-mcu-eeprom.c:32:15: error: implicit declaration of function 'qnap_mcu_exec' [-Werror=implicit-function-declaration]
      32 |         ret = qnap_mcu_exec(mcu, cmd, sizeof(cmd), reply, bytes + sizeof(cmd));
         |               ^~~~~~~~~~~~~
   drivers/nvmem/qnap-mcu-eeprom.c:45:9: error: implicit declaration of function 'kfree' [-Werror=implicit-function-declaration]
      45 |         kfree(reply);
         |         ^~~~~

cc1: some warnings being treated as errors

vim +28 drivers/nvmem/qnap-mcu-eeprom.c

    20	
    21	static int qnap_mcu_eeprom_read_block(struct qnap_mcu *mcu, unsigned int offset,
    22					      void *val, size_t bytes)
    23	{
    24		const u8 cmd[] = { 0xf7, 0xa1, offset, bytes };
    25		u8 *reply;
    26		int ret = 0;
    27	
  > 28		reply = kzalloc(bytes + sizeof(cmd), GFP_KERNEL);
    29		if (!reply)
    30			return -ENOMEM;
    31	
    32		ret = qnap_mcu_exec(mcu, cmd, sizeof(cmd), reply, bytes + sizeof(cmd));
    33		if (ret)
    34			goto out;
    35	
    36		/* First bytes must mirror the sent command */
    37		if (memcmp(cmd, reply, sizeof(cmd))) {
    38			ret = -EIO;
    39			goto out;
    40		}
    41	
    42		memcpy(val, reply + sizeof(cmd), bytes);
    43	
    44	out:
    45		kfree(reply);
    46		return ret;
    47	}
    48	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki