git: 5e95f5f53150 - main - thunderx: fix potential sign extension issue
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 01 Mar 2023 14:48:34 UTC
The branch main has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=5e95f5f5315083baa7d98d3286f6c0a82621a68e
commit 5e95f5f5315083baa7d98d3286f6c0a82621a68e
Author: Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-02-28 19:17:30 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-03-01 14:48:17 +0000
thunderx: fix potential sign extension issue
Coverity reported a sign extension issue on rq->caching << 26 in the
Linux ThunderX driver. (It appears Coverity Scan doesn't build arm64
objects in FreeBSD.)
As done in Linux, add a cast.
Fixes: 3c0086b81391 ("Raw import of ThunderX VNIC networking driver...")
Sponsored by: The FreeBSD Foundation
---
sys/dev/vnic/nicvf_queues.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/dev/vnic/nicvf_queues.c b/sys/dev/vnic/nicvf_queues.c
index 017d1c6e3e1c..82f045c7777c 100644
--- a/sys/dev/vnic/nicvf_queues.c
+++ b/sys/dev/vnic/nicvf_queues.c
@@ -1342,7 +1342,7 @@ nicvf_rcv_queue_config(struct nicvf *nic, struct queue_set *qs,
mbx.rq.msg = NIC_MBOX_MSG_RQ_CFG;
mbx.rq.qs_num = qs->vnic_id;
mbx.rq.rq_num = qidx;
- mbx.rq.cfg = (rq->caching << 26) | (rq->cq_qs << 19) |
+ mbx.rq.cfg = ((uint64_t)rq->caching << 26) | (rq->cq_qs << 19) |
(rq->cq_idx << 16) | (rq->cont_rbdr_qs << 9) |
(rq->cont_qs_rbdr_idx << 8) | (rq->start_rbdr_qs << 1) |
(rq->start_qs_rbdr_idx);