svn commit: r326157 - head/sys/amd64/vmm/amd

Andriy Gapon avg at FreeBSD.org
Fri Nov 24 11:36:36 UTC 2017


Author: avg
Date: Fri Nov 24 11:36:35 2017
New Revision: 326157
URL: https://svnweb.freebsd.org/changeset/base/326157

Log:
  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

Modified:
  head/sys/amd64/vmm/amd/amdvi_hw.c

Modified: head/sys/amd64/vmm/amd/amdvi_hw.c
==============================================================================
--- head/sys/amd64/vmm/amd/amdvi_hw.c	Fri Nov 24 11:35:43 2017	(r326156)
+++ head/sys/amd64/vmm/amd/amdvi_hw.c	Fri Nov 24 11:36:35 2017	(r326157)
@@ -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");


More information about the svn-src-all mailing list