From f31d402c5ad199cb5e3066e71495ca3dca5cd665 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sun, 3 Dec 1995 18:59:55 +0000 Subject: [PATCH] Fixed the type mismatch in check for the bogus mmap function `nullop'. The test should never succeed and should go away. Temporarily print a warning if it does succeed. --- sys/vm/device_pager.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c index 9fd69c8d4050..a892c994a0ac 100644 --- a/sys/vm/device_pager.c +++ b/sys/vm/device_pager.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)device_pager.c 8.1 (Berkeley) 6/11/93 - * $Id: device_pager.c,v 1.13 1995/11/06 00:36:19 bde Exp $ + * $Id: device_pager.c,v 1.14 1995/12/03 12:18:30 bde Exp $ */ #include @@ -94,8 +94,10 @@ dev_pager_alloc(handle, size, prot, foff) */ dev = (dev_t) (u_long) handle; mapfunc = cdevsw[major(dev)].d_mmap; - if (mapfunc == NULL || mapfunc == nullop) + if (mapfunc == NULL || mapfunc == (d_mmap_t *)nullop) { + printf("obsolete map function %p\n", (void *)mapfunc); return (NULL); + } /* * Offset should be page aligned. @@ -187,7 +189,7 @@ dev_pager_getpages(object, m, count, reqpage) prot = PROT_READ; /* XXX should pass in? */ mapfunc = cdevsw[major(dev)].d_mmap; - if (mapfunc == NULL || mapfunc == nullop) + if (mapfunc == NULL || mapfunc == (d_mmap_t *)nullop) panic("dev_pager_getpage: no map function"); paddr = pmap_phys_address((*mapfunc) ((dev_t) dev, (int) offset, prot));