drivers/soc/fsl/dpio/qbman-portal.c:661:11: warning: variable 'addr_cena' set but not used
From: kernel test robot
Date: Sat Aug 08 2020 - 15:06:02 EST
Hi Youri,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 11030fe96b57ad843518b0e9430f3cd4b3610ce2
commit: 3b2abda7d28c69f564c1157b9b9c21ef40092ee9 soc: fsl: dpio: Replace QMAN array mode with ring mode enqueue
date: 6 months ago
config: i386-randconfig-r036-20200809 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
git checkout 3b2abda7d28c69f564c1157b9b9c21ef40092ee9
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
drivers/soc/fsl/dpio/qbman-portal.c: In function 'qbman_swp_enqueue_multiple_direct':
>> drivers/soc/fsl/dpio/qbman-portal.c:661:11: warning: variable 'addr_cena' set but not used [-Wunused-but-set-variable]
661 | uint64_t addr_cena;
| ^~~~~~~~~
drivers/soc/fsl/dpio/qbman-portal.c: In function 'qbman_swp_enqueue_multiple_desc_direct':
drivers/soc/fsl/dpio/qbman-portal.c:869:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
869 | addr_cena = (uint64_t)s->addr_cena;
| ^
drivers/soc/fsl/dpio/qbman-portal.c:825:11: warning: variable 'addr_cena' set but not used [-Wunused-but-set-variable]
825 | uint64_t addr_cena;
| ^~~~~~~~~
vim +/addr_cena +661 drivers/soc/fsl/dpio/qbman-portal.c
638
639 /**
640 * qbman_swp_enqueue_multiple_direct() - Issue a multi enqueue command
641 * using one enqueue descriptor
642 * @s: the software portal used for enqueue
643 * @d: the enqueue descriptor
644 * @fd: table pointer of frame descriptor table to be enqueued
645 * @flags: table pointer of QBMAN_ENQUEUE_FLAG_DCA flags, not used if NULL
646 * @num_frames: number of fd to be enqueued
647 *
648 * Return the number of fd enqueued, or a negative error number.
649 */
650 static
651 int qbman_swp_enqueue_multiple_direct(struct qbman_swp *s,
652 const struct qbman_eq_desc *d,
653 const struct dpaa2_fd *fd,
654 uint32_t *flags,
655 int num_frames)
656 {
657 uint32_t *p = NULL;
658 const uint32_t *cl = (uint32_t *)d;
659 uint32_t eqcr_ci, eqcr_pi, half_mask, full_mask;
660 int i, num_enqueued = 0;
> 661 uint64_t addr_cena;
662
663 spin_lock(&s->access_spinlock);
664 half_mask = (s->eqcr.pi_ci_mask>>1);
665 full_mask = s->eqcr.pi_ci_mask;
666
667 if (!s->eqcr.available) {
668 eqcr_ci = s->eqcr.ci;
669 p = s->addr_cena + QBMAN_CENA_SWP_EQCR_CI;
670 s->eqcr.ci = qbman_read_register(s, QBMAN_CINH_SWP_EQCR_CI);
671
672 s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size,
673 eqcr_ci, s->eqcr.ci);
674 if (!s->eqcr.available) {
675 spin_unlock(&s->access_spinlock);
676 return 0;
677 }
678 }
679
680 eqcr_pi = s->eqcr.pi;
681 num_enqueued = (s->eqcr.available < num_frames) ?
682 s->eqcr.available : num_frames;
683 s->eqcr.available -= num_enqueued;
684 /* Fill in the EQCR ring */
685 for (i = 0; i < num_enqueued; i++) {
686 p = (s->addr_cena + QBMAN_CENA_SWP_EQCR(eqcr_pi & half_mask));
687 /* Skip copying the verb */
688 memcpy(&p[1], &cl[1], EQ_DESC_SIZE_WITHOUT_FD - 1);
689 memcpy(&p[EQ_DESC_SIZE_FD_START/sizeof(uint32_t)],
690 &fd[i], sizeof(*fd));
691 eqcr_pi++;
692 }
693
694 dma_wmb();
695
696 /* Set the verb byte, have to substitute in the valid-bit */
697 eqcr_pi = s->eqcr.pi;
698 for (i = 0; i < num_enqueued; i++) {
699 p = (s->addr_cena + QBMAN_CENA_SWP_EQCR(eqcr_pi & half_mask));
700 p[0] = cl[0] | s->eqcr.pi_vb;
701 if (flags && (flags[i] & QBMAN_ENQUEUE_FLAG_DCA)) {
702 struct qbman_eq_desc *d = (struct qbman_eq_desc *)p;
703
704 d->dca = (1 << QB_ENQUEUE_CMD_DCA_EN_SHIFT) |
705 ((flags[i]) & QBMAN_EQCR_DCA_IDXMASK);
706 }
707 eqcr_pi++;
708 if (!(eqcr_pi & half_mask))
709 s->eqcr.pi_vb ^= QB_VALID_BIT;
710 }
711
712 /* Flush all the cacheline without load/store in between */
713 eqcr_pi = s->eqcr.pi;
714 addr_cena = (size_t)s->addr_cena;
715 for (i = 0; i < num_enqueued; i++)
716 eqcr_pi++;
717 s->eqcr.pi = eqcr_pi & full_mask;
718 spin_unlock(&s->access_spinlock);
719
720 return num_enqueued;
721 }
722
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip