lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202211041527.HD8TLSE1-lkp@intel.com>
Date:   Fri, 4 Nov 2022 15:20:54 +0800
From:   kernel test robot <lkp@...el.com>
To:     "Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        linux-kernel@...r.kernel.org, Kees Cook <keescook@...omium.org>
Subject: drivers/rtc/rtc-msc313.c:227:38: warning: cast from 'void (*)(struct
 clk *)' to 'void (*)(void *)' converts to incompatible function type

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ee6050c8af96bba2f81e8b0793a1fc2f998fcd20
commit: 552a23a0e5d0a84cecd4687043d8030673981d30 Makefile: Enable -Wcast-function-type
date:   12 months ago
config: hexagon-randconfig-r031-20221104
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 2bbafe04fe785a9469bea5a3737f8d7d3ce4aca2)
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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=552a23a0e5d0a84cecd4687043d8030673981d30
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 552a23a0e5d0a84cecd4687043d8030673981d30
        # 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=hexagon SHELL=/bin/bash drivers/rtc/ sound/core/seq/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

>> drivers/rtc/rtc-msc313.c:227:38: warning: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Wcast-function-type-strict]
           ret = devm_add_action_or_reset(dev, (void (*) (void *))clk_disable_unprepare, clk);
                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.
--
>> sound/core/seq/seq_memory.c:154:22: warning: cast from 'int (*)(char **, const void *, int)' to 'snd_seq_dump_func_t' (aka 'int (*)(void *, void *, int)') converts to incompatible function type [-Wcast-function-type-strict]
                                        in_kernel ? (snd_seq_dump_func_t)seq_copy_in_kernel :
                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/core/seq/seq_memory.c:155:10: warning: cast from 'int (*)(char **, const void *, int)' to 'snd_seq_dump_func_t' (aka 'int (*)(void *, void *, int)') converts to incompatible function type [-Wcast-function-type-strict]
                                        (snd_seq_dump_func_t)seq_copy_in_user,
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   2 warnings generated.


vim +227 drivers/rtc/rtc-msc313.c

