From b63438c4e33149cf1dfd6f0ffb151e4dd0a65ce7 Mon Sep 17 00:00:00 2001 From: Benjamin Romer Date: Tue, 4 Nov 2014 11:25:15 -0500 Subject: [PATCH] staging: unisys: remove typedef for MEMREGION Remove the typedef for this structure and just use struct memregion instead. Signed-off-by: Benjamin Romer Signed-off-by: Greg Kroah-Hartman --- .../unisys/visorchannel/visorchannel.h | 2 +- .../unisys/visorchannel/visorchannel_funcs.c | 6 +-- drivers/staging/unisys/visorchipset/parser.c | 2 +- drivers/staging/unisys/visorutil/memregion.h | 28 ++++++------- .../unisys/visorutil/memregion_direct.c | 41 ++++++++++--------- 5 files changed, 40 insertions(+), 39 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel.h b/drivers/staging/unisys/visorchannel/visorchannel.h index 9a4d7b6755d1..5061edff959a 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel.h +++ b/drivers/staging/unisys/visorchannel/visorchannel.h @@ -66,7 +66,7 @@ char *visorchannel_id(VISORCHANNEL *channel, char *s); char *visorchannel_zoneid(VISORCHANNEL *channel, char *s); u64 visorchannel_get_clientpartition(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); void visorchannel_debug(VISORCHANNEL *channel, int nQueues, struct seq_file *seq, u32 off); diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 5fbd5ada52e9..a50251a986a1 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -29,7 +29,7 @@ #define MYDRVNAME "visorchannel" struct VISORCHANNEL_Tag { - MEMREGION *memregion; /* from visor_memregion_create() */ + struct memregion *memregion; /* from visor_memregion_create() */ struct channel_header chan_hdr; uuid_le guid; ulong size; @@ -212,7 +212,7 @@ visorchannel_get_uuid(VISORCHANNEL *channel) } EXPORT_SYMBOL_GPL(visorchannel_get_uuid); -MEMREGION * +struct memregion * visorchannel_get_memregion(VISORCHANNEL *channel) { return channel->memregion; @@ -565,7 +565,7 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues, { HOSTADDRESS addr = 0; ulong nbytes = 0, nbytes_region = 0; - MEMREGION *memregion = NULL; + struct memregion *memregion = NULL; struct channel_header hdr; struct channel_header *phdr = &hdr; int i = 0; diff --git a/drivers/staging/unisys/visorchipset/parser.c b/drivers/staging/unisys/visorchipset/parser.c index 6c2eac0346b6..9edbd3bbd186 100644 --- a/drivers/staging/unisys/visorchipset/parser.c +++ b/drivers/staging/unisys/visorchipset/parser.c @@ -47,7 +47,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal, int allocbytes = sizeof(PARSER_CONTEXT) + bytes; PARSER_CONTEXT *rc = NULL; PARSER_CONTEXT *ctx = NULL; - MEMREGION *rgn = NULL; + struct memregion *rgn = NULL; struct spar_controlvm_parameters_header *phdr = NULL; if (tryAgain) diff --git a/drivers/staging/unisys/visorutil/memregion.h b/drivers/staging/unisys/visorutil/memregion.h index f4a65d2fcf02..0c3eebcf6d50 100644 --- a/drivers/staging/unisys/visorutil/memregion.h +++ b/drivers/staging/unisys/visorutil/memregion.h @@ -20,24 +20,24 @@ #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. */ -typedef struct MEMREGION_Tag MEMREGION; +struct memregion; -MEMREGION *visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes); -MEMREGION *visor_memregion_create_overlapped(MEMREGION *parent, - ulong offset, ulong nbytes); -int visor_memregion_resize(MEMREGION *memregion, ulong newsize); -int visor_memregion_read(MEMREGION *memregion, - ulong offset, void *dest, ulong nbytes); -int visor_memregion_write(MEMREGION *memregion, +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_read(struct memregion *memregion, + ulong offset, void *dest, ulong nbytes); +int visor_memregion_write(struct memregion *memregion, ulong offset, void *src, ulong nbytes); -void visor_memregion_destroy(MEMREGION *memregion); -HOSTADDRESS visor_memregion_get_physaddr(MEMREGION *memregion); -ulong visor_memregion_get_nbytes(MEMREGION *memregion); -void memregion_dump(MEMREGION *memregion, char *s, +void visor_memregion_destroy(struct memregion *memregion); +HOSTADDRESS visor_memregion_get_physaddr(struct memregion *memregion); +ulong visor_memregion_get_nbytes(struct memregion *memregion); +void memregion_dump(struct memregion *memregion, char *s, 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 diff --git a/drivers/staging/unisys/visorutil/memregion_direct.c b/drivers/staging/unisys/visorutil/memregion_direct.c index 65bc07b947db..73228d2da30f 100644 --- a/drivers/staging/unisys/visorutil/memregion_direct.c +++ b/drivers/staging/unisys/visorutil/memregion_direct.c @@ -26,7 +26,7 @@ #define MYDRVNAME "memregion" -struct MEMREGION_Tag { +struct memregion { HOSTADDRESS physaddr; ulong nbytes; void __iomem *mapped; @@ -34,14 +34,14 @@ struct MEMREGION_Tag { BOOL overlapped; }; -static BOOL mapit(MEMREGION *memregion); -static void unmapit(MEMREGION *memregion); +static BOOL mapit(struct memregion *memregion); +static void unmapit(struct memregion *memregion); -MEMREGION * +struct memregion * visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes) { - MEMREGION *rc = NULL; - MEMREGION *memregion = kzalloc(sizeof(MEMREGION), + struct memregion *rc = NULL; + struct memregion *memregion = kzalloc(sizeof(struct memregion), GFP_KERNEL | __GFP_NORETRY); if (memregion == NULL) { ERRDRV("visor_memregion_create allocation failed"); @@ -66,10 +66,11 @@ Away: } EXPORT_SYMBOL_GPL(visor_memregion_create); -MEMREGION * -visor_memregion_create_overlapped(MEMREGION *parent, ulong offset, ulong nbytes) +struct memregion * +visor_memregion_create_overlapped(struct memregion *parent, ulong offset, + ulong nbytes) { - MEMREGION *memregion = NULL; + struct memregion *memregion = NULL; if (parent == NULL) { ERRDRV("%s parent is NULL", __func__); @@ -85,7 +86,7 @@ visor_memregion_create_overlapped(MEMREGION *parent, ulong offset, ulong nbytes) __func__, offset, nbytes); return NULL; } - memregion = kzalloc(sizeof(MEMREGION), GFP_KERNEL|__GFP_NORETRY); + memregion = kzalloc(sizeof(struct memregion), GFP_KERNEL|__GFP_NORETRY); if (memregion == NULL) { ERRDRV("%s allocation failed", __func__); return NULL; @@ -102,7 +103,7 @@ EXPORT_SYMBOL_GPL(visor_memregion_create_overlapped); static BOOL -mapit(MEMREGION *memregion) +mapit(struct memregion *memregion) { ulong physaddr = (ulong) (memregion->physaddr); ulong nbytes = memregion->nbytes; @@ -122,7 +123,7 @@ mapit(MEMREGION *memregion) } static void -unmapit(MEMREGION *memregion) +unmapit(struct memregion *memregion) { if (memregion->mapped != NULL) { iounmap(memregion->mapped); @@ -136,28 +137,28 @@ unmapit(MEMREGION *memregion) } HOSTADDRESS -visor_memregion_get_physaddr(MEMREGION *memregion) +visor_memregion_get_physaddr(struct memregion *memregion) { return memregion->physaddr; } EXPORT_SYMBOL_GPL(visor_memregion_get_physaddr); ulong -visor_memregion_get_nbytes(MEMREGION *memregion) +visor_memregion_get_nbytes(struct memregion *memregion) { return memregion->nbytes; } EXPORT_SYMBOL_GPL(visor_memregion_get_nbytes); void __iomem * -visor_memregion_get_pointer(MEMREGION *memregion) +visor_memregion_get_pointer(struct memregion *memregion) { return memregion->mapped; } EXPORT_SYMBOL_GPL(visor_memregion_get_pointer); int -visor_memregion_resize(MEMREGION *memregion, ulong newsize) +visor_memregion_resize(struct memregion *memregion, ulong newsize) { if (newsize == memregion->nbytes) return 0; @@ -179,7 +180,7 @@ EXPORT_SYMBOL_GPL(visor_memregion_resize); static int memregion_readwrite(BOOL is_write, - MEMREGION *memregion, ulong offset, + struct memregion *memregion, ulong offset, void *local, ulong nbytes) { if (offset + nbytes > memregion->nbytes) { @@ -195,7 +196,7 @@ memregion_readwrite(BOOL is_write, } int -visor_memregion_read(MEMREGION *memregion, ulong offset, void *dest, +visor_memregion_read(struct memregion *memregion, ulong offset, void *dest, ulong nbytes) { return memregion_readwrite(FALSE, memregion, offset, dest, nbytes); @@ -203,7 +204,7 @@ visor_memregion_read(MEMREGION *memregion, ulong offset, void *dest, EXPORT_SYMBOL_GPL(visor_memregion_read); int -visor_memregion_write(MEMREGION *memregion, ulong offset, void *src, +visor_memregion_write(struct memregion *memregion, ulong offset, void *src, ulong nbytes) { return memregion_readwrite(TRUE, memregion, offset, src, nbytes); @@ -211,7 +212,7 @@ visor_memregion_write(MEMREGION *memregion, ulong offset, void *src, EXPORT_SYMBOL_GPL(visor_memregion_write); void -visor_memregion_destroy(MEMREGION *memregion) +visor_memregion_destroy(struct memregion *memregion) { if (memregion == NULL) return; -- 2.20.1