All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] parser patches v2
@ 2014-12-01 12:39 Jeffrey Brown
  2014-12-01 12:39 ` [PATCH 01/10] staging: unisys: parser_init camel cases Jeffrey Brown
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Jeffrey Brown @ 2014-12-01 12:39 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Jeffrey Brown

This series of patches made corrections to the camel casing and typedef
problems in parser header and parser.c. There is a camel case in parser header
where visorchipset_main.c was affected as well. Smaller problems like space
after casts, braces, and logical coninuations in parser.c were solved as well.

Jeffrey Brown (10):
  staging: unisys: parser_init camel cases
  staging: unisys: parser_init_byteStream camel case
  staging: unisys: simpleString_get & byteStream_get camel case
  staging: unisys: PARSER_CONTEXT typedef
  staging: unisys: PARSER_WHICH_STRING typedef
  staging: unisys: Controlvm_Payload_Bytes_Buffered camel case
  staging: unisys: parser_init_guts and parser_param_start camel case
  staging: unisys: parser.c space after casts
  staging: unisys: parser.c braces
  staging: unisys: parser.c logical continuation

 drivers/staging/unisys/visorchipset/parser.c       | 117 +++++++++++----------
 drivers/staging/unisys/visorchipset/parser.h       |  29 ++---
 .../unisys/visorchipset/visorchipset_main.c        |  12 ++-
 3 files changed, 81 insertions(+), 77 deletions(-)

-- 
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 01/10] staging: unisys: parser_init camel cases
  2014-12-01 12:39 [PATCH 00/10] parser patches v2 Jeffrey Brown
@ 2014-12-01 12:39 ` Jeffrey Brown
  2014-12-01 12:39 ` [PATCH 02/10] staging: unisys: parser_init_byteStream camel case Jeffrey Brown
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Jeffrey Brown @ 2014-12-01 12:39 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Jeffrey Brown

Fixed camel cases for parser_init
isLocal => is_local
tryAgain => try_again

Signed-off-by: Jeffrey Brown <Jeffrey.Brown@unisys.com>
---
 drivers/staging/unisys/visorchipset/parser.c | 4 ++--
 drivers/staging/unisys/visorchipset/parser.h | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c b/drivers/staging/unisys/visorchipset/parser.c
index 9edbd3b..38264c6 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -155,9 +155,9 @@ Away:
 }
 
 PARSER_CONTEXT *
-parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain)
+parser_init(u64 addr, u32 bytes, BOOL is_local, BOOL *try_again)
 {
-	return parser_init_guts(addr, bytes, isLocal, TRUE, tryAgain);
+	return parser_init_guts(addr, bytes, is_local, TRUE, try_again);
 }
 
 /* Call this instead of parser_init() if the payload area consists of just
diff --git a/drivers/staging/unisys/visorchipset/parser.h b/drivers/staging/unisys/visorchipset/parser.h
index 9fbe3b5..4f26413 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -33,7 +33,8 @@ typedef enum {
 
 typedef struct PARSER_CONTEXT_Tag PARSER_CONTEXT;
 
-PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain);
+PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL is_local,
+			    BOOL *try_again);
 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);
-- 
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 02/10] staging: unisys: parser_init_byteStream camel case
  2014-12-01 12:39 [PATCH 00/10] parser patches v2 Jeffrey Brown
  2014-12-01 12:39 ` [PATCH 01/10] staging: unisys: parser_init camel cases Jeffrey Brown
@ 2014-12-01 12:39 ` Jeffrey Brown
  2014-12-01 12:39 ` [PATCH 03/10] staging: unisys: simpleString_get & byteStream_get " Jeffrey Brown
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Jeffrey Brown @ 2014-12-01 12:39 UTC (permalink / raw)
  To: gregkh; +Cc: jkc, driverdev-devel, sparmaintainer, Jeffrey Brown

Changed the camel cases for the struct parser_init_bytestream
parser_init_byteStream => parser_init_bytestream
isLocal => is_local
tryAgain => try_again

Signed-off-by: Jeffrey Brown <Jeffrey.Brown@unisys.com>
---
 drivers/staging/unisys/visorchipset/parser.c            | 4 ++--
 drivers/staging/unisys/visorchipset/parser.h            | 4 ++--
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c b/drivers/staging/unisys/visorchipset/parser.c
index 38264c6..8cd3b4f 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -166,9 +166,9 @@ parser_init(u64 addr, u32 bytes, BOOL is_local, BOOL *try_again)
  * parser_byteStream_get() to obtain the data.
  */
 PARSER_CONTEXT *
-parser_init_byteStream(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain)
+parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local, BOOL *try_again)
 {
-	return parser_init_guts(addr, bytes, isLocal, FALSE, tryAgain);
+	return parser_init_guts(addr, bytes, is_local, FALSE, try_again);
 }
 
 /* Obtain '\0'-terminated copy of string in payload area.
diff --git a/drivers/staging/unisys/visorchipset/parser.h b/drivers/staging/unisys/visorchipset/parser.h
index 4f26413..10b922e 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -35,8 +35,8 @@ typedef struct PARSER_CONTEXT_Tag PARSER_CONTEXT;
 
 PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL is_local,
 			    BOOL *try_again);
-PARSER_CONTEXT *parser_init_byteStream(u64 addr, u32 bytes, BOOL isLocal,
-				       BOOL *tryAgain);
+PARSER_CONTEXT  *parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local,
+				       BOOL *try_again);
 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);
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index c8f7bea..5010c65 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1811,7 +1811,7 @@ handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
 		BOOL retry = FALSE;
 
 		parser_ctx =
-		    parser_init_byteStream(parametersAddr, parametersBytes,
+		    parser_init_bytestream(parametersAddr, parametersBytes,
 					   isLocalAddr, &retry);
 		if (!parser_ctx) {
 			if (retry) {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 03/10] staging: unisys: simpleString_get & byteStream_get camel case
  2014-12-01 12:39 [PATCH 00/10] parser patches v2 Jeffrey Brown
  2014-12-01 12:39 ` [PATCH 01/10] staging: unisys: parser_init camel cases Jeffrey Brown
  2014-12-01 12:39 ` [PATCH 02/10] staging: unisys: parser_init_byteStream camel case Jeffrey Brown
@ 2014-12-01 12:39 ` Jeffrey Brown
  2014-12-01 12:39 ` [PATCH 04/10] staging: unisys: PARSER_CONTEXT typedef Jeffrey Brown
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Jeffrey Brown @ 2014-12-01 12:39 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Jeffrey Brown

Fixed the camel case for parser_byteStream_get and
parser_simpleString_get
parser_simpleString_get => parser_simplestring_get
parser_byteStream_get => parser_bytestream_get

Signed-off-by: Jeffrey Brown <Jeffrey.Brown@unisys.com>
---
 drivers/staging/unisys/visorchipset/parser.c | 4 ++--
 drivers/staging/unisys/visorchipset/parser.h | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c b/drivers/staging/unisys/visorchipset/parser.c
index 8cd3b4f..50180f3 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -174,7 +174,7 @@ parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local, BOOL *try_again)
 /* Obtain '\0'-terminated copy of string in payload area.
  */
 char *
-parser_simpleString_get(PARSER_CONTEXT *ctx)
+parser_simplestring_get(PARSER_CONTEXT *ctx)
 {
 	if (!ctx->byte_stream)
 		return NULL;
@@ -186,7 +186,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(PARSER_CONTEXT *ctx, ulong *nbytes)
 {
 	if (!ctx->byte_stream)
 		return NULL;
diff --git a/drivers/staging/unisys/visorchipset/parser.h b/drivers/staging/unisys/visorchipset/parser.h
index 10b922e..fa12df8 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -36,13 +36,13 @@ typedef struct PARSER_CONTEXT_Tag PARSER_CONTEXT;
 PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL is_local,
 			    BOOL *try_again);
 PARSER_CONTEXT  *parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local,
-				       BOOL *try_again);
+					BOOL *try_again);
 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);
+char *parser_simplestring_get(PARSER_CONTEXT *ctx);
+void *parser_bytestream_get(PARSER_CONTEXT *ctx, ulong *nbytes);
 void parser_done(PARSER_CONTEXT *ctx);
 
 #endif
-- 
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 04/10] staging: unisys: PARSER_CONTEXT typedef
  2014-12-01 12:39 [PATCH 00/10] parser patches v2 Jeffrey Brown
                   ` (2 preceding siblings ...)
  2014-12-01 12:39 ` [PATCH 03/10] staging: unisys: simpleString_get & byteStream_get " Jeffrey Brown