be7d9c9161b9c7 Daniel Palmer 2021-08-23  179  
be7d9c9161b9c7 Daniel Palmer 2021-08-23  180  static int msc313_rtc_probe(struct platform_device *pdev)
be7d9c9161b9c7 Daniel Palmer 2021-08-23  181  {
be7d9c9161b9c7 Daniel Palmer 2021-08-23  182  	struct device *dev = &pdev->dev;
be7d9c9161b9c7 Daniel Palmer 2021-08-23  183  	struct msc313_rtc *priv;
be7d9c9161b9c7 Daniel Palmer 2021-08-23  184  	unsigned long rate;
be7d9c9161b9c7 Daniel Palmer 2021-08-23  185  	struct clk *clk;
be7d9c9161b9c7 Daniel Palmer 2021-08-23  186  	int ret;
be7d9c9161b9c7 Daniel Palmer 2021-08-23  187  	int irq;
be7d9c9161b9c7 Daniel Palmer 2021-08-23  188  
be7d9c9161b9c7 Daniel Palmer 2021-08-23  189  	priv = devm_kzalloc(&pdev->dev, sizeof(struct msc313_rtc), GFP_KERNEL);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  190  	if (!priv)
be7d9c9161b9c7 Daniel Palmer 2021-08-23  191  		return -ENOMEM;
be7d9c9161b9c7 Daniel Palmer 2021-08-23  192  
be7d9c9161b9c7 Daniel Palmer 2021-08-23  193  	priv->rtc_base = devm_platform_ioremap_resource(pdev, 0);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  194  	if (IS_ERR(priv->rtc_base))
be7d9c9161b9c7 Daniel Palmer 2021-08-23  195  		return PTR_ERR(priv->rtc_base);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  196  
be7d9c9161b9c7 Daniel Palmer 2021-08-23  197  	irq = platform_get_irq(pdev, 0);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  198  	if (irq < 0)
be7d9c9161b9c7 Daniel Palmer 2021-08-23  199  		return -EINVAL;
be7d9c9161b9c7 Daniel Palmer 2021-08-23  200  
be7d9c9161b9c7 Daniel Palmer 2021-08-23  201  	priv->rtc_dev = devm_rtc_allocate_device(dev);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  202  	if (IS_ERR(priv->rtc_dev))
be7d9c9161b9c7 Daniel Palmer 2021-08-23  203  		return PTR_ERR(priv->rtc_dev);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  204  
be7d9c9161b9c7 Daniel Palmer 2021-08-23  205  	priv->rtc_dev->ops = &msc313_rtc_ops;
be7d9c9161b9c7 Daniel Palmer 2021-08-23  206  	priv->rtc_dev->range_max = U32_MAX;
be7d9c9161b9c7 Daniel Palmer 2021-08-23  207  
be7d9c9161b9c7 Daniel Palmer 2021-08-23  208  	ret = devm_request_irq(dev, irq, msc313_rtc_interrupt, IRQF_SHARED,
be7d9c9161b9c7 Daniel Palmer 2021-08-23  209  			       dev_name(&pdev->dev), &pdev->dev);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  210  	if (ret) {
be7d9c9161b9c7 Daniel Palmer 2021-08-23  211  		dev_err(dev, "Could not request IRQ\n");
be7d9c9161b9c7 Daniel Palmer 2021-08-23  212  		return ret;
be7d9c9161b9c7 Daniel Palmer 2021-08-23  213  	}
be7d9c9161b9c7 Daniel Palmer 2021-08-23  214  
be7d9c9161b9c7 Daniel Palmer 2021-08-23  215  	clk = devm_clk_get(dev, NULL);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  216  	if (IS_ERR(clk)) {
be7d9c9161b9c7 Daniel Palmer 2021-08-23  217  		dev_err(dev, "No input reference clock\n");
be7d9c9161b9c7 Daniel Palmer 2021-08-23  218  		return PTR_ERR(clk);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  219  	}
be7d9c9161b9c7 Daniel Palmer 2021-08-23  220  
be7d9c9161b9c7 Daniel Palmer 2021-08-23  221  	ret = clk_prepare_enable(clk);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  222  	if (ret) {
be7d9c9161b9c7 Daniel Palmer 2021-08-23  223  		dev_err(dev, "Failed to enable the reference clock, %d\n", ret);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  224  		return ret;
be7d9c9161b9c7 Daniel Palmer 2021-08-23  225  	}
be7d9c9161b9c7 Daniel Palmer 2021-08-23  226  
be7d9c9161b9c7 Daniel Palmer 2021-08-23 @227  	ret = devm_add_action_or_reset(dev, (void (*) (void *))clk_disable_unprepare, clk);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  228  	if (ret)
be7d9c9161b9c7 Daniel Palmer 2021-08-23  229  		return ret;
be7d9c9161b9c7 Daniel Palmer 2021-08-23  230  
be7d9c9161b9c7 Daniel Palmer 2021-08-23  231  	rate = clk_get_rate(clk);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  232  	writew(rate & 0xFFFF, priv->rtc_base + REG_RTC_FREQ_CW_L);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  233  	writew((rate >> 16) & 0xFFFF, priv->rtc_base + REG_RTC_FREQ_CW_H);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  234  
be7d9c9161b9c7 Daniel Palmer 2021-08-23  235  	platform_set_drvdata(pdev, priv);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  236  
be7d9c9161b9c7 Daniel Palmer 2021-08-23  237  	return devm_rtc_register_device(priv->rtc_dev);
be7d9c9161b9c7 Daniel Palmer 2021-08-23  238  }
be7d9c9161b9c7 Daniel Palmer 2021-08-23  239  

:::::: The code at line 227 was first introduced by commit
:::::: be7d9c9161b9c76edeff15e79edc2f256568fe05 rtc: Add support for the MSTAR MSC313 RTC

:::::: TO: Daniel Palmer <daniel@...f.com>
:::::: CC: Alexandre Belloni <alexandre.belloni@...tlin.com>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (127345 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