Re: [PATCH 3/5] Huawei BMA: Adding Huawei BMA driver: host_veth_drv

From: kernel test robot
Date: Mon Jun 22 2020 - 17:01:37 EST


Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on sparc-next/master]
[also build test WARNING on linux/master linus/master v5.8-rc2 next-20200622]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/yunaixin03610-163-com/Adding-Huawei-BMA-drivers/20200623-014140
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next.git master
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:394:5: warning: no previous prototype for 'bspveth_setup_tx_resources' [-Wmissing-prototypes]
394 | s32 bspveth_setup_tx_resources(struct bspveth_device *pvethdev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from arch/sh/include/asm/thread_info.h:15,
from include/linux/thread_info.h:38,
from include/asm-generic/preempt.h:5,
from ./arch/sh/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:18:
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c: In function 'bspveth_setup_tx_resources':
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:427:37: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
427 | ptx_queue->pbdbase_p = (u8 *)(__pa((BSP_VETH_T)(ptx_queue->pbdbase_v)));
| ^
arch/sh/include/asm/page.h:138:20: note: in definition of macro '___pa'
138 | #define ___pa(x) ((x)-PAGE_OFFSET)
| ^
>> drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:427:32: note: in expansion of macro '__pa'
427 | ptx_queue->pbdbase_p = (u8 *)(__pa((BSP_VETH_T)(ptx_queue->pbdbase_v)));
| ^~~~
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c: At top level:
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:443:6: warning: no previous prototype for 'bspveth_free_tx_resources' [-Wmissing-prototypes]
443 | void bspveth_free_tx_resources(struct bspveth_device *pvethdev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:485:5: warning: no previous prototype for 'bspveth_setup_all_tx_resources' [-Wmissing-prototypes]
485 | s32 bspveth_setup_all_tx_resources(struct bspveth_device *pvethdev)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c: In function 'bspveth_setup_all_tx_resources':
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:514:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
514 | (struct bspveth_dma_shmbd *)((BSP_VETH_T)(shmq_head)
| ^
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:514:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
514 | (struct bspveth_dma_shmbd *)((BSP_VETH_T)(shmq_head)
| ^
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:517:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
517 | (u8 *)((BSP_VETH_T)(shmq_head_p)
| ^
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:517:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
517 | (u8 *)((BSP_VETH_T)(shmq_head_p)
| ^
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:520:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
520 | (struct bspveth_dmal *)((BSP_VETH_T)(shmq_head)
| ^
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:520:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
520 | (struct bspveth_dmal *)((BSP_VETH_T)(shmq_head)
| ^
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:523:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
523 | (u8 *)(u64)(VETH_SHAREPOOL_BASE_INBMC +
| ^
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c: At top level:
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:554:6: warning: no previous prototype for 'bspveth_free_all_tx_resources' [-Wmissing-prototypes]
554 | void bspveth_free_all_tx_resources(struct bspveth_device *pvethdev)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:571:5: warning: no previous prototype for 'veth_alloc_one_rx_skb' [-Wmissing-prototypes]
571 | s32 veth_alloc_one_rx_skb(struct bspveth_rxtx_q *prx_queue, int idx)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:616:5: warning: no previous prototype for 'veth_refill_rxskb' [-Wmissing-prototypes]
616 | s32 veth_refill_rxskb(struct bspveth_rxtx_q *prx_queue, int queue)
| ^~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:654:5: warning: no previous prototype for 'bspveth_setup_rx_skb' [-Wmissing-prototypes]
654 | s32 bspveth_setup_rx_skb(struct bspveth_device *pvethdev,
| ^~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:685:6: warning: no previous prototype for 'bspveth_free_rx_skb' [-Wmissing-prototypes]
685 | void bspveth_free_rx_skb(struct bspveth_device *pvethdev,
| ^~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:718:5: warning: no previous prototype for 'bspveth_setup_all_rx_skb' [-Wmissing-prototypes]
718 | s32 bspveth_setup_all_rx_skb(struct bspveth_device *pvethdev)
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:746:6: warning: no previous prototype for 'bspveth_free_all_rx_skb' [-Wmissing-prototypes]
746 | void bspveth_free_all_rx_skb(struct bspveth_device *pvethdev)
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:758:5: warning: no previous prototype for 'bspveth_setup_rx_resources' [-Wmissing-prototypes]
758 | s32 bspveth_setup_rx_resources(struct bspveth_device *pvethdev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from arch/sh/include/asm/thread_info.h:15,
from include/linux/thread_info.h:38,
from include/asm-generic/preempt.h:5,
from ./arch/sh/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:18:
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c: In function 'bspveth_setup_rx_resources':
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:792:36: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
792 | prx_queue->pbdbase_p = (u8 *)__pa((BSP_VETH_T) (prx_queue->pbdbase_v));
| ^
arch/sh/include/asm/page.h:138:20: note: in definition of macro '___pa'
138 | #define ___pa(x) ((x)-PAGE_OFFSET)
| ^
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:792:31: note: in expansion of macro '__pa'
792 | prx_queue->pbdbase_p = (u8 *)__pa((BSP_VETH_T) (prx_queue->pbdbase_v));
| ^~~~
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c: At top level:
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:809:6: warning: no previous prototype for 'bspveth_free_rx_resources' [-Wmissing-prototypes]
809 | void bspveth_free_rx_resources(struct bspveth_device *pvethdev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:841:5: warning: no previous prototype for 'bspveth_setup_all_rx_resources' [-Wmissing-prototypes]
841 | s32 bspveth_setup_all_rx_resources(struct bspveth_device *pvethdev)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c: In function 'bspveth_setup_all_rx_resources':
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:871:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
871 | (struct bspveth_dma_shmbd *)((BSP_VETH_T)(shmq_head)
| ^
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:871:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
871 | (struct bspveth_dma_shmbd *)((BSP_VETH_T)(shmq_head)
| ^
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:874:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
874 | (u8 *)((BSP_VETH_T)(shmq_head_p)
| ^
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:874:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
874 | (u8 *)((BSP_VETH_T)(shmq_head_p)
| ^
drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c:877:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
877 | (struct bspveth_dmal *)((BSP_VETH_T)(shmq_head)
| ^

vim +/__pa +427 drivers/net/ethernet/huawei/bma/veth_drv/veth_hb.c

393
394 s32 bspveth_setup_tx_resources(struct bspveth_device *pvethdev,
395 struct bspveth_rxtx_q *ptx_queue)
396 {
397 unsigned int size;
398
399 if (!pvethdev || !ptx_queue)
400 return BSP_ERR_NULL_POINTER;
401
402 ptx_queue->count = MAX_QUEUE_BDNUM;
403
404 size = sizeof(struct bspveth_bd_info) * ptx_queue->count;
405 ptx_queue->pbdinfobase_v = vmalloc(size);
406 if (!ptx_queue->pbdinfobase_v)
407 goto alloc_failed;
408
409 memset(ptx_queue->pbdinfobase_v, 0, size);
410
411 /* round up to nearest 4K */
412 ptx_queue->size = ptx_queue->count * sizeof(struct bspveth_bd_info);
413 ptx_queue->size = ALIGN(ptx_queue->size, 4096);
414
415 /* prepare 4096 send buffer */
416 ptx_queue->pbdbase_v = kmalloc(ptx_queue->size, GFP_KERNEL);
417 if (!ptx_queue->pbdbase_v) {
418 VETH_LOG(DLOG_ERROR,
419 "Unable to kmalloc for the receive descriptor ring\n");
420
421 vfree(ptx_queue->pbdinfobase_v);
422 ptx_queue->pbdinfobase_v = NULL;
423
424 goto alloc_failed;
425 }
426
> 427 ptx_queue->pbdbase_p = (u8 *)(__pa((BSP_VETH_T)(ptx_queue->pbdbase_v)));
428
429 ptx_queue->next_to_fill = 0;
430 ptx_queue->next_to_free = 0;
431 ptx_queue->head = 0;
432 ptx_queue->tail = 0;
433 ptx_queue->work_limit = BSPVETH_WORK_LIMIT;
434
435 memset(&ptx_queue->s, 0, sizeof(struct bspveth_rxtx_statis));
436
437 return 0;
438
439 alloc_failed:
440 return -ENOMEM;
441 }
442

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

Attachment: .config.gz
Description: application/gzip