@ 2014-12-01 12:39 ` Jeffrey Brown
  2014-12-01 12:39 ` [PATCH 05/10] staging: unisys: PARSER_WHICH_STRING typedef Jeffrey Brown
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Jeffrey Brown @ 2014-12-01 12:39 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Jeffrey Brown

Completely removed all trace of the typedef of PARSER_CONTEXT
and replaced all instance of that typedef with parser_context_tag
also changed PARSER_CONTEXT_Tag
PARSER_CONTEXT_Tag => parser_context_tag

Signed-off-by: Jeffrey Brown <Jeffrey.Brown@unisys.com>
---
 drivers/staging/unisys/visorchipset/parser.c       | 29 +++++++++++-----------
 drivers/staging/unisys/visorchipset/parser.h       | 26 +++++++++----------
 .../unisys/visorchipset/visorchipset_main.c        | 10 +++++---
 3 files changed, 34 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c b/drivers/staging/unisys/visorchipset/parser.c
index 50180f3..4a880b8 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_tag {
 	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_tag *
 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_tag) + bytes;
+	struct parser_context_tag *rc = NULL;
+	struct parser_context_tag *ctx = NULL;
 	struct memregion *rgn = NULL;
 	struct spar_controlvm_parameters_header *phdr = NULL;
 
@@ -154,7 +154,7 @@ Away:
 	return rc;
 }
 
-PARSER_CONTEXT *
+struct parser_context_tag *
 parser_init(u64 addr, u32 bytes, BOOL is_local, BOOL *try_again)
 {
 	return parser_init_guts(addr, bytes, is_local, TRUE, try_again);
@@ -165,7 +165,7 @@ parser_init(u64 addr, u32 bytes, BOOL is_local, BOOL *try_again)
  * structures.  Afterwards, you can call parser_simpleString_get() or
  * parser_byteStream_get() to obtain the data.
  */
-PARSER_CONTEXT *
+struct parser_context_tag *
 parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local, BOOL *try_again)
 {
 	return parser_init_guts(addr, bytes, is_local, FALSE, try_again);
@@ -174,7 +174,7 @@ parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local, BOOL *try_again)
 /* Obtain '\0'-terminated copy of string in payload area.
  */
 char *
-parser_simplestring_get(PARSER_CONTEXT *ctx)
+parser_simplestring_get(struct parser_context_tag *ctx)
 {
 	if (!ctx->byte_stream)
 		return NULL;
@@ -186,7 +186,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_tag *ctx, ulong *nbytes)
 {
 	if (!ctx->byte_stream)
 		return NULL;
@@ -196,7 +196,7 @@ parser_bytestream_get(PARSER_CONTEXT *ctx, ulong *nbytes)
 }
 
 uuid_le
-parser_id_get(PARSER_CONTEXT *ctx)
+parser_id_get(struct parser_context_tag *ctx)
 {
 	struct spar_controlvm_parameters_header *phdr = NULL;
 
@@ -210,7 +210,8 @@ parser_id_get(PARSER_CONTEXT *ctx)
 }
 
 void
-parser_param_start(PARSER_CONTEXT *ctx, PARSER_WHICH_STRING which_string)
+parser_param_start(struct parser_context_tag *ctx,
+		   PARSER_WHICH_STRING which_string)
 {
 	struct spar_controlvm_parameters_header *phdr = NULL;
 
@@ -247,7 +248,7 @@ Away:
 }
 
 void
-parser_done(PARSER_CONTEXT *ctx)
+parser_done(struct parser_context_tag *ctx)
 {
 	if (!ctx)
 		return;
@@ -290,7 +291,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_tag *ctx, char *nam, int namesize)
 {
 	u8 *pscan, *pnam = nam;
 	ulong nscan;
@@ -446,7 +447,7 @@ parser_param_get(PARSER_CONTEXT *ctx, char *nam, int namesize)
 }
 
 void *
