Re: [PATCH 1/2] mailbox: stm32-ipcc: add COMPILE_TEST dependency

2020-10-30 Thread kernel test robot
Hi Martin,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on fujitsu-integration/mailbox-for-next]
[also build test WARNING on stm32/stm32-next linus/master linux/master 
v5.10-rc1 next-20201030]
[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/Martin-Kaiser/mailbox-stm32-ipcc-add-COMPILE_TEST-dependency/20201024-220512
base:   https://git.linaro.org/landing-teams/working/fujitsu/integration.git 
mailbox-for-next
config: x86_64-randconfig-r023-20201030 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 
772aaa602383cf82795572ebcd86b0e660f3579f)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# 
https://github.com/0day-ci/linux/commit/6e22aaac25dcdd4c098c57d29363fa2c204e411e
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review 
Martin-Kaiser/mailbox-stm32-ipcc-add-COMPILE_TEST-dependency/20201024-220512
git checkout 6e22aaac25dcdd4c098c57d29363fa2c204e411e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 

All warnings (new ones prefixed by >>):

>> drivers/mailbox/stm32-ipcc.c:147:22: warning: cast to smaller integer type 
>> 'unsigned int' from 'void *' [-Wvoid-pointer-to-int-cast]
   unsigned int chan = (unsigned int)link->con_priv;
   ^~~~
   drivers/mailbox/stm32-ipcc.c:166:22: warning: cast to smaller integer type 
'unsigned int' from 'void *' [-Wvoid-pointer-to-int-cast]
   unsigned int chan = (unsigned int)link->con_priv;
   ^~~~
   drivers/mailbox/stm32-ipcc.c:186:22: warning: cast to smaller integer type 
'unsigned int' from 'void *' [-Wvoid-pointer-to-int-cast]
   unsigned int chan = (unsigned int)link->con_priv;
   ^~~~
>> drivers/mailbox/stm32-ipcc.c:310:40: warning: cast to 'void *' from smaller 
>> integer type 'unsigned int' [-Wint-to-void-pointer-cast]
   ipcc->controller.chans[i].con_priv = (void *)i;
^
   4 warnings generated.

vim +147 drivers/mailbox/stm32-ipcc.c

ffbded7dee97563 Fabien Dessenne  2018-05-31  144  
ffbded7dee97563 Fabien Dessenne  2018-05-31  145  static int 
stm32_ipcc_send_data(struct mbox_chan *link, void *data)
ffbded7dee97563 Fabien Dessenne  2018-05-31  146  {
ffbded7dee97563 Fabien Dessenne  2018-05-31 @147unsigned int chan = 
(unsigned int)link->con_priv;
ffbded7dee97563 Fabien Dessenne  2018-05-31  148struct stm32_ipcc *ipcc 
= container_of(link->mbox, struct stm32_ipcc,
ffbded7dee97563 Fabien Dessenne  2018-05-31  149
   controller);
ffbded7dee97563 Fabien Dessenne  2018-05-31  150  
ffbded7dee97563 Fabien Dessenne  2018-05-31  151
dev_dbg(ipcc->controller.dev, "%s: chan:%d\n", __func__, chan);
ffbded7dee97563 Fabien Dessenne  2018-05-31  152  
ffbded7dee97563 Fabien Dessenne  2018-05-31  153/* set channel n 
occupied */
dba9a3dfe912dc4 Arnaud Pouliquen 2019-05-22  154
stm32_ipcc_set_bits(>lock, ipcc->reg_proc + IPCC_XSCR,
dba9a3dfe912dc4 Arnaud Pouliquen 2019-05-22  155
TX_BIT_CHAN(chan));
ffbded7dee97563 Fabien Dessenne  2018-05-31  156  
ffbded7dee97563 Fabien Dessenne  2018-05-31  157/* unmask 'tx channel 
free' interrupt */
dba9a3dfe912dc4 Arnaud Pouliquen 2019-05-22  158
stm32_ipcc_clr_bits(>lock, ipcc->reg_proc + IPCC_XMR,
dba9a3dfe912dc4 Arnaud Pouliquen 2019-05-22  159
TX_BIT_CHAN(chan));
ffbded7dee97563 Fabien Dessenne  2018-05-31  160  
ffbded7dee97563 Fabien Dessenne  2018-05-31  161return 0;
ffbded7dee97563 Fabien Dessenne  2018-05-31  162  }
ffbded7dee97563 Fabien Dessenne  2018-05-31  163  
ffbded7dee97563 Fabien Dessenne  2018-05-31  164  static int 
stm32_ipcc_startup(struct mbox_chan *link)
ffbded7dee97563 Fabien Dessenne  2018-05-31  165  {
ffbded7dee97563 Fabien Dessenne  2018-05-31  166unsigned int chan = 
(unsigned int)link->con_priv;
ffbded7dee97563 Fabien Dessenne  2018-05-31  167struct stm32_ipcc *ipcc 
= container_of(link->mbox, struct stm32_ipcc,
ffbded7dee97563 Fabien Dessenne  2018-05-31  168
   controller);

[PATCH 1/2] mailbox: stm32-ipcc: add COMPILE_TEST dependency

2020-10-24 Thread Martin Kaiser
This allows compiling the driver on architectures where the hardware is not
available. Most other mailbox drivers support this as well.

Signed-off-by: Martin Kaiser 
---

I used this for testing the trivial patch that removes the duplicate error
message. Also, compiling the driver on x86_64 worked without errors.

 drivers/mailbox/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
index 05b1009e2820..abbf5d67ffa2 100644
--- a/drivers/mailbox/Kconfig
+++ b/drivers/mailbox/Kconfig
@@ -201,7 +201,7 @@ config BCM_FLEXRM_MBOX
 
 config STM32_IPCC
tristate "STM32 IPCC Mailbox"
-   depends on MACH_STM32MP157
+   depends on MACH_STM32MP157 || COMPILE_TEST
help
  Mailbox implementation for STMicroelectonics STM32 family chips
  with hardware for Inter-Processor Communication Controller (IPCC)
-- 
2.20.1