Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jun 2009 17:06:08 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r194017 - head/sys/dev/agp
Message-ID:  <200906111706.n5BH68sn054015@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Thu Jun 11 17:06:07 2009
New Revision: 194017
URL: http://svn.freebsd.org/changeset/base/194017

Log:
  strict kobj signatures: fixes in agp driver
  
  offset parameter has vm_offset_t type in calling code and in kobj method
  
  Reviewed by:	imp, rnoland, lulf, current@
  Approved by:	jhb (mentor)

Modified:
  head/sys/dev/agp/agp_ali.c
  head/sys/dev/agp/agp_amd.c
  head/sys/dev/agp/agp_ati.c
  head/sys/dev/agp/agp_nvidia.c
  head/sys/dev/agp/agp_sis.c

Modified: head/sys/dev/agp/agp_ali.c
==============================================================================
--- head/sys/dev/agp/agp_ali.c	Thu Jun 11 17:05:45 2009	(r194016)
+++ head/sys/dev/agp/agp_ali.c	Thu Jun 11 17:06:07 2009	(r194017)
@@ -206,11 +206,11 @@ agp_ali_set_aperture(device_t dev, u_int
 }
 
 static int
-agp_ali_bind_page(device_t dev, int offset, vm_offset_t physical)
+agp_ali_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical)
 {
 	struct agp_ali_softc *sc = device_get_softc(dev);
 
-	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
 		return EINVAL;
 
 	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical;
@@ -218,11 +218,11 @@ agp_ali_bind_page(device_t dev, int offs
 }
 
 static int
-agp_ali_unbind_page(device_t dev, int offset)
+agp_ali_unbind_page(device_t dev, vm_offset_t offset)
 {
 	struct agp_ali_softc *sc = device_get_softc(dev);
 
-	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
 		return EINVAL;
 
 	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0;

Modified: head/sys/dev/agp/agp_amd.c
==============================================================================
--- head/sys/dev/agp/agp_amd.c	Thu Jun 11 17:05:45 2009	(r194016)
+++ head/sys/dev/agp/agp_amd.c	Thu Jun 11 17:06:07 2009	(r194017)
@@ -342,11 +342,11 @@ agp_amd_set_aperture(device_t dev, u_int
 }
 
 static int
-agp_amd_bind_page(device_t dev, int offset, vm_offset_t physical)
+agp_amd_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical)
 {
 	struct agp_amd_softc *sc = device_get_softc(dev);
 
-	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
 		return EINVAL;
 
 	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical | 1;
@@ -357,11 +357,11 @@ agp_amd_bind_page(device_t dev, int offs
 }
 
 static int
-agp_amd_unbind_page(device_t dev, int offset)
+agp_amd_unbind_page(device_t dev, vm_offset_t offset)
 {
 	struct agp_amd_softc *sc = device_get_softc(dev);
 
-	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
 		return EINVAL;
 
 	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0;

Modified: head/sys/dev/agp/agp_ati.c
==============================================================================
--- head/sys/dev/agp/agp_ati.c	Thu Jun 11 17:05:45 2009	(r194016)
+++ head/sys/dev/agp/agp_ati.c	Thu Jun 11 17:06:07 2009	(r194017)
@@ -315,11 +315,11 @@ agp_ati_set_aperture(device_t dev, u_int
 }
 
 static int
-agp_ati_bind_page(device_t dev, int offset, vm_offset_t physical)
+agp_ati_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical)
 {
 	struct agp_ati_softc *sc = device_get_softc(dev);
 
-	if (offset < 0 || offset >= (sc->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->ag_entries << AGP_PAGE_SHIFT))
 		return EINVAL;
 
 	sc->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical | 1;
@@ -328,11 +328,11 @@ agp_ati_bind_page(device_t dev, int offs
 }
 
 static int
-agp_ati_unbind_page(device_t dev, int offset)
+agp_ati_unbind_page(device_t dev, vm_offset_t offset)
 {
 	struct agp_ati_softc *sc = device_get_softc(dev);
 
-	if (offset < 0 || offset >= (sc->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->ag_entries << AGP_PAGE_SHIFT))
 		return EINVAL;
 
 	sc->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0;

Modified: head/sys/dev/agp/agp_nvidia.c
==============================================================================
--- head/sys/dev/agp/agp_nvidia.c	Thu Jun 11 17:05:45 2009	(r194016)
+++ head/sys/dev/agp/agp_nvidia.c	Thu Jun 11 17:06:07 2009	(r194017)
@@ -90,8 +90,8 @@ static int agp_nvidia_attach(device_t);
 static int agp_nvidia_detach(device_t);
 static u_int32_t agp_nvidia_get_aperture(device_t);
 static int agp_nvidia_set_aperture(device_t, u_int32_t);
-static int agp_nvidia_bind_page(device_t, int, vm_offset_t);
-static int agp_nvidia_unbind_page(device_t, int);
+static int agp_nvidia_bind_page(device_t, vm_offset_t, vm_offset_t);
+static int agp_nvidia_unbind_page(device_t, vm_offset_t);
 
 static int nvidia_init_iorr(u_int32_t, u_int32_t);
 
@@ -312,12 +312,12 @@ agp_nvidia_set_aperture(device_t dev, u_
 }
 
 static int
-agp_nvidia_bind_page(device_t dev, int offset, vm_offset_t physical)
+agp_nvidia_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical)
 {
 	struct agp_nvidia_softc *sc = device_get_softc(dev);
 	u_int32_t index;
 
-	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
 		return (EINVAL);
 
 	index = (sc->pg_offset + offset) >> AGP_PAGE_SHIFT;
@@ -327,12 +327,12 @@ agp_nvidia_bind_page(device_t dev, int o
 }
 
 static int
-agp_nvidia_unbind_page(device_t dev, int offset)
+agp_nvidia_unbind_page(device_t dev, vm_offset_t offset)
 {
 	struct agp_nvidia_softc *sc = device_get_softc(dev);
 	u_int32_t index;
 
-	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
 		return (EINVAL);
 
 	index = (sc->pg_offset + offset) >> AGP_PAGE_SHIFT;
@@ -341,8 +341,8 @@ agp_nvidia_unbind_page(device_t dev, int
 	return (0);
 }
 
-static int
-agp_nvidia_flush_tlb (device_t dev, int offset)
+static void
+agp_nvidia_flush_tlb (device_t dev)
 {
 	struct agp_nvidia_softc *sc;
 	u_int32_t wbc_reg, temp;
@@ -378,8 +378,6 @@ agp_nvidia_flush_tlb (device_t dev, int 
 		temp = ag_virtual[i * PAGE_SIZE / sizeof(u_int32_t)];
 	for(i = 0; i < pages; i++)
 		temp = ag_virtual[i * PAGE_SIZE / sizeof(u_int32_t)];
-
-	return (0);
 }
 
 #define	SYSCFG		0xC0010010

Modified: head/sys/dev/agp/agp_sis.c
==============================================================================
--- head/sys/dev/agp/agp_sis.c	Thu Jun 11 17:05:45 2009	(r194016)
+++ head/sys/dev/agp/agp_sis.c	Thu Jun 11 17:06:07 2009	(r194017)
@@ -227,11 +227,11 @@ agp_sis_set_aperture(device_t dev, u_int
 }
 
 static int
-agp_sis_bind_page(device_t dev, int offset, vm_offset_t physical)
+agp_sis_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical)
 {
 	struct agp_sis_softc *sc = device_get_softc(dev);
 
-	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
 		return EINVAL;
 
 	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical;
@@ -239,11 +239,11 @@ agp_sis_bind_page(device_t dev, int offs
 }
 
 static int
-agp_sis_unbind_page(device_t dev, int offset)
+agp_sis_unbind_page(device_t dev, vm_offset_t offset)
 {
 	struct agp_sis_softc *sc = device_get_softc(dev);
 
-	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+	if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
 		return EINVAL;
 
 	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906111706.n5BH68sn054015>