-parser_string_get(PARSER_CONTEXT *ctx)
+parser_string_get(struct parser_context_tag *ctx)
 {
 	u8 *pscan;
 	ulong nscan;
diff --git a/drivers/staging/unisys/visorchipset/parser.h b/drivers/staging/unisys/visorchipset/parser.h
index fa12df8..de3f37b 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -31,18 +31,18 @@ typedef enum {
 	PARSERSTRING_NAME,
 } PARSER_WHICH_STRING;
 
-typedef struct PARSER_CONTEXT_Tag PARSER_CONTEXT;
-
-PARSER_CONTEXT *parser_init(u64 addr, u32 bytes, BOOL is_local,
-			    BOOL *try_again);
-PARSER_CONTEXT  *parser_init_bytestream(u64 addr, u32 bytes, BOOL is_local,
-					BOOL *try_again);
-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);
+struct parser_context_tag *parser_init(u64 addr, u32 bytes, BOOL is_local,
+				       BOOL *try_again);
+struct parser_context_tag *parser_init_bytestream(u64 addr, u32 bytes,
+						  BOOL is_local,
+						  BOOL *try_again);
+void parser_param_start(struct parser_context_tag *ctx,
+			PARSER_WHICH_STRING which_string);
+void *parser_param_get(struct parser_context_tag *ctx, char *nam, int namesize);
+void *parser_string_get(struct parser_context_tag *ctx);
+uuid_le parser_id_get(struct parser_context_tag *ctx);
+char *parser_simplestring_get(struct parser_context_tag *ctx);
+void *parser_bytestream_get(struct parser_context_tag *ctx, ulong *nbytes);
+void parser_done(struct parser_context_tag *ctx);
 
 #endif
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 5010c65..944c46e 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -151,7 +151,8 @@ 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_tag *parser_ctx; /* points to buffer containing
+						input data */
 };
 
 /* List of struct putfile_request *, via next_putfile_request member.
@@ -166,7 +167,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_tag *parser_ctx;
 	/* points within data area of parser_ctx to next byte of data */
 	u8 *pnext;
 	/* # bytes left from <pnext> to the end of this data buffer */
@@ -1181,7 +1182,8 @@ Away:
 }
 
 static void
-bus_configure(struct controlvm_message *inmsg, PARSER_CONTEXT *parser_ctx)
+bus_configure(struct controlvm_message *inmsg,
+	      struct parser_context_tag *parser_ctx)
 {
 	struct controlvm_message_packet *cmd = &inmsg->cmd;
 	ulong busNo = cmd->configure_bus.bus_no;
@@ -1790,7 +1792,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_tag *parser_ctx = NULL;
 	BOOL isLocalAddr = FALSE;
 	struct controlvm_message ackmsg;
 
-- 
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 05/10] staging: unisys: PARSER_WHICH_STRING typedef
  2014-12-01 12:39 [PATCH 00/10] parser patches v2 Jeffrey Brown
                   ` (3 preceding siblings ...)
  2014-12-01 12:39 ` [PATCH 04/10] staging: unisys: PARSER_CONTEXT typedef Jeffrey Brown
@ 2014-12-01 12:39 ` Jeffrey Brown
  2014-12-01 12:39 ` [PATCH 06/10] staging: unisys: Controlvm_Payload_Bytes_Buffered camel case Jeffrey Brown
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Jeffrey Brown @ 2014-12-01 12:39 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Jeffrey Brown

Removed the typedef of PARSER_WHICH_STRING and replaced all
instance of the typedef with enum parser_which_string. Also
changed the name of it to parser_which_string
PARSER_WHICH_STRING => parser_which_string

Signed-off-by: Jeffrey Brown <Jeffrey.Brown@unisys.com>
---
 drivers/staging/unisys/visorchipset/parser.c | 2 +-
 drivers/staging/unisys/visorchipset/parser.h | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c b/drivers/staging/unisys/visorchipset/parser.c
index 4a880b8..fad3fdb 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -211,7 +211,7 @@ parser_id_get(struct parser_context_tag *ctx)
 
 void
 parser_param_start(struct parser_context_tag *ctx,
-		   PARSER_WHICH_STRING which_string)
+		   enum parser_which_string which_string)
 {
 	struct spar_controlvm_parameters_header *phdr = NULL;
 
diff --git a/drivers/staging/unisys/visorchipset/parser.h b/drivers/staging/unisys/visorchipset/parser.h
index de3f37b..5b802fc 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -24,12 +24,12 @@
 #include "timskmod.h"
 #include "channel.h"
 
-typedef enum {
+enum parser_which_string {
 	PARSERSTRING_INITIATOR,
 	PARSERSTRING_TARGET,
 	PARSERSTRING_CONNECTION,
 	PARSERSTRING_NAME,
-} PARSER_WHICH_STRING;
+};
 
 struct parser_context_tag *parser_init(u64 addr, u32 bytes, BOOL is_local,
 				       BOOL *try_again);
@@ -37,7 +37,7 @@ struct parser_context_tag *parser_init_bytestream(u64 addr, u32 bytes,
 						  BOOL is_local,
 						  BOOL *try_again);
 void parser_param_start(struct parser_context_tag *ctx,
-			PARSER_WHICH_STRING which_string);
+			enum parser_which_string which_string);
 void *parser_param_get(struct parser_context_tag *ctx, char *nam, int namesize);
 void *parser_string_get(struct parser_context_tag *ctx);
 uuid_le parser_id_get(struct parser_context_tag *ctx);
