git: 91aa93eb675a - main - qlnx: Remove unused variables.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Fri, 08 Apr 2022 00:03:29 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=91aa93eb675aa916df6b5fd1166ee0bce1cef9dd

commit 91aa93eb675aa916df6b5fd1166ee0bce1cef9dd
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-08 00:01:27 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-08 00:01:27 +0000

    qlnx: Remove unused variables.
---
 sys/dev/qlnx/qlnxe/qlnx_ioctl.c  |  3 ---
 sys/dev/qlnx/qlnxe/qlnx_os.c     | 46 ----------------------------------------
 sys/dev/qlnx/qlnxe/qlnx_rdma.c   |  5 +----
 sys/dev/qlnx/qlnxr/qlnxr_cm.c    |  3 ---
 sys/dev/qlnx/qlnxr/qlnxr_verbs.c |  5 +----
 5 files changed, 2 insertions(+), 60 deletions(-)

diff --git a/sys/dev/qlnx/qlnxe/qlnx_ioctl.c b/sys/dev/qlnx/qlnxe/qlnx_ioctl.c
index a98ab2e895d8..f87cb8b49921 100644
--- a/sys/dev/qlnx/qlnxe/qlnx_ioctl.c
+++ b/sys/dev/qlnx/qlnxe/qlnx_ioctl.c
@@ -993,15 +993,12 @@ qlnx_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
 {
 	qlnx_host_t	*ha;
 	int		rval = 0;
-	struct ifnet	*ifp;
 	qlnx_trace_t	*trace;
 	int		i;
 
 	if ((ha = (qlnx_host_t *)dev->si_drv1) == NULL)
 		return ENXIO;
 
-	ifp = ha->ifp;
-
 	switch (cmd) {
 	case QLNX_GRC_DUMP_SIZE:
 		qlnx_get_grc_dump_size(ha, (qlnx_grcdump_t *)data);
diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.c b/sys/dev/qlnx/qlnxe/qlnx_os.c
index 750286d9c458..3278cf3a4333 100644
--- a/sys/dev/qlnx/qlnxe/qlnx_os.c
+++ b/sys/dev/qlnx/qlnxe/qlnx_os.c
@@ -1190,11 +1190,8 @@ qlnx_get_personality(uint8_t pci_func)
 static void
 qlnx_set_personality(qlnx_host_t *ha)
 {
-	struct ecore_hwfn *p_hwfn;
 	uint8_t personality;
 
-	p_hwfn = &ha->cdev.hwfns[0];
-
 	personality = qlnx_get_personality(ha->pci_func);
 
 	switch (personality) {
@@ -3168,11 +3165,8 @@ qlnx_qflush(struct ifnet *ifp)
 static void
 qlnx_txq_doorbell_wr32(qlnx_host_t *ha, void *reg_addr, uint32_t value)
 {
-	struct ecore_dev	*cdev;
 	uint32_t		offset;
 
-	cdev = &ha->cdev;
-		
 	offset = (uint32_t)((uint8_t *)reg_addr - (uint8_t *)ha->pci_dbells);
 
 	bus_write_4(ha->pci_dbells, offset, value);
@@ -3191,11 +3185,8 @@ qlnx_tcp_offset(qlnx_host_t *ha, struct mbuf *mp)
         struct tcphdr			*th = NULL;
         uint32_t			ehdrlen = 0, ip_hlen = 0, offset = 0;
         uint16_t			etype = 0;
-        device_t			dev;
         uint8_t				buf[sizeof(struct ip6_hdr)];
 
-        dev = ha->pci_dev;
-
         eh = mtod(mp, struct ether_vlan_header *);
 
         if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) {
@@ -3789,11 +3780,8 @@ static void
 qlnx_stop(qlnx_host_t *ha)
 {
 	struct ifnet	*ifp = ha->ifp;
-	device_t	dev;
 	int		i;
 
-	dev = ha->pci_dev;
-
 	ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE | IFF_DRV_RUNNING);
 
 	/*
@@ -3986,12 +3974,10 @@ qlnx_tpa_start(qlnx_host_t *ha,
 	bus_dmamap_t		map;
 	struct eth_rx_bd	*rx_bd;
 	int			i;
-	device_t		dev;
 #if __FreeBSD_version >= 1100000
 	uint8_t			hash_type;
 #endif /* #if __FreeBSD_version >= 1100000 */
 
-	dev = ha->pci_dev;
 	agg_index = cqe->tpa_agg_index;
 
         QL_DPRINT7(ha, "[rss_id = %d]: enter\n \
@@ -4303,9 +4289,6 @@ qlnx_tpa_cont(qlnx_host_t *ha, struct qlnx_fastpath *fp,
 	struct mbuf		*mpf = NULL, *mpl = NULL, *mpc = NULL;
 	struct mbuf		*mp;
 	uint32_t		agg_index;
-	device_t		dev;
-
-	dev = ha->pci_dev;
 
         QL_DPRINT7(ha, "[%d]: enter\n \
                 \t type = 0x%x\n \
@@ -4424,9 +4407,6 @@ qlnx_tpa_end(qlnx_host_t *ha, struct qlnx_fastpath *fp,
 	uint32_t		agg_index;
 	uint32_t		len = 0;
         struct ifnet		*ifp = ha->ifp;
-	device_t		dev;
-
-	dev = ha->pci_dev;
 
         QL_DPRINT7(ha, "[%d]: enter\n \
                 \t type = 0x%x\n \
@@ -5037,11 +5017,8 @@ static int
 qlnx_alloc_dmabuf(qlnx_host_t *ha, qlnx_dma_t *dma_buf)
 {
         int             ret = 0;
-        device_t        dev;
         bus_addr_t      b_addr;
 
-        dev = ha->pci_dev;
-
         ret = bus_dma_tag_create(
                         ha->parent_tag,/* parent */
                         dma_buf->alignment,
@@ -5107,10 +5084,8 @@ qlnx_dma_alloc_coherent(void *ecore_dev, bus_addr_t *phys, uint32_t size)
 	qlnx_dma_t	dma_buf;
 	qlnx_dma_t	*dma_p;
 	qlnx_host_t	*ha;
-	device_t        dev;
 
 	ha = (qlnx_host_t *)ecore_dev;
-	dev = ha->pci_dev;
 
 	size = (size + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
 
@@ -5142,10 +5117,8 @@ qlnx_dma_free_coherent(void *ecore_dev, void *v_addr, bus_addr_t phys,
 {
 	qlnx_dma_t dma_buf, *dma_p;
 	qlnx_host_t	*ha;
-	device_t        dev;
 
 	ha = (qlnx_host_t *)ecore_dev;
-	dev = ha->pci_dev;
 
 	if (v_addr == NULL)
 		return;
@@ -5921,10 +5894,6 @@ qlnx_get_flash_size(qlnx_host_t *ha, uint32_t *flash_size)
 static int
 qlnx_alloc_mem_arrays(qlnx_host_t *ha)
 {
-	struct ecore_dev	*cdev;
-
-	cdev = &ha->cdev;
-
 	bzero(&ha->txq_array[0], (sizeof(struct qlnx_tx_queue) * QLNX_MAX_RSS));
 	bzero(&ha->rxq_array[0], (sizeof(struct qlnx_rx_queue) * QLNX_MAX_RSS));
 	bzero(&ha->sb_array[0], (sizeof(struct ecore_sb_info) * QLNX_MAX_RSS));
@@ -6137,9 +6106,6 @@ qlnx_alloc_rx_buffer(qlnx_host_t *ha, struct qlnx_rx_queue *rxq)
 	bus_dma_segment_t       segs[1];
 	int			nsegs;
 	int			ret;
-	struct ecore_dev	*cdev;
-
-	cdev = &ha->cdev;
 
         rx_buf_size = rxq->rx_buf_size;
 
@@ -6252,11 +6218,9 @@ static int
 qlnx_alloc_mem_rxq(qlnx_host_t *ha, struct qlnx_rx_queue *rxq)
 {
         int			i, rc, num_allocated;
-	struct ifnet		*ifp;
 	struct ecore_dev	 *cdev;
 
 	cdev = &ha->cdev;
-	ifp = ha->ifp;
 
         rxq->num_rx_buffers = RX_RING_SIZE;
 
@@ -6504,9 +6468,6 @@ static void
 qlnx_free_mem_load(qlnx_host_t *ha)
 {
         int			i;
-	struct ecore_dev	*cdev;
-
-	cdev = &ha->cdev;
 
         for (i = 0; i < ha->num_rss; i++) {
                 struct qlnx_fastpath *fp = &ha->fp_array[i];
@@ -7329,10 +7290,8 @@ qlnx_load(qlnx_host_t *ha)
 {
 	int			i;
 	int			rc = 0;
-	struct ecore_dev	*cdev;
         device_t		dev;
 
-	cdev = &ha->cdev;
         dev = ha->pci_dev;
 
 	QL_DPRINT2(ha, "enter\n");
@@ -7873,9 +7832,6 @@ static int
 __qlnx_iov_update_vport(struct ecore_hwfn *hwfn, uint8_t vfid,
         struct ecore_sp_vport_update_params *params, uint16_t * tlvs)
 {
-        uint8_t mask;
-        struct ecore_filter_accept_flags *flags;
-
 	if (!ecore_iov_vf_has_vport_instance(hwfn, vfid)) {
 		QL_DPRINT1(((qlnx_host_t *)hwfn->p_dev),
 			"VF[%d] vport not initialized\n", vfid);
@@ -7886,8 +7842,6 @@ __qlnx_iov_update_vport(struct ecore_hwfn *hwfn, uint8_t vfid,
          * Simply indicate everything is configured fine, and trace
          * configuration 'behind their back'.
          */
-        mask = ECORE_ACCEPT_UCAST_UNMATCHED | ECORE_ACCEPT_MCAST_UNMATCHED;
-        flags = &params->accept_flags;
         if (!(*tlvs & BIT(ECORE_IOV_VP_UPDATE_ACCEPT_PARAM)))
                 return 0;
 
diff --git a/sys/dev/qlnx/qlnxe/qlnx_rdma.c b/sys/dev/qlnx/qlnxe/qlnx_rdma.c
index 5929fee5d263..26b1679ca137 100644
--- a/sys/dev/qlnx/qlnxe/qlnx_rdma.c
+++ b/sys/dev/qlnx/qlnxe/qlnx_rdma.c
@@ -183,7 +183,6 @@ int
 qlnx_rdma_dev_remove(struct qlnx_host *ha)
 {
 	int ret = 0;
-	qlnx_host_t *ha_prev;
 	qlnx_host_t *ha_cur;
 
 	QL_DPRINT12(ha, "enter ha = %p\n", ha);
@@ -210,15 +209,13 @@ qlnx_rdma_dev_remove(struct qlnx_host *ha)
 		return (ret);
 	}
 
-	ha_prev = ha_cur = qlnx_host_list;
+	ha_cur = qlnx_host_list;
 
 	while ((ha_cur != ha) && (ha_cur != NULL)) {
-		ha_prev = ha_cur;
 		ha_cur = ha_cur->next;
 	}
 
 	if (ha_cur == ha) {
-		ha_prev = ha->next;
 		ha->next = NULL;
 	}
 
diff --git a/sys/dev/qlnx/qlnxr/qlnxr_cm.c b/sys/dev/qlnx/qlnxr/qlnxr_cm.c
index a9976146fe94..7d2bff15c491 100644
--- a/sys/dev/qlnx/qlnxr/qlnxr_cm.c
+++ b/sys/dev/qlnx/qlnxr/qlnxr_cm.c
@@ -98,7 +98,6 @@ qlnxr_ll2_complete_rx_packet(void *cxt,
 	// struct qlnxr_qp *qp = dev->gsi_qp;
 	struct qlnxr_qp *qp = NULL;
 	unsigned long flags;
-	uint32_t qp_num = 0;
 	// uint32_t delay_count = 0, gsi_cons = 0;
 	//void * dest_va;
 
@@ -112,8 +111,6 @@ qlnxr_ll2_complete_rx_packet(void *cxt,
 		QL_DPRINT12(dev->ha, "cookie is NULL, bad sign\n");
 	}
 
-	qp_num = (0xFF << 16) | data->qp_id;
-
 	if (data->qp_id == 1) {
 		qp = dev->gsi_qp;
 	} else {
diff --git a/sys/dev/qlnx/qlnxr/qlnxr_verbs.c b/sys/dev/qlnx/qlnxr/qlnxr_verbs.c
index d39f1946c641..c4affef7955c 100644
--- a/sys/dev/qlnx/qlnxr/qlnxr_verbs.c
+++ b/sys/dev/qlnx/qlnxr/qlnxr_verbs.c
@@ -1235,7 +1235,7 @@ qlnxr_alloc_pbl_tbl(struct qlnxr_dev *dev,
 	dma_addr_t		pa;
 	dma_addr_t		*pbl_main_tbl;
 	struct qlnxr_pbl	*pbl_table;
-	int			i, rc = 0;
+	int			i;
 	qlnx_host_t		*ha;
 
 	ha = dev->ha;
@@ -1253,7 +1253,6 @@ qlnxr_alloc_pbl_tbl(struct qlnxr_dev *dev,
 		va = qlnx_dma_alloc_coherent(&dev->ha->cdev, &pa, pbl_info->pbl_size);
 		if (!va) {
 			QL_DPRINT11(ha, "Failed to allocate pbl#%d\n", i);
-			rc = -ENOMEM;
 			goto err;
 		}
 		memset(va, 0, pbl_info->pbl_size);
@@ -2668,7 +2667,6 @@ qlnxr_create_user_qp(struct qlnxr_dev *dev,
 	struct ecore_rdma_create_qp_out_params out_params;
 	struct qlnxr_pd *pd = get_qlnxr_pd(ibpd);
 	struct ib_ucontext *ib_ctx = NULL;
-	struct qlnxr_ucontext *ctx = NULL;
 	struct qlnxr_create_qp_ureq ureq;
 	int alloc_and_init = QLNX_IS_ROCE(dev);
 	int rc = -EINVAL;
@@ -2679,7 +2677,6 @@ qlnxr_create_user_qp(struct qlnxr_dev *dev,
 	QL_DPRINT12(ha, "enter\n");
 
 	ib_ctx = ibpd->uobject->context;
-	ctx = get_qlnxr_ucontext(ib_ctx);
 
 	memset(&ureq, 0, sizeof(ureq));
 	rc = ib_copy_from_udata(&ureq, udata, sizeof(ureq));