[PATCH v2] isoc: mediatek: potential use of error pointer

kernel test robot lkp at intel.com
Fri Dec 17 06:06:27 PST 2021


Hi Jiasheng,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on broonie-sound/for-next]
[also build test WARNING on broonie-spi/for-next linus/master mbgg-mediatek/for-next v5.16-rc5 next-20211216]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Jiasheng-Jiang/isoc-mediatek-potential-use-of-error-pointer/20211217-201022
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20211217/202112172128.4DTbSyzc-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 11.2.0
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/0day-ci/linux/commit/1b5bac7d5052521b10c6c7ab2279cbd8c31cd458
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Jiasheng-Jiang/isoc-mediatek-potential-use-of-error-pointer/20211217-201022
        git checkout 1b5bac7d5052521b10c6c7ab2279cbd8c31cd458
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash drivers/soc/mediatek/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

   drivers/soc/mediatek/mtk-scpsys.c: In function 'init_clks':
>> drivers/soc/mediatek/mtk-scpsys.c:421:32: warning: returning 'void *' from a function with return type 'int' makes integer from pointer without a cast [-Wint-conversion]
     421 |                         return ERR_PTR(-ENOMEM);
         |                                ^~~~~~~~~~~~~~~~


vim +421 drivers/soc/mediatek/mtk-scpsys.c

   413	
   414	static int init_clks(struct platform_device *pdev, struct clk **clk)
   415	{
   416		int i;
   417	
   418		for (i = CLK_NONE + 1; i < CLK_MAX; i++) {
   419			clk[i] = devm_clk_get(&pdev->dev, clk_names[i]);
   420			if (!clk[i])
 > 421				return ERR_PTR(-ENOMEM);
   422		}
   423		return 0;
   424	}
   425	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org



More information about the Linux-mediatek mailing list