-- 
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 06/10] staging: unisys: Controlvm_Payload_Bytes_Buffered camel case
  2014-12-01 12:39 [PATCH 00/10] parser patches v2 Jeffrey Brown
                   ` (4 preceding siblings ...)
  2014-12-01 12:39 ` [PATCH 05/10] staging: unisys: PARSER_WHICH_STRING typedef Jeffrey Brown
@ 2014-12-01 12:39 ` Jeffrey Brown
  2014-12-01 12:39 ` [PATCH 07/10] staging: unisys: parser_init_guts and parser_param_start " Jeffrey Brown
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Jeffrey Brown @ 2014-12-01 12:39 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Jeffrey Brown

Changed the camel case of the static ulong Controlvm_Payload_Bytes_
Buffered
Controlvm_Payload_Bytes_Buffered =>controlvm_payload_bytes_buffered

Signed-off-by: Jeffrey Brown <Jeffrey.Brown@unisys.com>
---
 drivers/staging/unisys/visorchipset/parser.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c b/drivers/staging/unisys/visorchipset/parser.c
index fad3fdb..88abbeb 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -29,7 +29,7 @@
  * incoming payloads.  This serves as a throttling mechanism.
  */
 #define MAX_CONTROLVM_PAYLOAD_BYTES (1024*128)
