From 317d9614a980fedfe89408030bdd92cc0f4d0dc4 Mon Sep 17 00:00:00 2001 From: Benjamin Romer Date: Mon, 16 Mar 2015 13:57:51 -0400 Subject: [PATCH] staging: unisys: remove typedef for PARSER_CONTEXT Convert all references to PARSER_CONTEXT into struct parser_context. Signed-off-by: Benjamin Romer Signed-off-by: Greg Kroah-Hartman --- drivers/staging/unisys/visorchipset/parser.c | 28 +++++++++---------- drivers/staging/unisys/visorchipset/parser.h | 22 +++++++-------- .../unisys/visorchipset/visorchipset_main.c | 9 +++--- 3 files changed, 30 insertions(+), 29 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/parser.c b/drivers/staging/unisys/visorchipset/parser.c index 959d540eef52..056facd24f54 100644 --- a/drivers/staging/unisys/visorchipset/parser.c +++ b/drivers/staging/unisys/visorchipset/parser.c @@ -31,7 +31,7 @@ #define MAX_CONTROLVM_PAYLOAD_BYTES (1024*128) static ulong controlvm_payload_bytes_buffered; -struct PARSER_CONTEXT_Tag { +struct parser_context { ulong allocbytes; ulong param_bytes; u8 *curr; @@ -40,13 +40,13 @@ struct PARSER_CONTEXT_Tag { char data[0]; }; -static PARSER_CONTEXT * +static struct parser_context * parser_init_guts(u64 addr, u32 bytes, BOOL isLocal, BOOL hasStandardPayloadHeader, BOOL *tryAgain) { - int allocbytes = sizeof(PARSER_CONTEXT) + bytes; - PARSER_CONTEXT *rc = NULL; - PARSER_CONTEXT *ctx = NULL; + int allocbytes = sizeof(struct parser_context) + bytes; + struct parser_context *rc = NULL; + struct parser_context *ctx = NULL; struct memregion *rgn = NULL; struct spar_controlvm_parameters_header *phdr = NULL; @@ -134,7 +134,7 @@ Away: return rc; } -PARSER_CONTEXT * +struct parser_context * parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain) { return parser_init_guts(addr, bytes, isLocal, TRUE, tryAgain); @@ -145,7 +145,7 @@ parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain) * structures. Afterwards, you can call parser_simpleString_get() or * parser_byteStream_get() to obtain the data. */ -PARSER_CONTEXT * +struct parser_context * parser_init_byteStream(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain) { return parser_init_guts(addr, bytes, isLocal, FALSE, tryAgain); @@ -154,7 +154,7 @@ parser_init_byteStream(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain) /* Obtain '\0'-terminated copy of string in payload area. */ char * -parser_simpleString_get(PARSER_CONTEXT *ctx) +parser_simpleString_get(struct parser_context *ctx) { if (!ctx->byte_stream) return NULL; @@ -166,7 +166,7 @@ parser_simpleString_get(PARSER_CONTEXT *ctx) /* Obtain a copy of the buffer in the payload area. */ void * -parser_byteStream_get(PARSER_CONTEXT *ctx, ulong *nbytes) +parser_byteStream_get(struct parser_context *ctx, ulong *nbytes) { if (!ctx->byte_stream) return NULL; @@ -176,7 +176,7 @@ parser_byteStream_get(PARSER_CONTEXT *ctx, ulong *nbytes) } uuid_le -parser_id_get(PARSER_CONTEXT *ctx) +parser_id_get(struct parser_context *ctx) { struct spar_controlvm_parameters_header *phdr = NULL; @@ -187,7 +187,7 @@ parser_id_get(PARSER_CONTEXT *ctx) } void -parser_param_start(PARSER_CONTEXT *ctx, PARSER_WHICH_STRING which_string) +parser_param_start(struct parser_context *ctx, PARSER_WHICH_STRING which_string) { struct spar_controlvm_parameters_header *phdr = NULL; @@ -220,7 +220,7 @@ Away: } void -parser_done(PARSER_CONTEXT *ctx) +parser_done(struct parser_context *ctx) { if (!ctx) return; @@ -263,7 +263,7 @@ string_length_no_trail(char *s, int len) * parameter */ void * -parser_param_get(PARSER_CONTEXT *ctx, char *nam, int namesize) +parser_param_get(struct parser_context *ctx, char *nam, int namesize) { u8 *pscan, *pnam = nam; ulong nscan; @@ -398,7 +398,7 @@ parser_param_get(PARSER_CONTEXT *ctx, char *nam, int namesize) } void * -parser_string_get(PARSER_CONTEXT *ctx) +parser_string_get(struct parser_context *ctx) { u8 *pscan; ulong nscan; diff --git a/drivers/staging/unisys/visorchipset/parser.h b/drivers/staging/unisys/visorchipset/parser.h index 7e015d1e744d..aa50ff8780a3 100644 --- a/drivers/staging/unisys/visorchipset/parser.h +++ b/drivers/staging/unisys/visorchipset/parser.h @@ -30,17 +30,17 @@ typedef enum { PARSERSTRING_NAME, } PARSER_WHICH_STRING; -typedef struct PARSER_CONTEXT_Tag PARSER_CONTEXT; - -PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain); -PARSER_CONTEXT *parser_init_byteStream(u64 addr, u32 bytes, BOOL isLocal, +struct parser_context *parser_init(u64 addr, u32 bytes, BOOL isLocal, + BOOL *tryAgain); +struct parser_context *parser_init_byteStream(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain); -void parser_param_start(PARSER_CONTEXT *ctx, PARSER_WHICH_STRING which_string); -void *parser_param_get(PARSER_CONTEXT *ctx, char *nam, int namesize); -void *parser_string_get(PARSER_CONTEXT *ctx); -uuid_le parser_id_get(PARSER_CONTEXT *ctx); -char *parser_simpleString_get(PARSER_CONTEXT *ctx); -void *parser_byteStream_get(PARSER_CONTEXT *ctx, ulong *nbytes); -void parser_done(PARSER_CONTEXT *ctx); +void parser_param_start(struct parser_context *ctx, + PARSER_WHICH_STRING which_string); +void *parser_param_get(struct parser_context *ctx, char *nam, int namesize); +void *parser_string_get(struct parser_context *ctx); +uuid_le parser_id_get(struct parser_context *ctx); +char *parser_simpleString_get(struct parser_context *ctx); +void *parser_byteStream_get(struct parser_context *ctx, ulong *nbytes); +void parser_done(struct parser_context *ctx); #endif diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c index b1399be79665..284ed4f75f61 100644 --- a/drivers/staging/unisys/visorchipset/visorchipset_main.c +++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c @@ -144,7 +144,7 @@ static const char Putfile_buffer_list_pool_name[] = */ struct putfile_buffer_entry { struct list_head next; /* putfile_buffer_entry list */ - PARSER_CONTEXT *parser_ctx; /* points to buffer containing input data */ + struct parser_context *parser_ctx; /* points to input data buffer */ }; /* List of struct putfile_request *, via next_putfile_request member. @@ -159,7 +159,7 @@ static LIST_HEAD(Putfile_request_list); */ struct putfile_active_buffer { /* a payload from a controlvm message, containing a file data buffer */ - PARSER_CONTEXT *parser_ctx; + struct parser_context *parser_ctx; /* points within data area of parser_ctx to next byte of data */ u8 *pnext; /* # bytes left from to the end of this data buffer */ @@ -1134,7 +1134,8 @@ Away: } static void -bus_configure(struct controlvm_message *inmsg, PARSER_CONTEXT *parser_ctx) +bus_configure(struct controlvm_message *inmsg, + struct parser_context *parser_ctx) { struct controlvm_message_packet *cmd = &inmsg->cmd; ulong busNo = cmd->configure_bus.bus_no; @@ -1697,7 +1698,7 @@ handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr) struct controlvm_message_packet *cmd = &inmsg.cmd; u64 parametersAddr = 0; u32 parametersBytes = 0; - PARSER_CONTEXT *parser_ctx = NULL; + struct parser_context *parser_ctx = NULL; BOOL isLocalAddr = FALSE; struct controlvm_message ackmsg; -- 2.30.2