All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [miquelraynal:nvmem-layouts-and-of-cleanup /35] drivers/of/module.c:62:6: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int'
Date: Wed, 8 Mar 2023 06:46:07 +0800	[thread overview]
Message-ID: <202303080602.l78Xfpcf-lkp@intel.com> (raw)

tree:   https://github.com/miquelraynal/linux-0day.git nvmem-layouts-and-of-cleanup
head:   4dbec5e07ef322a0458183244c9a11e92eebd61d
commit: 71414eadef0bb9ab9e3688498d0dc11f2739b5f2 [/35] of: Move the request module helper logic to module.c
config: i386-randconfig-a013-20230306 (https://download.01.org/0day-ci/archive/20230308/202303080602.l78Xfpcf-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/miquelraynal/linux-0day/commit/71414eadef0bb9ab9e3688498d0dc11f2739b5f2
        git remote add miquelraynal https://github.com/miquelraynal/linux-0day.git
        git fetch --no-tags miquelraynal nvmem-layouts-and-of-cleanup
        git checkout 71414eadef0bb9ab9e3688498d0dc11f2739b5f2
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/nvmem/ drivers/of/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303080602.l78Xfpcf-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/of/module.c:62:8: error: implicit declaration of function 'kmalloc' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           str = kmalloc(size, GFP_KERNEL);
                 ^
   drivers/of/module.c:62:8: note: did you mean 'mm_alloc'?
   include/linux/sched/mm.h:16:26: note: 'mm_alloc' declared here
   extern struct mm_struct *mm_alloc(void);
                            ^
>> drivers/of/module.c:62:6: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
           str = kmalloc(size, GFP_KERNEL);
               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/of/module.c:69:2: error: implicit declaration of function 'kfree' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           kfree(str);
           ^
   drivers/of/module.c:69:2: note: did you mean 'kvfree'?
   include/linux/rcutiny.h:99:13: note: 'kvfree' declared here
   extern void kvfree(const void *addr);
               ^
   1 warning and 2 errors generated.


vim +62 drivers/of/module.c

    45	
    46	int of_request_module(struct device_node *np)
    47	{
    48		char *str;
    49		ssize_t size;
    50		int ret;
    51	
    52		if (!np)
    53			return -ENODEV;
    54	
    55		size = of_modalias(np, NULL, 0);
    56		if (size < 0)
    57			return size;
    58	
    59		/* Reserve an additional byte for the trailing '\0' */
    60		size++;
    61	
  > 62		str = kmalloc(size, GFP_KERNEL);

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

                 reply	other threads:[~2023-03-07 22:46 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=202303080602.l78Xfpcf-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=miquel.raynal@bootlin.com \
    --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.