-static ulong Controlvm_Payload_Bytes_Buffered;
+static ulong controlvm_payload_bytes_buffered;
 
 struct parser_context_tag {
 	ulong allocbytes;
@@ -57,7 +57,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
 		 * '\0'-terminated
 		 */
 		allocbytes++;
-	if ((Controlvm_Payload_Bytes_Buffered + bytes)
+	if ((controlvm_payload_bytes_buffered + bytes)
 	    > MAX_CONTROLVM_PAYLOAD_BYTES) {
 		ERRDRV("%s (%s:%d) - prevented allocation of %d bytes to prevent exceeding throttling max (%d)",
 		       __func__, __FILE__, __LINE__, allocbytes,
@@ -144,7 +144,7 @@ Away:
 		rgn = NULL;
 	}
 	if (rc)
-		Controlvm_Payload_Bytes_Buffered += ctx->param_bytes;
+		controlvm_payload_bytes_buffered += ctx->param_bytes;
 	else {
 		if (ctx) {
 			parser_done(ctx);
@@ -252,7 +252,7 @@ parser_done(struct parser_context_tag *ctx)
 {
 	if (!ctx)
 		return;
-	Controlvm_Payload_Bytes_Buffered -= ctx->param_bytes;
+	controlvm_payload_bytes_buffered -= ctx->param_bytes;
 	kfree(ctx);
 }
 
-- 
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 07/10] staging: unisys: parser_init_guts and parser_param_start camel case
  2014-12-01 12:39 [PATCH 00/10] parser patches v2 Jeffrey Brown
                   ` (5 preceding siblings ...)
  2014-12-01 12:39 ` [PATCH 06/10] staging: unisys: Controlvm_Payload_Bytes_Buffered camel case Jeffrey Brown
@ 2014-12-01 12:39 ` Jeffrey Brown
  2014-12-01 12:39 ` [PATCH 08/10] staging: unisys: parser.c space after casts Jeffrey Brown
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Jeffrey Brown @ 2014-12-01 12:39 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Jeffrey Brown

Fixed camel cases in the struct parser_init_guts and an Away camel
case in parser_param_start
isLocal => is_local
tryAgain => try_again
HasStandardPayloadHeader => has_standard_payload_header
Away => cleanups

Signed-off-by: Jeffrey Brown <Jeffrey.Brown@unisys.com>
---
 drivers/staging/unisys/visorchipset/parser.c | 46 ++++++++++++++--------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c b/drivers/staging/unisys/visorchipset/parser.c
index 88abbeb..02cacec 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -41,8 +41,8 @@ struct parser_context_tag {
 };
 
 static struct parser_context_tag *
-parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
-		 BOOL hasStandardPayloadHeader, BOOL *tryAgain)
+parser_init_guts(u64 addr, u32 bytes, BOOL is_local,
+		 BOOL has_standard_payload_header, BOOL *try_again)
 {
 	int allocbytes = sizeof(struct parser_context_tag) + bytes;
 	struct parser_context_tag *rc = NULL;
@@ -50,9 +50,9 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
 	struct memregion *rgn = NULL;
 	struct spar_controlvm_parameters_header *phdr = NULL;
 
-	if (tryAgain)
-		*tryAgain = FALSE;
-	if (!hasStandardPayloadHeader)
+	if (try_again)
+		*try_again = FALSE;
+	if (!has_standard_payload_header)
 		/* alloc and 0 extra byte to ensure payload is
 		 * '\0'-terminated
 		 */
@@ -62,19 +62,19 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
 		ERRDRV("%s (%s:%d) - prevented allocation of %d bytes to prevent exceeding throttling max (%d)",
 		       __func__, __FILE__, __LINE__, allocbytes,
 		       MAX_CONTROLVM_PAYLOAD_BYTES);
-		if (tryAgain)
-			*tryAgain = TRUE;
+		if (try_again)
+			*try_again = TRUE;
 		rc = NULL;
-		goto Away;
+		goto cleanups;
 	}
 	ctx = kzalloc(allocbytes, GFP_KERNEL|__GFP_NORETRY);
 	if (ctx == NULL) {
 		ERRDRV("%s (%s:%d) - failed to allocate %d bytes",
 		       __func__, __FILE__, __LINE__, allocbytes);
-		if (tryAgain)
-			*tryAgain = TRUE;
+		if (try_again)
+			*try_again = TRUE;
 		rc = NULL;
-		goto Away;
+		goto cleanups;
 	}
 
 	ctx->allocbytes = allocbytes;
@@ -82,7 +82,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
 	ctx->curr = NULL;
 	ctx->bytes_remaining = 0;
 	ctx->byte_stream = FALSE;
-	if (isLocal) {
+	if (is_local) {
 		void *p;
 
 		if (addr > virt_to_phys(high_memory - 1)) {
@@ -90,7 +90,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
 			       __func__,
 			       (unsigned long long) addr, (ulong) bytes);
 			rc = NULL;
-			goto Away;
+			goto cleanups;
 		}
 		p = __va((ulong) (addr));
 		memcpy(ctx->data, p, bytes);
@@ -98,17 +98,17 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
 		rgn = visor_memregion_create(addr, bytes);
 		if (!rgn) {
 			rc = NULL;
-			goto Away;
+			goto cleanups;
 		}
 		if (visor_memregion_read(rgn, 0, ctx->data, bytes) < 0) {
 			rc = NULL;
-			goto Away;
+			goto cleanups;
 		}
 	}
-	if (!hasStandardPayloadHeader) {
+	if (!has_standard_payload_header) {
 		ctx->byte_stream = TRUE;
 		rc = ctx;
-		goto Away;
+		goto cleanups;
 	}
 	phdr = (struct spar_controlvm_parameters_header *)(ctx->data);
 	if (phdr->total_length != bytes) {
@@ -116,7 +116,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
 		       __func__,
 		       (ulong) (phdr->total_length), (ulong) (bytes));
 		rc = NULL;
-		goto Away;
+		goto cleanups;
 	}
 	if (phdr->total_length < phdr->header_length) {
 		ERRDRV("%s - total length < header length (%lu < %lu)",
@@ -124,7 +124,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
 		       (ulong) (phdr->total_length),
 		       (ulong) (phdr->header_length));
 		rc = NULL;
-		goto Away;
+		goto cleanups;
 	}
 	if (phdr->header_length <
 	    sizeof(struct spar_controlvm_parameters_header)) {
@@ -134,11 +134,11 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
 		       (ulong)(sizeof(
 				struct spar_controlvm_parameters_header)));
 		rc = NULL;
-		goto Away;
+		goto cleanups;
 	}
 
 	rc = ctx;
-Away:
+cleanups:
 	if (rgn) {
 		visor_memregion_destroy(rgn);
 		rgn = NULL;
@@ -218,7 +218,7 @@ parser_param_start(struct parser_context_tag *ctx,
 	if (ctx == NULL) {
 		ERRDRV("%s (%s:%d) - no context",
 		       __func__, __FILE__, __LINE__);
-		goto Away;
+		goto cleanups;
 	}
 	phdr = (struct spar_controlvm_parameters_header *)(ctx->data);
 	switch (which_string) {
@@ -243,7 +243,7 @@ parser_param_start(struct parser_context_tag *ctx,
 		break;
 	}
 
-Away:
+cleanups:
 	return;
 }
 
-- 
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 08/10] staging: unisys: parser.c space after casts
  2014-12-01 12:39 [PATCH 00/10] parser patches v2 Jeffrey Brown
                   ` (6 preceding siblings ...)
  2014-12-01 12:39 ` [PATCH 07/10] staging: unisys: parser_init_guts and parser_param_start " Jeffrey Brown
@ 2014-12-01 12:39 ` Jeffrey Brown
  2014-12-01 12:39 ` [PATCH 09/10] staging: unisys: parser.c braces Jeffrey Brown
  2014-12-01 12:39 ` [PATCH 10/10] staging: unisys: parser.c logical continuation Jeffrey Brown
  9 siblings, 0 replies; 11+ messages in thread
From: Jeffrey Brown @ 2014-12-01 12:39 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Jeffrey Brown

Removed all spaces after casts in parser.c

Signed-off-by: Jeffrey Brown <Jeffrey.Brown@unisys.com>
---
 drivers/staging/unisys/visorchipset/parser.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c b/drivers/staging/unisys/visorchipset/parser.c
index 02cacec..17c1649 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -88,11 +88,11 @@ parser_init_guts(u64 addr, u32 bytes, BOOL is_local,
 		if (addr > virt_to_phys(high_memory - 1)) {
 			ERRDRV("%s - bad local address (0x%-16.16Lx for %lu)",
 			       __func__,
-			       (unsigned long long) addr, (ulong) bytes);
+			       (unsigned long long)addr, (ulong)bytes);
 			rc = NULL;
 			goto cleanups;
 		}
-		p = __va((ulong) (addr));
+		p = __va((ulong)(addr));
 		memcpy(ctx->data, p, bytes);
 	} else {
 		rgn = visor_memregion_create(addr, bytes);
@@ -114,15 +114,15 @@ parser_init_guts(u64 addr, u32 bytes, BOOL is_local,
 	if (phdr->total_length != bytes) {
 		ERRDRV("%s - bad total length %lu (should be %lu)",
 		       __func__,
-		       (ulong) (phdr->total_length), (ulong) (bytes));
+		       (ulong)(phdr->total_length), (ulong)(bytes));
 		rc = NULL;
 		goto cleanups;
 	}
 	if (phdr->total_length < phdr->header_length) {
 		ERRDRV("%s - total length < header length (%lu < %lu)",
 		       __func__,
-		       (ulong) (phdr->total_length),
-		       (ulong) (phdr->header_length));
+		       (ulong)(phdr->total_length),
+		       (ulong)(phdr->header_length));
 		rc = NULL;
 		goto cleanups;
 	}
@@ -130,7 +130,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL is_local,
 	    sizeof(struct spar_controlvm_parameters_header)) {
 		ERRDRV("%s - header is too small (%lu < %lu)",
 		       __func__,
-		       (ulong) (phdr->header_length),
+		       (ulong)(phdr->header_length),
 		       (ulong)(sizeof(
 				struct spar_controlvm_parameters_header)));
 		rc = NULL;
@@ -192,7 +192,7 @@ parser_bytestream_get(struct parser_context_tag *ctx, ulong *nbytes)
 		return NULL;
 	if (nbytes)
 		*nbytes = ctx->param_bytes;
-	return (void *) ctx->data;
+	return (void *)ctx->data;
 }
 
 uuid_le
@@ -407,7 +407,7 @@ parser_param_get(struct parser_context_tag *ctx, char *nam, int namesize)
 	if (value == NULL)
 		return NULL;
 	memcpy(value, pscan, value_length);
-	((u8 *) (value))[value_length] = '\0';
+	((u8 *)(value))[value_length] = '\0';
 
 	pscan += orig_value_length;
 	nscan -= orig_value_length;
@@ -475,6 +475,6 @@ parser_string_get(struct parser_context_tag *ctx)
 		return NULL;
 	if (value_length > 0)
 		memcpy(value, pscan, value_length);
-	((u8 *) (value))[value_length] = '\0';
+	((u8 *)(value))[value_length] = '\0';
 	return value;
 }
-- 
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 09/10] staging: unisys: parser.c braces
  2014-12-01 12:39 [PATCH 00/10] parser patches v2 Jeffrey Brown
                   ` (7 preceding siblings ...)
  2014-12-01 12:39 ` [PATCH 08/10] staging: unisys: parser.c space after casts Jeffrey Brown
@ 2014-12-01 12:39 ` Jeffrey Brown
  2014-12-01 12:39 ` [PATCH 10/10] staging: unisys: parser.c logical continuation Jeffrey Brown
  9 siblings, 0 replies; 11+ messages in thread
From: Jeffrey Brown @ 2014-12-01 12:39 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Jeffrey Brown

Inserted a necessary brace for an if statement on line 146 of
parser.c

Signed-off-by: Jeffrey Brown <Jeffrey.Brown@unisys.com>
---
 drivers/staging/unisys/visorchipset/parser.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c b/drivers/staging/unisys/visorchipset/parser.c
index 17c1649..6381e59 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -143,9 +143,9 @@ cleanups:
 		visor_memregion_destroy(rgn);
 		rgn = NULL;
 	}
-	if (rc)
+	if (rc) {
 		controlvm_payload_bytes_buffered += ctx->param_bytes;
-	else {
+	} else {
 		if (ctx) {
 			parser_done(ctx);
 			ctx = NULL;
-- 
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 10/10] staging: unisys: parser.c logical continuation
  2014-12-01 12:39 [PATCH 00/10] parser patches v2 Jeffrey Brown
                   ` (8 preceding siblings ...)
  2014-12-01 12:39 ` [PATCH 09/10] staging: unisys: parser.c braces Jeffrey Brown
@ 2014-12-01 12:39 ` Jeffrey Brown
  9 siblings, 0 replies; 11+ messages in thread
From: Jeffrey Brown @ 2014-12-01 12:39 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Jeffrey Brown

Fixed a logical continuation on line 391 by placing the '||'
operator on line 390

Signed-off-by: Jeffrey Brown <Jeffrey.Brown@unisys.com>
---
 drivers/staging/unisys/visorchipset/parser.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c b/drivers/staging/unisys/visorchipset/parser.c
index 6381e59..5f6a7b2 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -387,8 +387,8 @@ parser_param_get(struct parser_context_tag *ctx, char *nam, int namesize)
 				break;
 			}
 		} else
-		    if (pscan[i] == ',' || pscan[i] == ';'
-			|| pscan[i] == '\0') {
+		    if (pscan[i] == ',' || pscan[i] == ';' ||
+			pscan[i] == '\0') {
 			value_length = i;
 			break;
 		}
-- 
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-12-01 12:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-01 12:39 [PATCH 00/10] parser patches v2 Jeffrey Brown
2014-12-01 12:39 ` [PATCH 01/10] staging: unisys: parser_init camel cases Jeffrey Brown
2014-12-01 12:39 ` [PATCH 02/10] staging: unisys: parser_init_byteStream camel case Jeffrey Brown
2014-12-01 12:39 ` [PATCH 03/10] staging: unisys: simpleString_get & byteStream_get " Jeffrey Brown
2014-12-01 12:39 ` [PATCH 04/10] staging: unisys: PARSER_CONTEXT typedef Jeffrey Brown
2014-12-01 12:39 ` [PATCH 05/10] staging: unisys: PARSER_WHICH_STRING typedef Jeffrey Brown
2014-12-01 12:39 ` [PATCH 06/10] staging: unisys: Controlvm_Payload_Bytes_Buffered camel case Jeffrey Brown
2014-12-01 12:39 ` [PATCH 07/10] staging: unisys: parser_init_guts and parser_param_start " Jeffrey Brown
2014-12-01 12:39 ` [PATCH 08/10] staging: unisys: parser.c space after casts Jeffrey Brown
2014-12-01 12:39 ` [PATCH 09/10] staging: unisys: parser.c braces Jeffrey Brown
2014-12-01 12:39 ` [PATCH 10/10] staging: unisys: parser.c logical continuation Jeffrey Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.