Commit b63438c4 authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: remove typedef for MEMREGION

Remove the typedef for this structure and just use struct memregion instead.
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 71462507
...@@ -66,7 +66,7 @@ char *visorchannel_id(VISORCHANNEL *channel, char *s); ...@@ -66,7 +66,7 @@ char *visorchannel_id(VISORCHANNEL *channel, char *s);
char *visorchannel_zoneid(VISORCHANNEL *channel, char *s); char *visorchannel_zoneid(VISORCHANNEL *channel, char *s);
u64 visorchannel_get_clientpartition(VISORCHANNEL *channel); u64 visorchannel_get_clientpartition(VISORCHANNEL *channel);
uuid_le visorchannel_get_uuid(VISORCHANNEL *channel); uuid_le visorchannel_get_uuid(VISORCHANNEL *channel);
MEMREGION *visorchannel_get_memregion(VISORCHANNEL *channel); struct memregion *visorchannel_get_memregion(VISORCHANNEL *channel);
char *visorchannel_uuid_id(uuid_le *guid, char *s); char *visorchannel_uuid_id(uuid_le *guid, char *s);
void visorchannel_debug(VISORCHANNEL *channel, int nQueues, void visorchannel_debug(VISORCHANNEL *channel, int nQueues,
struct seq_file *seq, u32 off); struct seq_file *seq, u32 off);
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#define MYDRVNAME "visorchannel" #define MYDRVNAME "visorchannel"
struct VISORCHANNEL_Tag { struct VISORCHANNEL_Tag {
MEMREGION *memregion; /* from visor_memregion_create() */ struct memregion *memregion; /* from visor_memregion_create() */
struct channel_header chan_hdr; struct channel_header chan_hdr;
uuid_le guid; uuid_le guid;
ulong size; ulong size;
...@@ -212,7 +212,7 @@ visorchannel_get_uuid(VISORCHANNEL *channel) ...@@ -212,7 +212,7 @@ visorchannel_get_uuid(VISORCHANNEL *channel)
} }
EXPORT_SYMBOL_GPL(visorchannel_get_uuid); EXPORT_SYMBOL_GPL(visorchannel_get_uuid);
MEMREGION * struct memregion *
visorchannel_get_memregion(VISORCHANNEL *channel) visorchannel_get_memregion(VISORCHANNEL *channel)
{ {
return channel->memregion; return channel->memregion;
...@@ -565,7 +565,7 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues, ...@@ -565,7 +565,7 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues,
{ {
HOSTADDRESS addr = 0; HOSTADDRESS addr = 0;
ulong nbytes = 0, nbytes_region = 0; ulong nbytes = 0, nbytes_region = 0;
MEMREGION *memregion = NULL; struct memregion *memregion = NULL;
struct channel_header hdr; struct channel_header hdr;
struct channel_header *phdr = &hdr; struct channel_header *phdr = &hdr;
int i = 0; int i = 0;
......
...@@ -47,7 +47,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal, ...@@ -47,7 +47,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
int allocbytes = sizeof(PARSER_CONTEXT) + bytes; int allocbytes = sizeof(PARSER_CONTEXT) + bytes;
PARSER_CONTEXT *rc = NULL; PARSER_CONTEXT *rc = NULL;
PARSER_CONTEXT *ctx = NULL; PARSER_CONTEXT *ctx = NULL;
MEMREGION *rgn = NULL; struct memregion *rgn = NULL;
struct spar_controlvm_parameters_header *phdr = NULL; struct spar_controlvm_parameters_header *phdr = NULL;
if (tryAgain) if (tryAgain)
......
...@@ -20,24 +20,24 @@ ...@@ -20,24 +20,24 @@
#include "timskmod.h" #include "timskmod.h"
/* MEMREGION is an opaque structure to users. /* struct memregion is an opaque structure to users.
* Fields are declared only in the implementation .c files. * Fields are declared only in the implementation .c files.
*/ */
typedef struct MEMREGION_Tag MEMREGION; struct memregion;
MEMREGION *visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes); struct memregion *visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes);
MEMREGION *visor_memregion_create_overlapped(MEMREGION *parent, struct memregion *visor_memregion_create_overlapped(struct memregion *parent,
ulong offset, ulong nbytes); ulong offset, ulong nbytes);
int visor_memregion_resize(MEMREGION *memregion, ulong newsize); int visor_memregion_resize(struct memregion *memregion, ulong newsize);
int visor_memregion_read(MEMREGION *memregion, int visor_memregion_read(struct memregion *memregion,
ulong offset, void *dest, ulong nbytes); ulong offset, void *dest, ulong nbytes);
int visor_memregion_write(MEMREGION *memregion, int visor_memregion_write(struct memregion *memregion,
ulong offset, void *src, ulong nbytes); ulong offset, void *src, ulong nbytes);
void visor_memregion_destroy(MEMREGION *memregion); void visor_memregion_destroy(struct memregion *memregion);
HOSTADDRESS visor_memregion_get_physaddr(MEMREGION *memregion); HOSTADDRESS visor_memregion_get_physaddr(struct memregion *memregion);
ulong visor_memregion_get_nbytes(MEMREGION *memregion); ulong visor_memregion_get_nbytes(struct memregion *memregion);
void memregion_dump(MEMREGION *memregion, char *s, void memregion_dump(struct memregion *memregion, char *s,
ulong off, ulong len, struct seq_file *seq); ulong off, ulong len, struct seq_file *seq);
void __iomem *visor_memregion_get_pointer(MEMREGION *memregion); void __iomem *visor_memregion_get_pointer(struct memregion *memregion);
#endif #endif
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#define MYDRVNAME "memregion" #define MYDRVNAME "memregion"
struct MEMREGION_Tag { struct memregion {
HOSTADDRESS physaddr; HOSTADDRESS physaddr;
ulong nbytes; ulong nbytes;
void __iomem *mapped; void __iomem *mapped;
...@@ -34,14 +34,14 @@ struct MEMREGION_Tag { ...@@ -34,14 +34,14 @@ struct MEMREGION_Tag {
BOOL overlapped; BOOL overlapped;
}; };
static BOOL mapit(MEMREGION *memregion); static BOOL mapit(struct memregion *memregion);
static void unmapit(MEMREGION *memregion); static void unmapit(struct memregion *memregion);
MEMREGION * struct memregion *
visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes) visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes)
{ {
MEMREGION *rc = NULL; struct memregion *rc = NULL;
MEMREGION *memregion = kzalloc(sizeof(MEMREGION), struct memregion *memregion = kzalloc(sizeof(struct memregion),
GFP_KERNEL | __GFP_NORETRY); GFP_KERNEL | __GFP_NORETRY);
if (memregion == NULL) { if (memregion == NULL) {
ERRDRV("visor_memregion_create allocation failed"); ERRDRV("visor_memregion_create allocation failed");
...@@ -66,10 +66,11 @@ visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes) ...@@ -66,10 +66,11 @@ visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes)
} }
EXPORT_SYMBOL_GPL(visor_memregion_create); EXPORT_SYMBOL_GPL(visor_memregion_create);
MEMREGION * struct memregion *
visor_memregion_create_overlapped(MEMREGION *parent, ulong offset, ulong nbytes) visor_memregion_create_overlapped(struct memregion *parent, ulong offset,
ulong nbytes)
{ {
MEMREGION *memregion = NULL; struct memregion *memregion = NULL;
if (parent == NULL) { if (parent == NULL) {
ERRDRV("%s parent is NULL", __func__); ERRDRV("%s parent is NULL", __func__);
...@@ -85,7 +86,7 @@ visor_memregion_create_overlapped(MEMREGION *parent, ulong offset, ulong nbytes) ...@@ -85,7 +86,7 @@ visor_memregion_create_overlapped(MEMREGION *parent, ulong offset, ulong nbytes)
__func__, offset, nbytes); __func__, offset, nbytes);
return NULL; return NULL;
} }
memregion = kzalloc(sizeof(MEMREGION), GFP_KERNEL|__GFP_NORETRY); memregion = kzalloc(sizeof(struct memregion), GFP_KERNEL|__GFP_NORETRY);
if (memregion == NULL) { if (memregion == NULL) {
ERRDRV("%s allocation failed", __func__); ERRDRV("%s allocation failed", __func__);
return NULL; return NULL;
...@@ -102,7 +103,7 @@ EXPORT_SYMBOL_GPL(visor_memregion_create_overlapped); ...@@ -102,7 +103,7 @@ EXPORT_SYMBOL_GPL(visor_memregion_create_overlapped);
static BOOL static BOOL
mapit(MEMREGION *memregion) mapit(struct memregion *memregion)
{ {
ulong physaddr = (ulong) (memregion->physaddr); ulong physaddr = (ulong) (memregion->physaddr);
ulong nbytes = memregion->nbytes; ulong nbytes = memregion->nbytes;
...@@ -122,7 +123,7 @@ mapit(MEMREGION *memregion) ...@@ -122,7 +123,7 @@ mapit(MEMREGION *memregion)
} }
static void static void
unmapit(MEMREGION *memregion) unmapit(struct memregion *memregion)
{ {
if (memregion->mapped != NULL) { if (memregion->mapped != NULL) {
iounmap(memregion->mapped); iounmap(memregion->mapped);
...@@ -136,28 +137,28 @@ unmapit(MEMREGION *memregion) ...@@ -136,28 +137,28 @@ unmapit(MEMREGION *memregion)
} }
HOSTADDRESS HOSTADDRESS
visor_memregion_get_physaddr(MEMREGION *memregion) visor_memregion_get_physaddr(struct memregion *memregion)
{ {
return memregion->physaddr; return memregion->physaddr;
} }
EXPORT_SYMBOL_GPL(visor_memregion_get_physaddr); EXPORT_SYMBOL_GPL(visor_memregion_get_physaddr);
ulong ulong
visor_memregion_get_nbytes(MEMREGION *memregion) visor_memregion_get_nbytes(struct memregion *memregion)
{ {
return memregion->nbytes; return memregion->nbytes;
} }
EXPORT_SYMBOL_GPL(visor_memregion_get_nbytes); EXPORT_SYMBOL_GPL(visor_memregion_get_nbytes);
void __iomem * void __iomem *
visor_memregion_get_pointer(MEMREGION *memregion) visor_memregion_get_pointer(struct memregion *memregion)
{ {
return memregion->mapped; return memregion->mapped;
} }
EXPORT_SYMBOL_GPL(visor_memregion_get_pointer); EXPORT_SYMBOL_GPL(visor_memregion_get_pointer);
int int
visor_memregion_resize(MEMREGION *memregion, ulong newsize) visor_memregion_resize(struct memregion *memregion, ulong newsize)
{ {
if (newsize == memregion->nbytes) if (newsize == memregion->nbytes)
return 0; return 0;
...@@ -179,7 +180,7 @@ EXPORT_SYMBOL_GPL(visor_memregion_resize); ...@@ -179,7 +180,7 @@ EXPORT_SYMBOL_GPL(visor_memregion_resize);
static int static int
memregion_readwrite(BOOL is_write, memregion_readwrite(BOOL is_write,
MEMREGION *memregion, ulong offset, struct memregion *memregion, ulong offset,
void *local, ulong nbytes) void *local, ulong nbytes)
{ {
if (offset + nbytes > memregion->nbytes) { if (offset + nbytes > memregion->nbytes) {
...@@ -195,7 +196,7 @@ memregion_readwrite(BOOL is_write, ...@@ -195,7 +196,7 @@ memregion_readwrite(BOOL is_write,
} }
int int
visor_memregion_read(MEMREGION *memregion, ulong offset, void *dest, visor_memregion_read(struct memregion *memregion, ulong offset, void *dest,
ulong nbytes) ulong nbytes)
{ {
return memregion_readwrite(FALSE, memregion, offset, dest, nbytes); return memregion_readwrite(FALSE, memregion, offset, dest, nbytes);
...@@ -203,7 +204,7 @@ visor_memregion_read(MEMREGION *memregion, ulong offset, void *dest, ...@@ -203,7 +204,7 @@ visor_memregion_read(MEMREGION *memregion, ulong offset, void *dest,
EXPORT_SYMBOL_GPL(visor_memregion_read); EXPORT_SYMBOL_GPL(visor_memregion_read);
int int
visor_memregion_write(MEMREGION *memregion, ulong offset, void *src, visor_memregion_write(struct memregion *memregion, ulong offset, void *src,
ulong nbytes) ulong nbytes)
{ {
return memregion_readwrite(TRUE, memregion, offset, src, nbytes); return memregion_readwrite(TRUE, memregion, offset, src, nbytes);
...@@ -211,7 +212,7 @@ visor_memregion_write(MEMREGION *memregion, ulong offset, void *src, ...@@ -211,7 +212,7 @@ visor_memregion_write(MEMREGION *memregion, ulong offset, void *src,
EXPORT_SYMBOL_GPL(visor_memregion_write); EXPORT_SYMBOL_GPL(visor_memregion_write);
void void
visor_memregion_destroy(MEMREGION *memregion) visor_memregion_destroy(struct memregion *memregion)
{ {
if (memregion == NULL) if (memregion == NULL)
return; return;
......
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