Commit 670f56ca authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: unisys: memregion: Nothing uses overlap allocations, so nuke it

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 246cff65
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
struct memregion; struct memregion;
struct memregion *visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes); struct memregion *visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes);
struct memregion *visor_memregion_create_overlapped(struct memregion *parent,
ulong offset, ulong nbytes);
int visor_memregion_resize(struct memregion *memregion, ulong newsize); int visor_memregion_resize(struct memregion *memregion, ulong newsize);
int visor_memregion_read(struct memregion *memregion, int visor_memregion_read(struct memregion *memregion,
ulong offset, void *dest, ulong nbytes); ulong offset, void *dest, ulong nbytes);
......
...@@ -30,7 +30,6 @@ struct memregion { ...@@ -30,7 +30,6 @@ struct memregion {
ulong nbytes; ulong nbytes;
void __iomem *mapped; void __iomem *mapped;
BOOL requested; BOOL requested;
BOOL overlapped;
}; };
static BOOL mapit(struct memregion *memregion); static BOOL mapit(struct memregion *memregion);
...@@ -48,7 +47,6 @@ visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes) ...@@ -48,7 +47,6 @@ visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes)
memregion->physaddr = physaddr; memregion->physaddr = physaddr;
memregion->nbytes = nbytes; memregion->nbytes = nbytes;
memregion->overlapped = FALSE;
if (!mapit(memregion)) { if (!mapit(memregion)) {
rc = NULL; rc = NULL;
goto cleanup; goto cleanup;
...@@ -63,35 +61,6 @@ visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes) ...@@ -63,35 +61,6 @@ visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes)
} }
EXPORT_SYMBOL_GPL(visor_memregion_create); EXPORT_SYMBOL_GPL(visor_memregion_create);
struct memregion *
visor_memregion_create_overlapped(struct memregion *parent, ulong offset,
ulong nbytes)
{
struct memregion *memregion = NULL;
if (parent == NULL)
return NULL;
if (parent->mapped == NULL)
return NULL;
if ((offset >= parent->nbytes) ||
((offset + nbytes) >= parent->nbytes))
return NULL;
memregion = kzalloc(sizeof(*memregion), GFP_KERNEL|__GFP_NORETRY);
if (memregion == NULL)
return NULL;
memregion->physaddr = parent->physaddr + offset;
memregion->nbytes = nbytes;
memregion->mapped = ((u8 __iomem *)(parent->mapped)) + offset;
memregion->requested = FALSE;
memregion->overlapped = TRUE;
return memregion;
}
EXPORT_SYMBOL_GPL(visor_memregion_create_overlapped);
static BOOL static BOOL
mapit(struct memregion *memregion) mapit(struct memregion *memregion)
{ {
...@@ -147,17 +116,12 @@ visor_memregion_resize(struct memregion *memregion, ulong newsize) ...@@ -147,17 +116,12 @@ visor_memregion_resize(struct memregion *memregion, ulong newsize)
{ {
if (newsize == memregion->nbytes) if (newsize == memregion->nbytes)
return 0; return 0;
if (memregion->overlapped)
/* no error check here - we no longer know the unmapit(memregion);
* parent's range! memregion->nbytes = newsize;
*/ if (!mapit(memregion))
memregion->nbytes = newsize; return -EIO;
else {
unmapit(memregion);
memregion->nbytes = newsize;
if (!mapit(memregion))
return -EIO;
}
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(visor_memregion_resize); EXPORT_SYMBOL_GPL(visor_memregion_resize);
...@@ -199,9 +163,7 @@ visor_memregion_destroy(struct memregion *memregion) ...@@ -199,9 +163,7 @@ visor_memregion_destroy(struct memregion *memregion)
{ {
if (!memregion) if (!memregion)
return; return;
if (!memregion->overlapped) unmapit(memregion);
unmapit(memregion);
kfree(memregion); kfree(memregion);
} }
EXPORT_SYMBOL_GPL(visor_memregion_destroy); EXPORT_SYMBOL_GPL(visor_memregion_destroy);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment