From 685c54fc6abcff47d67faa9ebeadd8fb836936ff Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Fri, 24 Nov 2017 11:36:35 +0000 Subject: [PATCH] amd-vi: use correct type for pci_rid, start_dev_rid, end_dev_rid sysctls Previously, the values could look confusing because of unrelated bits from adjacent memory. Reviewed by: anish --- sys/amd64/vmm/amd/amdvi_hw.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sys/amd64/vmm/amd/amdvi_hw.c b/sys/amd64/vmm/amd/amdvi_hw.c index af6ebb51bbc..3478262a734 100644 --- a/sys/amd64/vmm/amd/amdvi_hw.c +++ b/sys/amd64/vmm/amd/amdvi_hw.c @@ -989,15 +989,12 @@ amdvi_add_sysctl(struct amdvi_softc *softc) &softc->event_intr_cnt, "Event interrupt count"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "command_count", CTLFLAG_RD, &softc->total_cmd, "Command submitted count"); - SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "pci_rid", CTLFLAG_RD, - (int *)&softc->pci_rid, 0, - "IOMMU RID"); - SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "start_dev_rid", CTLFLAG_RD, - (int *)&softc->start_dev_rid, 0, - "Start of device under this IOMMU"); - SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "end_dev_rid", CTLFLAG_RD, - (int *)&softc->end_dev_rid, 0, - "End of device under this IOMMU"); + SYSCTL_ADD_U16(ctx, child, OID_AUTO, "pci_rid", CTLFLAG_RD, + &softc->pci_rid, 0, "IOMMU RID"); + SYSCTL_ADD_U16(ctx, child, OID_AUTO, "start_dev_rid", CTLFLAG_RD, + &softc->start_dev_rid, 0, "Start of device under this IOMMU"); + SYSCTL_ADD_U16(ctx, child, OID_AUTO, "end_dev_rid", CTLFLAG_RD, + &softc->end_dev_rid, 0, "End of device under this IOMMU"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "command_head", CTLTYPE_UINT | CTLFLAG_RD, softc, 0, amdvi_handle_sysctl, "IU", "Command head");