All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/69] staging: unisys: driver code cleanup series
@ 2015-03-16 17:57 Benjamin Romer
  2015-03-16 17:57 ` [PATCH 01/69] staging: unisys: clean up NULL comparisons in visorchannel_funcs.c Benjamin Romer
                   ` (68 more replies)
  0 siblings, 69 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

This set of patches cleans up most of the remaining checkpatch.pl issues in the
unisys tree.

Benjamin Romer (69):
  staging: unisys: clean up NULL comparisons in visorchannel_funcs.c
  staging: unisys: cleanup NULL comparisons in virthba.c
  staging: unisys: fix CamelCase in virthba_probe()
  staging: unisys: fix CamelCase global Poll_jiffies
  staging: unisys: remove unnecessary complication from
    delete_vbus_device
  staging: unisys: clean up NULL compares in virtpci.c
  staging: unisys: fix CamelCase variable
    Controlvm_Payload_Bytes_Buffered
  staging: unisys: remove typedef for PARSER_CONTEXT
  staging: unisys: refactor parser_init_guts()
  staging: unisys: fix CamelCase names in parser_init()
  staging: unisys: refactor parser_init_byteStream
  staging: unisys: refactor parser_byteStream_get
  staging: unisys: fix CamelCase global Most_recent_message_jiffies
  staging: unisys: fix CamelCase controlvm globals
  staging: unisys: fix CamelCase message header variables
  staging: unisys: fix CamelCase semaphore NotifierLock
  staging: unisys: fix CamelCase name
  staging: unisys: fix CamelCased diagpool bus/dev names
  staging: unisys: fix CamelCase name for devicechangestate packet
  staging: unisys: fix CamelCase list names
  staging: unisys: fix placement of logical ops in visorchipset_main.c
  staging: unisys: fix CamelCase channel name ControlVm_channel
  staging: unisys: get rid of Test_Vnic_channel
  staging: unisys: fix CamelCase global ControlVm_payload_info
  staging: unisys: refactor livedump_info structure
  staging: unisys: remove extra blank lines in visorchipset_main.c
  staging: unisys: remove old code block in visorchipset_main.c
  staging: unisys: fix CamelCase-named clearing functions
  staging: unisys: remove obsolete proc entry code
  staging: unisys: fix all NULL comparisons in visorchipset_main.c
  staging: unisys: fix Camelcase Away goto label
  staging: unisys: fix CamelCase locals in visorchipset_save_message
  staging: unisys: fix CamelCase params in responder functions
  staging: unisys: fix CamelCase in epilog functions
  staging: unisys: fix spaces after typecasts in visorchipset_main.c
  staging: unisys: fix braces in visorchipset_main.c
  staging: unisys: refactor bus_create()
  staging: unisys: refactor bus_destroy()
  staging: unisys: refactor bus_configure()
  staging: unisys: refactor my_device_create()
  staging: unisys: refactor my_device_changestate()
  staging: unisys: refactor my_device_destroy()
  staging: unisys: refactor initialize_controlvm_payload_info()
  staging: unisys: fix NULL comparison in
    destroy_controlvm_payload_info()
  staging: unisys: fix Camelcase in initialize_controlvm_payload()
  staging: unisys: refactor parahotplug_process_list()
  staging: unisys: fix spacing in parahotplug_request_create
  staging: unisys: refactor handle_command()
  staging: unisys: refactor controlvm_periodic_work()
  staging: unisys: fix CamelCase in setup_crash_devices_work_queue()
  staging: unisys: fix CamelCase label in visorchipset_init()
  staging: unisys: fix NULL pointer comparisons in uislib.c
  staging: unisys: remove unnecessary brackets in uislib.c
  staging: unisys: remove last remnants of proc entry code
  staging: unisys: fix CamelCased ControlVM globals
  staging: unisys: fix CamelCase in putfile-related globals
  staging: unisys: fix CamelCase global
    Visorchipset_cache_buffers_in_use
  staging: unisys: fix CamelCased Parahotplug globals
  staging: unisys: fix CamelCased notifier globals
  staging: unisys: fix CamelCase in responders functions
  staging: unisys: fix CamelCased global MajorDev
  staging: unisys: fix CamelCase global Visorchipset_platform_device
  staging: unisys: fix CamelCase parameter msgHdr in controlvm functions
  staging: unisys: fix CamelCase parameter in chipset functions
  staging: unisys: fix CamelCase local toolAction
  staging: unisys: fix CamelCase variables in boottotool functions
  staging: unisys: fix CamelCase local in textid functions
  staging: unisys: Fix CamelCase local variable in remaining_steps
    functions
  staging: unisys: fix parenthesis alignment in visorchipset_main.c

 drivers/staging/unisys/uislib/uislib.c             |   32 +-
 drivers/staging/unisys/virthba/virthba.c           |   36 +-
 drivers/staging/unisys/virtpci/virtpci.c           |   12 +-
 .../unisys/visorchannel/visorchannel_funcs.c       |   23 +-
 drivers/staging/unisys/visorchipset/parser.c       |   95 +-
 drivers/staging/unisys/visorchipset/parser.h       |   24 +-
 drivers/staging/unisys/visorchipset/visorchipset.h |    1 -
 .../unisys/visorchipset/visorchipset_main.c        | 1206 ++++++++++----------
 drivers/staging/unisys/visorutil/Makefile          |    3 +-
 drivers/staging/unisys/visorutil/easyproc.c        |  356 ------
 drivers/staging/unisys/visorutil/easyproc.h        |   92 --
 drivers/staging/unisys/visorutil/procobjecttree.c  |  335 ------
 12 files changed, 688 insertions(+), 1527 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorutil/easyproc.c
 delete mode 100644 drivers/staging/unisys/visorutil/easyproc.h
 delete mode 100644 drivers/staging/unisys/visorutil/procobjecttree.c

-- 
2.1.0

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

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

* [PATCH 01/69] staging: unisys: clean up NULL comparisons in visorchannel_funcs.c
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
@ 2015-03-16 17:57 ` Benjamin Romer
  2015-03-16 17:57 ` [PATCH 02/69] staging: unisys: cleanup NULL comparisons in virthba.c Benjamin Romer
                   ` (67 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Correct all comparisons with NULL so that NULL isn't needed.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchannel/visorchannel_funcs.c       | 23 +++++++++++-----------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
index de0a646..7a9a724 100644
--- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
+++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
@@ -58,7 +58,7 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong channel_bytes,
 	void *rc = NULL;
 
 	p = kmalloc(sizeof(*p), GFP_KERNEL|__GFP_NORETRY);
-	if (p == NULL) {
+	if (!p) {
 		rc = NULL;
 		goto cleanup;
 	}
@@ -68,7 +68,7 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong channel_bytes,
 	spin_lock_init(&p->remove_lock);
 
 	/* prepare chan_hdr (abstraction to read/write channel memory) */
-	if (parent == NULL)
+	if (!parent)
 		p->memregion =
 		    visor_memregion_create(physaddr,
 					   sizeof(struct channel_header));
@@ -76,7 +76,7 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong channel_bytes,
 		p->memregion =
 		    visor_memregion_create_overlapped(parent->memregion,
 				off, sizeof(struct channel_header));
-	if (p->memregion == NULL) {
+	if (!p->memregion) {
 		rc = NULL;
 		goto cleanup;
 	}
@@ -101,8 +101,8 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong channel_bytes,
 	rc = p;
 cleanup:
 
-	if (rc == NULL) {
-		if (p != NULL) {
+	if (!rc) {
+		if (!p) {
 			visorchannel_destroy(p);
 			p = NULL;
 		}
@@ -150,9 +150,9 @@ EXPORT_SYMBOL_GPL(visorchannel_create_overlapped_with_lock);
 void
 visorchannel_destroy(struct visorchannel *channel)
 {
-	if (channel == NULL)
+	if (!channel)
 		return;
-	if (channel->memregion != NULL) {
+	if (channel->memregion) {
 		visor_memregion_destroy(channel->memregion);
 		channel->memregion = NULL;
 	}
@@ -252,7 +252,7 @@ visorchannel_clear(struct visorchannel *channel, ulong offset, u8 ch,
 	int written = 0;
 	u8 *buf = vmalloc(bufsize);
 
-	if (buf == NULL)
+	if (!buf)
 		goto cleanup;
 
 	memset(buf, ch, bufsize);
@@ -274,7 +274,7 @@ visorchannel_clear(struct visorchannel *channel, ulong offset, u8 ch,
 	rc = 0;
 
 cleanup:
-	if (buf != NULL) {
+	if (buf) {
 		vfree(buf);
 		buf = NULL;
 	}
@@ -560,11 +560,10 @@ visorchannel_debug(struct visorchannel *channel, int num_queues,
 	int i = 0;
 	int errcode = 0;
 
-	if (channel == NULL)
+	if (!channel)
 		return;
-
 	memregion = channel->memregion;
-	if (memregion == NULL)
+	if (!memregion)
 		return;
 
 	addr = visor_memregion_get_physaddr(memregion);
-- 
2.1.0

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

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

* [PATCH 02/69] staging: unisys: cleanup NULL comparisons in virthba.c
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
  2015-03-16 17:57 ` [PATCH 01/69] staging: unisys: clean up NULL comparisons in visorchannel_funcs.c Benjamin Romer
@ 2015-03-16 17:57 ` Benjamin Romer
  2015-03-16 17:57 ` [PATCH 03/69] staging: unisys: fix CamelCase in virthba_probe() Benjamin Romer
                   ` (66 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix all comparisons to NULL so that they don't use NULL anymore.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/virthba/virthba.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c
index e5b0dd8..4a11ac6 100644
--- a/drivers/staging/unisys/virthba/virthba.c
+++ b/drivers/staging/unisys/virthba/virthba.c
@@ -258,7 +258,7 @@ add_scsipending_entry(struct virthba_info *vhbainfo, char cmdtype, void *new)
 
 	spin_lock_irqsave(&vhbainfo->privlock, flags);
 	insert_location = vhbainfo->nextinsert;
-	while (vhbainfo->pending[insert_location].sent != NULL) {
+	while (vhbainfo->pending[insert_location].sent) {
 		insert_location = (insert_location + 1) % MAX_PENDING_REQUESTS;
 		if (insert_location == (int)vhbainfo->nextinsert) {
 			spin_unlock_irqrestore(&vhbainfo->privlock, flags);
@@ -403,7 +403,7 @@ virthba_isr(int irq, void *dev_id)
 	u64 mask;
 	unsigned long long rc1;
 
-	if (virthbainfo == NULL)
+	if (!virthbainfo)
 		return IRQ_NONE;
 	virthbainfo->interrupts_rcvd++;
 	channel_header = virthbainfo->chinfo.queueinfo->chan;
@@ -458,7 +458,7 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id)
 	 */
 	scsihost = scsi_host_alloc(&virthba_driver_template,
 				   sizeof(struct virthba_info));
-	if (scsihost == NULL)
+	if (!scsihost)
 		return -ENODEV;
 
 	scsihost->this_id = UIS_MAGIC_VHBA;
@@ -499,7 +499,7 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id)
 	virthbainfo = (struct virthba_info *)scsihost->hostdata;
 	memset(virthbainfo, 0, sizeof(struct virthba_info));
 	for (i = 0; i < VIRTHBASOPENMAX; i++) {
-		if (virthbas_open[i].virthbainfo == NULL) {
+		if (!virthbas_open[i].virthbainfo) {
 			virthbas_open[i].virthbainfo = virthbainfo;
 			break;
 		}
@@ -607,7 +607,7 @@ forward_vdiskmgmt_command(enum vdisk_mgmt_types vdiskcmdtype,
 		return FAILED;
 
 	cmdrsp = kzalloc(SIZEOF_CMDRSP, GFP_ATOMIC);
-	if (cmdrsp == NULL)
+	if (!cmdrsp)
 		return FAILED;  /* reject */
 
 	init_waitqueue_head(&notifyevent);
@@ -660,8 +660,8 @@ forward_taskmgmt_command(enum task_mgmt_types tasktype,
 		return FAILED;
 
 	cmdrsp = kzalloc(SIZEOF_CMDRSP, GFP_ATOMIC);
-	if (cmdrsp == NULL)
-		return FAILED;  /* reject */
+	if (!cmdrsp)
+		return FAILED;	/* reject */
 
 	init_waitqueue_head(&notifyevent);
 
@@ -821,7 +821,7 @@ virthba_queue_command_lck(struct scsi_cmnd *scsicmd,
 	if (virthbainfo->serverdown || virthbainfo->serverchangingstate)
 		return SCSI_MLQUEUE_DEVICE_BUSY;
 	cmdrsp = kzalloc(SIZEOF_CMDRSP, GFP_ATOMIC);
-	if (cmdrsp == NULL)
+	if (!cmdrsp)
 		return 1;	/* reject the command */
 
 	/* now saving everything we need from scsi_cmd into cmdrsp
@@ -1183,7 +1183,7 @@ process_incoming_rsps(void *v)
 	UIS_DAEMONIZE("vhba_incoming");
 	/* alloc once and reuse */
 	cmdrsp = kmalloc(SZ, GFP_ATOMIC);
-	if (cmdrsp == NULL) {
+	if (!cmdrsp) {
 		complete_and_exit(&dc->threadinfo.has_stopped, 0);
 		return 0;
 	}
@@ -1226,7 +1226,7 @@ static ssize_t info_debugfs_read(struct file *file,
 		return -ENOMEM;
 
 	for (i = 0; i < VIRTHBASOPENMAX; i++) {
-		if (virthbas_open[i].virthbainfo == NULL)
+		if (!virthbas_open[i].virthbainfo)
 			continue;
 
 		virthbainfo = virthbas_open[i].virthbainfo;
@@ -1286,7 +1286,7 @@ static ssize_t enable_ints_write(struct file *file, const char __user *buffer,
 
 	/* set all counts to new_value usually 0 */
 	for (i = 0; i < VIRTHBASOPENMAX; i++) {
-		if (virthbas_open[i].virthbainfo != NULL) {
+		if (virthbas_open[i].virthbainfo) {
 			virthbainfo = virthbas_open[i].virthbainfo;
 			features_addr =
 				&virthbainfo->chinfo.queueinfo->chan->features;
@@ -1442,11 +1442,11 @@ virthba_parse_options(char *line)
 	char *next = line;
 
 	POSTCODE_LINUX_2(VHBA_CREATE_ENTRY_PC, POSTCODE_SEVERITY_INFO);
-	if (line == NULL || !*line)
+	if (!line || !*line)
 		return;
-	while ((line = next) != NULL) {
+	while ((line = next)) {
 		next = strchr(line, ' ');
-		if (next != NULL)
+		if (next)
 			*next++ = 0;
 		virthba_parse_line(line);
 	}
@@ -1490,7 +1490,7 @@ virthba_mod_init(void)
 		/* Initialize the serverdown workqueue */
 		virthba_serverdown_workqueue =
 		    create_singlethread_workqueue("virthba_serverdown");
-		if (virthba_serverdown_workqueue == NULL) {
+		if (!virthba_serverdown_workqueue) {
 			POSTCODE_LINUX_2(VHBA_CREATE_FAILURE_PC,
 					 POSTCODE_SEVERITY_ERR);
 			error = -1;
-- 
2.1.0

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

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

* [PATCH 03/69] staging: unisys: fix CamelCase in virthba_probe()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
  2015-03-16 17:57 ` [PATCH 01/69] staging: unisys: clean up NULL comparisons in visorchannel_funcs.c Benjamin Romer
  2015-03-16 17:57 ` [PATCH 02/69] staging: unisys: cleanup NULL comparisons in virthba.c Benjamin Romer
@ 2015-03-16 17:57 ` Benjamin Romer
  2015-03-16 17:57 ` [PATCH 04/69] staging: unisys: fix CamelCase global Poll_jiffies Benjamin Romer
                   ` (65 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Rename CamelCase local variable:
Features_addr => features_addr

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/virthba/virthba.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c
index 4a11ac6..d9001cc 100644
--- a/drivers/staging/unisys/virthba/virthba.c
+++ b/drivers/staging/unisys/virthba/virthba.c
@@ -555,13 +555,13 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id)
 		virthbainfo->interrupt_vector = -1;
 		POSTCODE_LINUX_2(VHBA_PROBE_FAILURE_PC, POSTCODE_SEVERITY_ERR);
 	} else {
-		u64 __iomem *Features_addr =
+		u64 __iomem *features_addr =
 		    &virthbainfo->chinfo.queueinfo->chan->features;
 		mask = ~(ULTRA_IO_CHANNEL_IS_POLLING |
 			 ULTRA_IO_DRIVER_DISABLES_INTS);
-		uisqueue_interlocked_and(Features_addr, mask);
+		uisqueue_interlocked_and(features_addr, mask);
 		mask = ULTRA_IO_DRIVER_ENABLES_INTS;
-		uisqueue_interlocked_or(Features_addr, mask);
+		uisqueue_interlocked_or(features_addr, mask);
 		rsltq_wait_usecs = 4000000;
 	}
 
-- 
2.1.0

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

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

* [PATCH 04/69] staging: unisys: fix CamelCase global Poll_jiffies
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (2 preceding siblings ...)
  2015-03-16 17:57 ` [PATCH 03/69] staging: unisys: fix CamelCase in virthba_probe() Benjamin Romer
@ 2015-03-16 17:57 ` Benjamin Romer
  2015-03-16 17:57 ` [PATCH 05/69] staging: unisys: remove unnecessary complication from delete_vbus_device Benjamin Romer
                   ` (64 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the name and references:
Poll_jiffies => poll_jiffies

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index ec258ae..b1399be 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -48,7 +48,7 @@
 * message, we switch back to fast polling mode.
 */
 #define MIN_IDLE_SECONDS 10
-static ulong Poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
+static ulong poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
 static ulong Most_recent_message_jiffies;	/* when we got our last
 						 * controlvm message */
 static inline char *
@@ -1884,17 +1884,15 @@ Away:
 		* processed our last controlvm message; slow down the
 		* polling
 		*/
-		if (Poll_jiffies != POLLJIFFIES_CONTROLVMCHANNEL_SLOW) {
-			Poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW;
-		}
+		if (poll_jiffies != POLLJIFFIES_CONTROLVMCHANNEL_SLOW)
+			poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW;
 	} else {
-		if (Poll_jiffies != POLLJIFFIES_CONTROLVMCHANNEL_FAST) {
-			Poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
-		}
+		if (poll_jiffies != POLLJIFFIES_CONTROLVMCHANNEL_FAST)
+			poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
 	}
 
 	queue_delayed_work(Periodic_controlvm_workqueue,
-			   &Periodic_controlvm_work, Poll_jiffies);
+			   &Periodic_controlvm_work, poll_jiffies);
 }
 
 static void
@@ -1996,10 +1994,10 @@ setup_crash_devices_work_queue(struct work_struct *work)
 
 Away:
 
-	Poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW;
+	poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW;
 
 	queue_delayed_work(Periodic_controlvm_workqueue,
-			   &Periodic_controlvm_work, Poll_jiffies);
+			   &Periodic_controlvm_work, poll_jiffies);
 }
 
 static void
@@ -2265,9 +2263,9 @@ visorchipset_init(void)
 			goto Away;
 		}
 		Most_recent_message_jiffies = jiffies;
-		Poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
+		poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
 		rc = queue_delayed_work(Periodic_controlvm_workqueue,
-					&Periodic_controlvm_work, Poll_jiffies);
+					&Periodic_controlvm_work, poll_jiffies);
 		if (rc < 0) {
 			POSTCODE_LINUX_2(QUEUE_DELAYED_WORK_PC,
 					 DIAG_SEVERITY_ERR);
-- 
2.1.0

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

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

* [PATCH 05/69] staging: unisys: remove unnecessary complication from delete_vbus_device
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (3 preceding siblings ...)
  2015-03-16 17:57 ` [PATCH 04/69] staging: unisys: fix CamelCase global Poll_jiffies Benjamin Romer
@ 2015-03-16 17:57 ` Benjamin Romer
  2015-03-16 17:57 ` [PATCH 06/69] staging: unisys: clean up NULL compares in virtpci.c Benjamin Romer
                   ` (63 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Take out the variable used to compute a comparison against NULL, and
just use the parameter directly.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/virtpci/virtpci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c
index 43b5736..2c5cd90 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -400,10 +400,9 @@ delete_vbus(struct del_vbus_guestpart *delparams)
 static int
 delete_vbus_device(struct device *vbus, void *data)
 {
-	int checkforroot = (data != NULL);
 	struct device *dev = &virtpci_rootbus_device;
 
-	if ((checkforroot) && match_busid(vbus, (void *)BUS_ID(dev))) {
+	if ((data) && match_busid(vbus, (void *)BUS_ID(dev))) {
 		/* skip it - don't delete root bus */
 		return 0;	/* pretend no error */
 	}
-- 
2.1.0

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

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

* [PATCH 06/69] staging: unisys: clean up NULL compares in virtpci.c
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (4 preceding siblings ...)
  2015-03-16 17:57 ` [PATCH 05/69] staging: unisys: remove unnecessary complication from delete_vbus_device Benjamin Romer
@ 2015-03-16 17:57 ` Benjamin Romer
  2015-03-16 17:57 ` [PATCH 07/69] staging: unisys: fix CamelCase variable Controlvm_Payload_Bytes_Buffered Benjamin Romer
                   ` (62 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Remove unnecessary NULLs by just using the pointer value directly.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/virtpci/virtpci.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c
index 2c5cd90..017df0b 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -809,7 +809,7 @@ static int virtpci_device_add(struct device *parentbus, int devtype,
 
 	/* add a Virtual Device */
 	virtpcidev = kzalloc(sizeof(*virtpcidev), GFP_ATOMIC);
-	if (virtpcidev == NULL) {
+	if (!virtpcidev) {
 		POSTCODE_LINUX_2(MALLOC_FAILURE_PC, POSTCODE_SEVERITY_ERR);
 		return 0;
 	}
@@ -1076,8 +1076,8 @@ static int virtpci_device_del(struct device *parentbus,
 	/* see if we are to delete all - NOTE: all implies we have a
 	 * valid parentbus
 	 */
-	all = ((devtype == VIRTHBA_TYPE) && (wwnn == NULL)) ||
-	    ((devtype == VIRTNIC_TYPE) && (macaddr == NULL));
+	all = ((devtype == VIRTHBA_TYPE) && (!wwnn)) ||
+	    ((devtype == VIRTNIC_TYPE) && (!macaddr));
 
 	/* find all the vhba or vnic or both in virtpci device list
 	* keep list of ones we are deleting so we can call
@@ -1206,9 +1206,8 @@ int virtpci_register_driver(struct virtpci_driver *drv)
 {
 	int result = 0;
 
-	if (drv->id_table == NULL)
+	if (!drv->id_table)
 		return 1;
-
 	/* initialize core driver fields needed to call driver_register */
 	drv->core_driver.name = drv->name;	/* name of driver in sysfs */
 	drv->core_driver.bus = &virtpci_bus_type;	/* type of bus this
-- 
2.1.0

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

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

* [PATCH 07/69] staging: unisys: fix CamelCase variable Controlvm_Payload_Bytes_Buffered
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (5 preceding siblings ...)
  2015-03-16 17:57 ` [PATCH 06/69] staging: unisys: clean up NULL compares in virtpci.c Benjamin Romer
@ 2015-03-16 17:57 ` Benjamin Romer
  2015-03-16 17:57 ` [PATCH 08/69] staging: unisys: remove typedef for PARSER_CONTEXT Benjamin Romer
                   ` (61 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix camelcase name:
Controlvm_Payload_Bytes_Buffered => controlvm_payload_bytes_buffered

Signed-off-by: Benjamin Romer <benjamin.romer@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 0683472..959d540 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) {
 		if (tryAgain)
 			*tryAgain = TRUE;
@@ -124,7 +124,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);
@@ -224,7 +224,7 @@ parser_done(PARSER_CONTEXT *ctx)
 {
 	if (!ctx)
 		return;
-	Controlvm_Payload_Bytes_Buffered -= ctx->param_bytes;
+	controlvm_payload_bytes_buffered -= ctx->param_bytes;
 	kfree(ctx);
 }
 
-- 
2.1.0

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

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

* [PATCH 08/69] staging: unisys: remove typedef for PARSER_CONTEXT
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (6 preceding siblings ...)
  2015-03-16 17:57 ` [PATCH 07/69] staging: unisys: fix CamelCase variable Controlvm_Payload_Bytes_Buffered Benjamin Romer
@ 2015-03-16 17:57 ` Benjamin Romer
  2015-03-16 17:57 ` [PATCH 09/69] staging: unisys: refactor parser_init_guts() Benjamin Romer
                   ` (60 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Convert all references to PARSER_CONTEXT into struct parser_context.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 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 959d540..056facd 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 7e015d1..aa50ff8 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 b1399be..284ed4f 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 <pnext> 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.1.0

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

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

* [PATCH 09/69] staging: unisys: refactor parser_init_guts()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (7 preceding siblings ...)
  2015-03-16 17:57 ` [PATCH 08/69] staging: unisys: remove typedef for PARSER_CONTEXT Benjamin Romer
@ 2015-03-16 17:57 ` Benjamin Romer
  2015-03-16 17:57 ` [PATCH 10/69] staging: unisys: fix CamelCase names in parser_init() Benjamin Romer
                   ` (59 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix CamelCase names:

isLocal => local
hasStandardPayloadHeader => standard_payload_header
tryAgain => retry
Away => cleanup

Fix spacing after typecasts, add missing braces to the if statement, and
eliminate the NULL comparison by just using the pointer value directly.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/parser.c | 48 ++++++++++++++--------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c b/drivers/staging/unisys/visorchipset/parser.c
index 056facd..00586fa 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -41,8 +41,8 @@ struct parser_context {
 };
 
 static struct parser_context *
-parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
-		 BOOL hasStandardPayloadHeader, BOOL *tryAgain)
+parser_init_guts(u64 addr, u32 bytes, BOOL local,
+		 BOOL standard_payload_header, BOOL *retry)
 {
 	int allocbytes = sizeof(struct parser_context) + bytes;
 	struct parser_context *rc = NULL;
@@ -50,26 +50,26 @@ 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 (retry)
+		*retry = FALSE;
+	if (!standard_payload_header)
 		/* alloc and 0 extra byte to ensure payload is
 		 * '\0'-terminated
 		 */
 		allocbytes++;
 	if ((controlvm_payload_bytes_buffered + bytes)
 	    > MAX_CONTROLVM_PAYLOAD_BYTES) {
-		if (tryAgain)
-			*tryAgain = TRUE;
+		if (retry)
+			*retry = TRUE;
 		rc = NULL;
-		goto Away;
+		goto cleanup;
 	}
 	ctx = kzalloc(allocbytes, GFP_KERNEL|__GFP_NORETRY);
-	if (ctx == NULL) {
-		if (tryAgain)
-			*tryAgain = TRUE;
+	if (!ctx) {
+		if (retry)
+			*retry = TRUE;
 		rc = NULL;
-		goto Away;
+		goto cleanup;
 	}
 
 	ctx->allocbytes = allocbytes;
@@ -77,12 +77,12 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
 	ctx->curr = NULL;
 	ctx->bytes_remaining = 0;
 	ctx->byte_stream = FALSE;
-	if (isLocal) {
+	if (local) {
 		void *p;
 
 		if (addr > virt_to_phys(high_memory - 1)) {
 			rc = NULL;
-			goto Away;
+			goto cleanup;
 		}
 		p = __va((ulong) (addr));
 		memcpy(ctx->data, p, bytes);
@@ -90,42 +90,42 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal,
 		rgn = visor_memregion_create(addr, bytes);
 		if (!rgn) {
 			rc = NULL;
-			goto Away;
+			goto cleanup;
 		}
 		if (visor_memregion_read(rgn, 0, ctx->data, bytes) < 0) {
 			rc = NULL;
-			goto Away;
+			goto cleanup;
 		}
 	}
-	if (!hasStandardPayloadHeader) {
+	if (!standard_payload_header) {
 		ctx->byte_stream = TRUE;
 		rc = ctx;
-		goto Away;
+		goto cleanup;
 	}
 	phdr = (struct spar_controlvm_parameters_header *)(ctx->data);
 	if (phdr->total_length != bytes) {
 		rc = NULL;
-		goto Away;
+		goto cleanup;
 	}
 	if (phdr->total_length < phdr->header_length) {
 		rc = NULL;
-		goto Away;
+		goto cleanup;
 	}
 	if (phdr->header_length <
 	    sizeof(struct spar_controlvm_parameters_header)) {
 		rc = NULL;
-		goto Away;
+		goto cleanup;
 	}
 
 	rc = ctx;
-Away:
+cleanup:
 	if (rgn) {
 		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;
-- 
2.1.0

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

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

* [PATCH 10/69] staging: unisys: fix CamelCase names in parser_init()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (8 preceding siblings ...)
  2015-03-16 17:57 ` [PATCH 09/69] staging: unisys: refactor parser_init_guts() Benjamin Romer
@ 2015-03-16 17:57 ` Benjamin Romer
  2015-03-16 17:57 ` [PATCH 11/69] staging: unisys: refactor parser_init_byteStream Benjamin Romer
                   ` (58 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix CamelCase names:
isLocal => local
tryAgain => retry

Signed-off-by: Benjamin Romer <benjamin.romer@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 00586fa..f10b443 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -135,9 +135,9 @@ cleanup:
 }
 
 struct parser_context *
-parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain)
+parser_init(u64 addr, u32 bytes, BOOL local, BOOL *retry)
 {
-	return parser_init_guts(addr, bytes, isLocal, TRUE, tryAgain);
+	return parser_init_guts(addr, bytes, local, TRUE, retry);
 }
 
 /* Call this instead of parser_init() if the payload area consists of just
-- 
2.1.0

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

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

* [PATCH 11/69] staging: unisys: refactor parser_init_byteStream
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (9 preceding siblings ...)
  2015-03-16 17:57 ` [PATCH 10/69] staging: unisys: fix CamelCase names in parser_init() Benjamin Romer
@ 2015-03-16 17:57 ` Benjamin Romer
  2015-03-16 17:57 ` [PATCH 12/69] staging: unisys: refactor parser_byteStream_get Benjamin Romer
                   ` (57 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix CamelCase names:
parser_init_byteStream => parser_init_byte_stream
isLocal => local
tryAgain => retry

Update references to the changed function name.

Signed-off-by: Benjamin Romer <benjamin.romer@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 f10b443..29d840c 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -146,9 +146,9 @@ parser_init(u64 addr, u32 bytes, BOOL local, BOOL *retry)
  * parser_byteStream_get() to obtain the data.
  */
 struct parser_context *
-parser_init_byteStream(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain)
+parser_init_byte_stream(u64 addr, u32 bytes, BOOL local, BOOL *retry)
 {
-	return parser_init_guts(addr, bytes, isLocal, FALSE, tryAgain);
+	return parser_init_guts(addr, bytes, local, FALSE, retry);
 }
 
 /* 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 aa50ff8..a06772f 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -32,8 +32,8 @@ typedef enum {
 
 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);
+struct parser_context *parser_init_byte_stream(u64 addr, u32 bytes, BOOL local,
+				       BOOL *retry);
 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);
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 284ed4f..b1b8c94 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1717,7 +1717,7 @@ handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
 		BOOL retry = FALSE;
 
 		parser_ctx =
-		    parser_init_byteStream(parametersAddr, parametersBytes,
+		    parser_init_byte_stream(parametersAddr, parametersBytes,
 					   isLocalAddr, &retry);
 		if (!parser_ctx && retry)
 			return FALSE;
-- 
2.1.0

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

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

* [PATCH 12/69] staging: unisys: refactor parser_byteStream_get
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (10 preceding siblings ...)
  2015-03-16 17:57 ` [PATCH 11/69] staging: unisys: refactor parser_init_byteStream Benjamin Romer
@ 2015-03-16 17:57 ` Benjamin Romer
  2015-03-16 17:57 ` [PATCH 13/69] staging: unisys: fix CamelCase global Most_recent_message_jiffies Benjamin Romer
                   ` (56 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix this CamelCase function name:
parser_byteStream_get => parser_byte_stream_get

Update all references to use the fixed name. Fix the spacing in the typecast.

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

diff --git a/drivers/staging/unisys/visorchipset/parser.c b/drivers/staging/unisys/visorchipset/parser.c
index 29d840c..d8a2d6f 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -165,14 +165,13 @@ parser_simpleString_get(struct parser_context *ctx)
 
 /* Obtain a copy of the buffer in the payload area.
  */
-void *
-parser_byteStream_get(struct parser_context *ctx, ulong *nbytes)
+void *parser_byte_stream_get(struct parser_context *ctx, ulong *nbytes)
 {
 	if (!ctx->byte_stream)
 		return NULL;
 	if (nbytes)
 		*nbytes = ctx->param_bytes;
-	return (void *) ctx->data;
+	return (void *)ctx->data;
 }
 
 uuid_le
diff --git a/drivers/staging/unisys/visorchipset/parser.h b/drivers/staging/unisys/visorchipset/parser.h
index a06772f..2b903f1 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -40,7 +40,7 @@ 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_byte_stream_get(struct parser_context *ctx, ulong *nbytes);
 void parser_done(struct parser_context *ctx);
 
 #endif
-- 
2.1.0

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

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

* [PATCH 13/69] staging: unisys: fix CamelCase global Most_recent_message_jiffies
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (11 preceding siblings ...)
  2015-03-16 17:57 ` [PATCH 12/69] staging: unisys: refactor parser_byteStream_get Benjamin Romer
@ 2015-03-16 17:57 ` Benjamin Romer
  2015-03-16 17:57 ` [PATCH 14/69] staging: unisys: fix CamelCase controlvm globals Benjamin Romer
                   ` (55 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase global variable in visorchipset_main.c:
Most_recent_message_jiffies => most_recent_message_jiffies

Update all references to use the corrected name.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index b1b8c94..ca6bce1 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -49,7 +49,7 @@
 */
 #define MIN_IDLE_SECONDS 10
 static ulong poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
-static ulong Most_recent_message_jiffies;	/* when we got our last
+static ulong most_recent_message_jiffies;	/* when we got our last
 						 * controlvm message */
 static inline char *
 NONULLSTR(char *s)
@@ -1856,7 +1856,7 @@ controlvm_periodic_work(struct work_struct *work)
 
 	handle_command_failed = FALSE;
 	while (gotACommand && (!handle_command_failed)) {
-		Most_recent_message_jiffies = jiffies;
+		most_recent_message_jiffies = jiffies;
 		if (handle_command(inmsg,
 				   visorchannel_get_physaddr
 				   (ControlVm_channel)))
@@ -1880,7 +1880,7 @@ controlvm_periodic_work(struct work_struct *work)
 Away:
 
 	if (time_after(jiffies,
-		       Most_recent_message_jiffies + (HZ * MIN_IDLE_SECONDS))) {
+		       most_recent_message_jiffies + (HZ * MIN_IDLE_SECONDS))) {
 		/* it's been longer than MIN_IDLE_SECONDS since we
 		* processed our last controlvm message; slow down the
 		* polling
@@ -2263,7 +2263,7 @@ visorchipset_init(void)
 			rc = -ENOMEM;
 			goto Away;
 		}
-		Most_recent_message_jiffies = jiffies;
+		most_recent_message_jiffies = jiffies;
 		poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
 		rc = queue_delayed_work(Periodic_controlvm_workqueue,
 					&Periodic_controlvm_work, poll_jiffies);
-- 
2.1.0

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

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

* [PATCH 14/69] staging: unisys: fix CamelCase controlvm globals
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (12 preceding siblings ...)
  2015-03-16 17:57 ` [PATCH 13/69] staging: unisys: fix CamelCase global Most_recent_message_jiffies Benjamin Romer
@ 2015-03-16 17:57 ` Benjamin Romer
  2015-03-16 17:57 ` [PATCH 15/69] staging: unisys: fix CamelCase message header variables Benjamin Romer
                   ` (54 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase variable names:
Periodic_controlvm_work => periodic_controlvm_work
Periodic_controlvm_workqueue => periodic_controlvm_workqueue

Update all references to use the corrected names.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 32 +++++++++++-----------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index ca6bce1..8fdecdd 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -65,8 +65,8 @@ static int clientregistered;
 #define MAX_CHIPSET_EVENTS 2
 static u8 chipset_events[MAX_CHIPSET_EVENTS] = { 0, 0 };
 
-static struct delayed_work Periodic_controlvm_work;
-static struct workqueue_struct *Periodic_controlvm_workqueue;
+static struct delayed_work periodic_controlvm_work;
+static struct workqueue_struct *periodic_controlvm_workqueue;
 static DEFINE_SEMAPHORE(NotifierLock);
 
 static struct controlvm_message_header g_DiagMsgHdr;
@@ -1892,8 +1892,8 @@ Away:
 			poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
 	}
 
-	queue_delayed_work(Periodic_controlvm_workqueue,
-			   &Periodic_controlvm_work, poll_jiffies);
+	queue_delayed_work(periodic_controlvm_workqueue,
+			   &periodic_controlvm_work, poll_jiffies);
 }
 
 static void
@@ -1997,8 +1997,8 @@ Away:
 
 	poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW;
 
-	queue_delayed_work(Periodic_controlvm_workqueue,
-			   &Periodic_controlvm_work, poll_jiffies);
+	queue_delayed_work(periodic_controlvm_workqueue,
+			   &periodic_controlvm_work, poll_jiffies);
 }
 
 static void
@@ -2249,15 +2249,15 @@ visorchipset_init(void)
 	if (!visorchipset_disable_controlvm) {
 		/* if booting in a crash kernel */
 		if (visorchipset_crash_kernel)
-			INIT_DELAYED_WORK(&Periodic_controlvm_work,
+			INIT_DELAYED_WORK(&periodic_controlvm_work,
 					  setup_crash_devices_work_queue);
 		else
-			INIT_DELAYED_WORK(&Periodic_controlvm_work,
+			INIT_DELAYED_WORK(&periodic_controlvm_work,
 					  controlvm_periodic_work);
-		Periodic_controlvm_workqueue =
+		periodic_controlvm_workqueue =
 		    create_singlethread_workqueue("visorchipset_controlvm");
 
-		if (Periodic_controlvm_workqueue == NULL) {
+		if (periodic_controlvm_workqueue == NULL) {
 			POSTCODE_LINUX_2(CREATE_WORKQUEUE_FAILED_PC,
 					 DIAG_SEVERITY_ERR);
 			rc = -ENOMEM;
@@ -2265,8 +2265,8 @@ visorchipset_init(void)
 		}
 		most_recent_message_jiffies = jiffies;
 		poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
-		rc = queue_delayed_work(Periodic_controlvm_workqueue,
-					&Periodic_controlvm_work, poll_jiffies);
+		rc = queue_delayed_work(periodic_controlvm_workqueue,
+					&periodic_controlvm_work, poll_jiffies);
 		if (rc < 0) {
 			POSTCODE_LINUX_2(QUEUE_DELAYED_WORK_PC,
 					 DIAG_SEVERITY_ERR);
@@ -2299,10 +2299,10 @@ visorchipset_exit(void)
 	if (visorchipset_disable_controlvm) {
 		;
 	} else {
-		cancel_delayed_work(&Periodic_controlvm_work);
-		flush_workqueue(Periodic_controlvm_workqueue);
-		destroy_workqueue(Periodic_controlvm_workqueue);
-		Periodic_controlvm_workqueue = NULL;
+		cancel_delayed_work(&periodic_controlvm_work);
+		flush_workqueue(periodic_controlvm_workqueue);
+		destroy_workqueue(periodic_controlvm_workqueue);
+		periodic_controlvm_workqueue = NULL;
 		destroy_controlvm_payload_info(&ControlVm_payload_info);
 	}
 	Test_Vnic_channel = NULL;
-- 
2.1.0

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

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

* [PATCH 15/69] staging: unisys: fix CamelCase message header variables
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (13 preceding siblings ...)
  2015-03-16 17:57 ` [PATCH 14/69] staging: unisys: fix CamelCase controlvm globals Benjamin Romer
@ 2015-03-16 17:57 ` Benjamin Romer
  2015-03-16 17:57 ` [PATCH 16/69] staging: unisys: fix CamelCase semaphore NotifierLock Benjamin Romer
                   ` (53 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase variable names:

g_DiagMsgHdr => g_diag_msg_hdr
g_ChipSetMsgHdr => g_chipset_msg_hdr
g_DelDumpMsgHdr => g_del_dump_msg_hdr

Update all references to use the corrected names.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 28 +++++++++++-----------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 8fdecdd..2c97030 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -69,9 +69,9 @@ static struct delayed_work periodic_controlvm_work;
 static struct workqueue_struct *periodic_controlvm_workqueue;
 static DEFINE_SEMAPHORE(NotifierLock);
 
-static struct controlvm_message_header g_DiagMsgHdr;
-static struct controlvm_message_header g_ChipSetMsgHdr;
-static struct controlvm_message_header g_DelDumpMsgHdr;
+static struct controlvm_message_header g_diag_msg_hdr;
+static struct controlvm_message_header g_chipset_msg_hdr;
+static struct controlvm_message_header g_del_dump_msg_hdr;
 static const uuid_le UltraDiagPoolChannelProtocolGuid =
 	SPAR_DIAG_POOL_CHANNEL_PROTOCOL_UUID;
 /* 0xffffff is an invalid Bus/Device number */
@@ -1435,7 +1435,7 @@ chipset_ready(struct controlvm_message_header *msgHdr)
 		/* Send CHIPSET_READY response when all modules have been loaded
 		 * and disks mounted for the partition
 		 */
-		g_ChipSetMsgHdr = *msgHdr;
+		g_chipset_msg_hdr = *msgHdr;
 	}
 }
 
@@ -1754,7 +1754,7 @@ handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
 			/* save the hdr and cmd structures for later use */
 			/* when sending back the response to Command */
 			my_device_changestate(&inmsg);
-			g_DiagMsgHdr = inmsg.hdr;
+			g_diag_msg_hdr = inmsg.hdr;
 			g_DeviceChangeStatePacket = inmsg.cmd;
 			break;
 		}
@@ -1828,11 +1828,11 @@ controlvm_periodic_work(struct work_struct *work)
 	 * should be sent
 	 */
 	if (visorchipset_holdchipsetready
-	    && (g_ChipSetMsgHdr.id != CONTROLVM_INVALID)) {
+	    && (g_chipset_msg_hdr.id != CONTROLVM_INVALID)) {
 		if (check_chipset_events() == 1) {
-			controlvm_respond(&g_ChipSetMsgHdr, 0);
+			controlvm_respond(&g_chipset_msg_hdr, 0);
 			clear_chipset_events();
-			memset(&g_ChipSetMsgHdr, 0,
+			memset(&g_chipset_msg_hdr, 0,
 			       sizeof(struct controlvm_message_header));
 		}
 	}
@@ -2231,11 +2231,11 @@ visorchipset_init(void)
 		goto Away;
 	}
 
-	memset(&g_DiagMsgHdr, 0, sizeof(struct controlvm_message_header));
+	memset(&g_diag_msg_hdr, 0, sizeof(struct controlvm_message_header));
 
-	memset(&g_ChipSetMsgHdr, 0, sizeof(struct controlvm_message_header));
+	memset(&g_chipset_msg_hdr, 0, sizeof(struct controlvm_message_header));
 
-	memset(&g_DelDumpMsgHdr, 0, sizeof(struct controlvm_message_header));
+	memset(&g_del_dump_msg_hdr, 0, sizeof(struct controlvm_message_header));
 
 	Putfile_buffer_list_pool =
 	    kmem_cache_create(Putfile_buffer_list_pool_name,
@@ -2313,11 +2313,11 @@ visorchipset_exit(void)
 
 	cleanup_controlvm_structures();
 
-	memset(&g_DiagMsgHdr, 0, sizeof(struct controlvm_message_header));
+	memset(&g_diag_msg_hdr, 0, sizeof(struct controlvm_message_header));
 
-	memset(&g_ChipSetMsgHdr, 0, sizeof(struct controlvm_message_header));
+	memset(&g_chipset_msg_hdr, 0, sizeof(struct controlvm_message_header));
 
-	memset(&g_DelDumpMsgHdr, 0, sizeof(struct controlvm_message_header));
+	memset(&g_del_dump_msg_hdr, 0, sizeof(struct controlvm_message_header));
 
 	visorchannel_destroy(ControlVm_channel);
 
-- 
2.1.0

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

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

* [PATCH 16/69] staging: unisys: fix CamelCase semaphore NotifierLock
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (14 preceding siblings ...)
  2015-03-16 17:57 ` [PATCH 15/69] staging: unisys: fix CamelCase message header variables Benjamin Romer
@ 2015-03-16 17:57 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 17/69] staging: unisys: fix CamelCase name Benjamin Romer
                   ` (52 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Rename the semaphore
NotifierLock => notifier_lock

Update all references to use the new name.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../staging/unisys/visorchipset/visorchipset_main.c    | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 2c97030..7687155 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -67,7 +67,7 @@ static u8 chipset_events[MAX_CHIPSET_EVENTS] = { 0, 0 };
 
 static struct delayed_work periodic_controlvm_work;
 static struct workqueue_struct *periodic_controlvm_workqueue;
-static DEFINE_SEMAPHORE(NotifierLock);
+static DEFINE_SEMAPHORE(notifier_lock);
 
 static struct controlvm_message_header g_diag_msg_hdr;
 static struct controlvm_message_header g_chipset_msg_hdr;
@@ -587,7 +587,7 @@ visorchipset_register_busdev_server(
 			struct visorchipset_busdev_responders *responders,
 			struct ultra_vbus_deviceinfo *driver_info)
 {
-	down(&NotifierLock);
+	down(&notifier_lock);
 	if (notifiers == NULL) {
 		memset(&BusDev_Server_Notifiers, 0,
 		       sizeof(BusDev_Server_Notifiers));
@@ -602,7 +602,7 @@ visorchipset_register_busdev_server(
 		bus_device_info_init(driver_info, "chipset", "visorchipset",
 				   VERSION, NULL);
 
-	up(&NotifierLock);
+	up(&notifier_lock);
 }
 EXPORT_SYMBOL_GPL(visorchipset_register_busdev_server);
 
@@ -612,7 +612,7 @@ visorchipset_register_busdev_client(
 			struct visorchipset_busdev_responders *responders,
 			struct ultra_vbus_deviceinfo *driver_info)
 {
-	down(&NotifierLock);
+	down(&notifier_lock);
 	if (notifiers == NULL) {
 		memset(&BusDev_Client_Notifiers, 0,
 		       sizeof(BusDev_Client_Notifiers));
@@ -626,7 +626,7 @@ visorchipset_register_busdev_client(
 	if (driver_info)
 		bus_device_info_init(driver_info, "chipset(bolts)",
 				     "visorchipset", VERSION, NULL);
-	up(&NotifierLock);
+	up(&notifier_lock);
 }
 EXPORT_SYMBOL_GPL(visorchipset_register_busdev_client);
 
@@ -915,7 +915,7 @@ bus_epilog(u32 busNo,
 	} else
 		pBusInfo->pending_msg_hdr.id = CONTROLVM_INVALID;
 
-	down(&NotifierLock);
+	down(&notifier_lock);
 	if (response == CONTROLVM_RESP_SUCCESS) {
 		switch (cmd) {
 		case CONTROLVM_BUS_CREATE:
@@ -960,7 +960,7 @@ bus_epilog(u32 busNo,
 		;
 	else
 		bus_responder(cmd, busNo, response);
-	up(&NotifierLock);
+	up(&notifier_lock);
 }
 
 static void
@@ -991,7 +991,7 @@ device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
 	} else
 		pDevInfo->pending_msg_hdr.id = CONTROLVM_INVALID;
 
-	down(&NotifierLock);
+	down(&notifier_lock);
 	if (response >= 0) {
 		switch (cmd) {
 		case CONTROLVM_DEVICE_CREATE:
@@ -1056,7 +1056,7 @@ device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
 		;
 	else
 		device_responder(cmd, busNo, devNo, response);
-	up(&NotifierLock);
+	up(&notifier_lock);
 }
 
 static void
-- 
2.1.0

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

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

* [PATCH 17/69] staging: unisys: fix CamelCase name
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (15 preceding siblings ...)
  2015-03-16 17:57 ` [PATCH 16/69] staging: unisys: fix CamelCase semaphore NotifierLock Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 18/69] staging: unisys: fix CamelCased diagpool bus/dev names Benjamin Romer
                   ` (51 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix CamelCase global variable:

UltraDiagPoolChannelProtocolGuid => spar_diag_pool_channel_protocol_uuid

Update all references to use the fixed name.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 7687155..381d305 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -72,7 +72,7 @@ static DEFINE_SEMAPHORE(notifier_lock);
 static struct controlvm_message_header g_diag_msg_hdr;
 static struct controlvm_message_header g_chipset_msg_hdr;
 static struct controlvm_message_header g_del_dump_msg_hdr;
-static const uuid_le UltraDiagPoolChannelProtocolGuid =
+static const uuid_le spar_diag_pool_channel_protocol_uuid =
 	SPAR_DIAG_POOL_CHANNEL_PROTOCOL_UUID;
 /* 0xffffff is an invalid Bus/Device number */
 static ulong g_diagpoolBusNo = 0xffffff;
@@ -90,7 +90,8 @@ static struct controlvm_message_packet g_DeviceChangeStatePacket;
 #define FOR_VISORBUS(channel_type_guid) (!(FOR_VISORHACKBUS(channel_type_guid)))
 
 #define is_diagpool_channel(channel_type_guid) \
-	 (uuid_le_cmp(channel_type_guid, UltraDiagPoolChannelProtocolGuid) == 0)
+	(uuid_le_cmp(channel_type_guid,\
+		     spar_diag_pool_channel_protocol_uuid) == 0)
 
 static LIST_HEAD(BusInfoList);
 static LIST_HEAD(DevInfoList);
-- 
2.1.0

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

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

* [PATCH 18/69] staging: unisys: fix CamelCased diagpool bus/dev names
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (16 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 17/69] staging: unisys: fix CamelCase name Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 19/69] staging: unisys: fix CamelCase name for devicechangestate packet Benjamin Romer
                   ` (50 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix CamelCase names:

g_diagpoolBusNo => g_diagpool_bus_no
g_diagpoolDevNo => g_diagpool_dev_no

Update all references to the changed names.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 381d305..33fe82d 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -75,8 +75,8 @@ static struct controlvm_message_header g_del_dump_msg_hdr;
 static const uuid_le spar_diag_pool_channel_protocol_uuid =
 	SPAR_DIAG_POOL_CHANNEL_PROTOCOL_UUID;
 /* 0xffffff is an invalid Bus/Device number */
-static ulong g_diagpoolBusNo = 0xffffff;
-static ulong g_diagpoolDevNo = 0xffffff;
+static ulong g_diagpool_bus_no = 0xffffff;
+static ulong g_diagpool_dev_no = 0xffffff;
 static struct controlvm_message_packet g_DeviceChangeStatePacket;
 
 /* Only VNIC and VHBA channels are sent to visorclientbus (aka
@@ -707,9 +707,9 @@ controlvm_respond(struct controlvm_message_header *msgHdr, int response)
 	* back the deviceChangeState structure in the packet. */
 	if (msgHdr->id == CONTROLVM_DEVICE_CHANGESTATE
 	    && g_DeviceChangeStatePacket.device_change_state.bus_no ==
-	    g_diagpoolBusNo
+	    g_diagpool_bus_no
 	    && g_DeviceChangeStatePacket.device_change_state.dev_no ==
-	    g_diagpoolDevNo)
+	    g_diagpool_dev_no)
 		outmsg.cmd = g_DeviceChangeStatePacket;
 	if (outmsg.hdr.flags.test_message == 1)
 		return;
@@ -1030,8 +1030,8 @@ device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
 				/* this is lite pause where channel is
 				 * still valid just 'pause' of it
 				 */
-				if (busNo == g_diagpoolBusNo
-				    && devNo == g_diagpoolDevNo) {
+				if (busNo == g_diagpool_bus_no
+				    && devNo == g_diagpool_dev_no) {
 					/* this will trigger the
 					 * diag_shutdown.sh script in
 					 * the visorchipset hotplug */
@@ -1241,8 +1241,8 @@ Away:
 	/* get the bus and devNo for DiagPool channel */
 	if (pDevInfo &&
 	    is_diagpool_channel(pDevInfo->chan_info.channel_type_uuid)) {
-		g_diagpoolBusNo = busNo;
-		g_diagpoolDevNo = devNo;
+		g_diagpool_bus_no = busNo;
+		g_diagpool_dev_no = devNo;
 	}
 	device_epilog(busNo, devNo, segment_state_running,
 		      CONTROLVM_DEVICE_CREATE, &inmsg->hdr, rc,
-- 
2.1.0

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

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

* [PATCH 19/69] staging: unisys: fix CamelCase name for devicechangestate packet
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (17 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 18/69] staging: unisys: fix CamelCased diagpool bus/dev names Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 20/69] staging: unisys: fix CamelCase list names Benjamin Romer
                   ` (49 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the variable's CamelCase name:

g_DeviceChangeStatePacket => g_devicechangestate_packet

Update all references to use the fixed name.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 33fe82d..f8dfc5c 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -77,7 +77,7 @@ static const uuid_le spar_diag_pool_channel_protocol_uuid =
 /* 0xffffff is an invalid Bus/Device number */
 static ulong g_diagpool_bus_no = 0xffffff;
 static ulong g_diagpool_dev_no = 0xffffff;
-static struct controlvm_message_packet g_DeviceChangeStatePacket;
+static struct controlvm_message_packet g_devicechangestate_packet;
 
 /* Only VNIC and VHBA channels are sent to visorclientbus (aka
  * "visorhackbus")
@@ -706,11 +706,11 @@ controlvm_respond(struct controlvm_message_header *msgHdr, int response)
 	/* For DiagPool channel DEVICE_CHANGESTATE, we need to send
 	* back the deviceChangeState structure in the packet. */
 	if (msgHdr->id == CONTROLVM_DEVICE_CHANGESTATE
-	    && g_DeviceChangeStatePacket.device_change_state.bus_no ==
+	    && g_devicechangestate_packet.device_change_state.bus_no ==
 	    g_diagpool_bus_no
-	    && g_DeviceChangeStatePacket.device_change_state.dev_no ==
+	    && g_devicechangestate_packet.device_change_state.dev_no ==
 	    g_diagpool_dev_no)
-		outmsg.cmd = g_DeviceChangeStatePacket;
+		outmsg.cmd = g_devicechangestate_packet;
 	if (outmsg.hdr.flags.test_message == 1)
 		return;
 
@@ -1756,7 +1756,7 @@ handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
 			/* when sending back the response to Command */
 			my_device_changestate(&inmsg);
 			g_diag_msg_hdr = inmsg.hdr;
-			g_DeviceChangeStatePacket = inmsg.cmd;
+			g_devicechangestate_packet = inmsg.cmd;
 			break;
 		}
 		break;
-- 
2.1.0

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

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

* [PATCH 20/69] staging: unisys: fix CamelCase list names
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (18 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 19/69] staging: unisys: fix CamelCase name for devicechangestate packet Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 21/69] staging: unisys: fix placement of logical ops in visorchipset_main.c Benjamin Romer
                   ` (48 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Rename the CamelCased list names:

BusInfoList => bus_info_list
DevInfoList => dev_info_list

Update all references to use the fixed names.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 48 +++++++++++-----------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index f8dfc5c..4f36b4b 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -93,8 +93,8 @@ static struct controlvm_message_packet g_devicechangestate_packet;
 	(uuid_le_cmp(channel_type_guid,\
 		     spar_diag_pool_channel_protocol_uuid) == 0)
 
-static LIST_HEAD(BusInfoList);
-static LIST_HEAD(DevInfoList);
+static LIST_HEAD(bus_info_list);
+static LIST_HEAD(dev_info_list);
 
 static struct visorchannel *ControlVm_channel;
 
@@ -637,13 +637,13 @@ cleanup_controlvm_structures(void)
 	struct visorchipset_bus_info *bi, *tmp_bi;
 	struct visorchipset_device_info *di, *tmp_di;
 
-	list_for_each_entry_safe(bi, tmp_bi, &BusInfoList, entry) {
+	list_for_each_entry_safe(bi, tmp_bi, &bus_info_list, entry) {
 		busInfo_clear(bi);
 		list_del(&bi->entry);
 		kfree(bi);
 	}
 
-	list_for_each_entry_safe(di, tmp_di, &DevInfoList, entry) {
+	list_for_each_entry_safe(di, tmp_di, &dev_info_list, entry) {
 		devInfo_clear(di);
 		list_del(&di->entry);
 		kfree(di);
@@ -812,7 +812,7 @@ bus_responder(enum controlvm_id cmdId, ulong busNo, int response)
 	struct visorchipset_bus_info *p = NULL;
 	BOOL need_clear = FALSE;
 
-	p = findbus(&BusInfoList, busNo);
+	p = findbus(&bus_info_list, busNo);
 	if (!p)
 		return;
 
@@ -820,7 +820,7 @@ bus_responder(enum controlvm_id cmdId, ulong busNo, int response)
 		if ((cmdId == CONTROLVM_BUS_CREATE) &&
 		    (response != (-CONTROLVM_RESP_ERROR_ALREADY_DONE)))
 			/* undo the row we just created... */
-			delbusdevices(&DevInfoList, busNo);
+			delbusdevices(&dev_info_list, busNo);
 	} else {
 		if (cmdId == CONTROLVM_BUS_CREATE)
 			p->state.created = 1;
@@ -836,7 +836,7 @@ bus_responder(enum controlvm_id cmdId, ulong busNo, int response)
 	p->pending_msg_hdr.id = CONTROLVM_INVALID;
 	if (need_clear) {
 		busInfo_clear(p);
-		delbusdevices(&DevInfoList, busNo);
+		delbusdevices(&dev_info_list, busNo);
 	}
 }
 
@@ -848,7 +848,7 @@ device_changestate_responder(enum controlvm_id cmdId,
 	struct visorchipset_device_info *p = NULL;
 	struct controlvm_message outmsg;
 
-	p = finddevice(&DevInfoList, busNo, devNo);
+	p = finddevice(&dev_info_list, busNo, devNo);
 	if (!p)
 		return;
 	if (p->pending_msg_hdr.id == CONTROLVM_INVALID)
@@ -876,7 +876,7 @@ device_responder(enum controlvm_id cmdId, ulong busNo, ulong devNo,
 	struct visorchipset_device_info *p = NULL;
 	BOOL need_clear = FALSE;
 
-	p = finddevice(&DevInfoList, busNo, devNo);
+	p = finddevice(&dev_info_list, busNo, devNo);
 	if (!p)
 		return;
 	if (response >= 0) {
@@ -905,7 +905,7 @@ bus_epilog(u32 busNo,
 {
 	BOOL notified = FALSE;
 
-	struct visorchipset_bus_info *pBusInfo = findbus(&BusInfoList, busNo);
+	struct visorchipset_bus_info *pBusInfo = findbus(&bus_info_list, busNo);
 
 	if (!pBusInfo)
 		return;
@@ -973,7 +973,7 @@ device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
 	BOOL notified = FALSE;
 
 	struct visorchipset_device_info *pDevInfo =
-		finddevice(&DevInfoList, busNo, devNo);
+		finddevice(&dev_info_list, busNo, devNo);
 	char *envp[] = {
 		"SPARSP_DIAGPOOL_PAUSED_STATE = 1",
 		NULL
@@ -1069,7 +1069,7 @@ bus_create(struct controlvm_message *inmsg)
 	struct visorchipset_bus_info *pBusInfo = NULL;
 
 
-	pBusInfo = findbus(&BusInfoList, busNo);
+	pBusInfo = findbus(&bus_info_list, busNo);
 	if (pBusInfo && (pBusInfo->state.created == 1)) {
 		POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, busNo,
 				 POSTCODE_SEVERITY_ERR);
@@ -1102,7 +1102,7 @@ bus_create(struct controlvm_message *inmsg)
 			cmd->create_bus.bus_data_type_uuid;
 	pBusInfo->chan_info.channel_inst_uuid = cmd->create_bus.bus_inst_uuid;
 
-	list_add(&pBusInfo->entry, &BusInfoList);
+	list_add(&pBusInfo->entry, &bus_info_list);
 
 	POSTCODE_LINUX_3(BUS_CREATE_EXIT_PC, busNo, POSTCODE_SEVERITY_INFO);
 
@@ -1119,7 +1119,7 @@ bus_destroy(struct controlvm_message *inmsg)
 	struct visorchipset_bus_info *pBusInfo;
 	int rc = CONTROLVM_RESP_SUCCESS;
 
-	pBusInfo = findbus(&BusInfoList, busNo);
+	pBusInfo = findbus(&bus_info_list, busNo);
 	if (!pBusInfo) {
 		rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
 		goto Away;
@@ -1147,7 +1147,7 @@ bus_configure(struct controlvm_message *inmsg,
 	busNo = cmd->configure_bus.bus_no;
 	POSTCODE_LINUX_3(BUS_CONFIGURE_ENTRY_PC, busNo, POSTCODE_SEVERITY_INFO);
 
-	pBusInfo = findbus(&BusInfoList, busNo);
+	pBusInfo = findbus(&bus_info_list, busNo);
 	if (!pBusInfo) {
 		POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, busNo,
 				 POSTCODE_SEVERITY_ERR);
@@ -1190,14 +1190,14 @@ my_device_create(struct controlvm_message *inmsg)
 	struct visorchipset_bus_info *pBusInfo = NULL;
 	int rc = CONTROLVM_RESP_SUCCESS;
 
-	pDevInfo = finddevice(&DevInfoList, busNo, devNo);
+	pDevInfo = finddevice(&dev_info_list, busNo, devNo);
 	if (pDevInfo && (pDevInfo->state.created == 1)) {
 		POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
 				 POSTCODE_SEVERITY_ERR);
 		rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
 		goto Away;
 	}
-	pBusInfo = findbus(&BusInfoList, busNo);
+	pBusInfo = findbus(&bus_info_list, busNo);
 	if (!pBusInfo) {
 		POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
 				 POSTCODE_SEVERITY_ERR);
@@ -1234,7 +1234,7 @@ my_device_create(struct controlvm_message *inmsg)
 	pDevInfo->chan_info.channel_type_uuid =
 			cmd->create_device.data_type_uuid;
 	pDevInfo->chan_info.intr = cmd->create_device.intr;
-	list_add(&pDevInfo->entry, &DevInfoList);
+	list_add(&pDevInfo->entry, &dev_info_list);
 	POSTCODE_LINUX_4(DEVICE_CREATE_EXIT_PC, devNo, busNo,
 			 POSTCODE_SEVERITY_INFO);
 Away:
@@ -1260,7 +1260,7 @@ my_device_changestate(struct controlvm_message *inmsg)
 	struct visorchipset_device_info *pDevInfo = NULL;
 	int rc = CONTROLVM_RESP_SUCCESS;
 
-	pDevInfo = finddevice(&DevInfoList, busNo, devNo);
+	pDevInfo = finddevice(&dev_info_list, busNo, devNo);
 	if (!pDevInfo) {
 		POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, devNo, busNo,
 				 POSTCODE_SEVERITY_ERR);
@@ -1290,7 +1290,7 @@ my_device_destroy(struct controlvm_message *inmsg)
 	struct visorchipset_device_info *pDevInfo = NULL;
 	int rc = CONTROLVM_RESP_SUCCESS;
 
-	pDevInfo = finddevice(&DevInfoList, busNo, devNo);
+	pDevInfo = finddevice(&dev_info_list, busNo, devNo);
 	if (!pDevInfo) {
 		rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
 		goto Away;
@@ -2047,7 +2047,7 @@ device_resume_response(ulong busNo, ulong devNo, int response)
 BOOL
 visorchipset_get_bus_info(ulong bus_no, struct visorchipset_bus_info *bus_info)
 {
-	void *p = findbus(&BusInfoList, bus_no);
+	void *p = findbus(&bus_info_list, bus_no);
 
 	if (!p)
 		return FALSE;
@@ -2059,7 +2059,7 @@ EXPORT_SYMBOL_GPL(visorchipset_get_bus_info);
 BOOL
 visorchipset_set_bus_context(ulong bus_no, void *context)
 {
-	struct visorchipset_bus_info *p = findbus(&BusInfoList, bus_no);
+	struct visorchipset_bus_info *p = findbus(&bus_info_list, bus_no);
 
 	if (!p)
 		return FALSE;
@@ -2072,7 +2072,7 @@ BOOL
 visorchipset_get_device_info(ulong bus_no, ulong dev_no,
 			     struct visorchipset_device_info *dev_info)
 {
-	void *p = finddevice(&DevInfoList, bus_no, dev_no);
+	void *p = finddevice(&dev_info_list, bus_no, dev_no);
 
 	if (!p)
 		return FALSE;
@@ -2085,7 +2085,7 @@ BOOL
 visorchipset_set_device_context(ulong bus_no, ulong dev_no, void *context)
 {
 	struct visorchipset_device_info *p =
-			finddevice(&DevInfoList, bus_no, dev_no);
+			finddevice(&dev_info_list, bus_no, dev_no);
 
 	if (!p)
 		return FALSE;
-- 
2.1.0

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

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

* [PATCH 21/69] staging: unisys: fix placement of logical ops in visorchipset_main.c
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (19 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 20/69] staging: unisys: fix CamelCase list names Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 22/69] staging: unisys: fix CamelCase channel name ControlVm_channel Benjamin Romer
                   ` (47 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Several if statement lines had the logical operators in the wrong place,
so fix these by moving the operator to the end of the previous line.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../staging/unisys/visorchipset/visorchipset_main.c  | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 4f36b4b..401cd1e 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -84,8 +84,8 @@ static struct controlvm_message_packet g_devicechangestate_packet;
  */
 #define FOR_VISORHACKBUS(channel_type_guid) \
 	(((uuid_le_cmp(channel_type_guid,\
-		       spar_vnic_channel_protocol_uuid) == 0)\
-	|| (uuid_le_cmp(channel_type_guid,\
+		       spar_vnic_channel_protocol_uuid) == 0) ||\
+	(uuid_le_cmp(channel_type_guid,\
 			spar_vhba_channel_protocol_uuid) == 0)))
 #define FOR_VISORBUS(channel_type_guid) (!(FOR_VISORHACKBUS(channel_type_guid)))
 
@@ -705,10 +705,10 @@ controlvm_respond(struct controlvm_message_header *msgHdr, int response)
 	controlvm_init_response(&outmsg, msgHdr, response);
 	/* For DiagPool channel DEVICE_CHANGESTATE, we need to send
 	* back the deviceChangeState structure in the packet. */
-	if (msgHdr->id == CONTROLVM_DEVICE_CHANGESTATE
-	    && g_devicechangestate_packet.device_change_state.bus_no ==
-	    g_diagpool_bus_no
-	    && g_devicechangestate_packet.device_change_state.dev_no ==
+	if (msgHdr->id == CONTROLVM_DEVICE_CHANGESTATE &&
+	    g_devicechangestate_packet.device_change_state.bus_no ==
+	    g_diagpool_bus_no &&
+	    g_devicechangestate_packet.device_change_state.dev_no ==
 	    g_diagpool_dev_no)
 		outmsg.cmd = g_devicechangestate_packet;
 	if (outmsg.hdr.flags.test_message == 1)
@@ -1030,8 +1030,8 @@ device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
 				/* this is lite pause where channel is
 				 * still valid just 'pause' of it
 				 */
-				if (busNo == g_diagpool_bus_no
-				    && devNo == g_diagpool_dev_no) {
+				if (busNo == g_diagpool_bus_no &&
+				    devNo == g_diagpool_dev_no) {
 					/* this will trigger the
 					 * diag_shutdown.sh script in
 					 * the visorchipset hotplug */
@@ -1828,8 +1828,8 @@ controlvm_periodic_work(struct work_struct *work)
 	/* Check events to determine if response to CHIPSET_READY
 	 * should be sent
 	 */
-	if (visorchipset_holdchipsetready
-	    && (g_chipset_msg_hdr.id != CONTROLVM_INVALID)) {
+	if (visorchipset_holdchipsetready &&
+	    (g_chipset_msg_hdr.id != CONTROLVM_INVALID)) {
 		if (check_chipset_events() == 1) {
 			controlvm_respond(&g_chipset_msg_hdr, 0);
 			clear_chipset_events();
-- 
2.1.0

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

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

* [PATCH 22/69] staging: unisys: fix CamelCase channel name ControlVm_channel
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (20 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 21/69] staging: unisys: fix placement of logical ops in visorchipset_main.c Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 23/69] staging: unisys: get rid of Test_Vnic_channel Benjamin Romer
                   ` (46 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Rename the channel:

ControlVm_channel => controlvm_channel

Update all references to use the new name. Fix the odd bracketing in the
while() statement with the reference to controlvm_channel, too, so the
patch doesn't generate a warning.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 78 +++++++++++-----------
 1 file changed, 39 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 401cd1e..793ff1b 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -96,7 +96,7 @@ static struct controlvm_message_packet g_devicechangestate_packet;
 static LIST_HEAD(bus_info_list);
 static LIST_HEAD(dev_info_list);
 
-static struct visorchannel *ControlVm_channel;
+static struct visorchannel *controlvm_channel;
 
 struct controlvm_payload_info {
 	u8 __iomem *ptr;	/* pointer to base address of payload pool */
@@ -353,7 +353,7 @@ static ssize_t toolaction_show(struct device *dev,
 {
 	u8 toolAction;
 
-	visorchannel_read(ControlVm_channel,
+	visorchannel_read(controlvm_channel,
 		offsetof(struct spar_controlvm_channel_protocol,
 			   tool_action), &toolAction, sizeof(u8));
 	return scnprintf(buf, PAGE_SIZE, "%u\n", toolAction);
@@ -369,7 +369,7 @@ static ssize_t toolaction_store(struct device *dev,
 	if (kstrtou8(buf, 10, &toolAction) != 0)
 		return -EINVAL;
 
-	ret = visorchannel_write(ControlVm_channel,
+	ret = visorchannel_write(controlvm_channel,
 		offsetof(struct spar_controlvm_channel_protocol, tool_action),
 		&toolAction, sizeof(u8));
 
@@ -384,7 +384,7 @@ static ssize_t boottotool_show(struct device *dev,
 {
 	struct efi_spar_indication efiSparIndication;
 
-	visorchannel_read(ControlVm_channel,
+	visorchannel_read(controlvm_channel,
 		offsetof(struct spar_controlvm_channel_protocol,
 			efi_spar_ind), &efiSparIndication,
 		sizeof(struct efi_spar_indication));
@@ -403,7 +403,7 @@ static ssize_t boottotool_store(struct device *dev,
 		return -EINVAL;
 
 	efiSparIndication.boot_to_tool = val;
-	ret = visorchannel_write(ControlVm_channel,
+	ret = visorchannel_write(controlvm_channel,
 			offsetof(struct spar_controlvm_channel_protocol,
 				efi_spar_ind),
 			&(efiSparIndication),
@@ -419,7 +419,7 @@ static ssize_t error_show(struct device *dev, struct device_attribute *attr,
 {
 	u32 error;
 
-	visorchannel_read(ControlVm_channel, offsetof(
+	visorchannel_read(controlvm_channel, offsetof(
 		struct spar_controlvm_channel_protocol, installation_error),
 		&error, sizeof(u32));
 	return scnprintf(buf, PAGE_SIZE, "%i\n", error);
@@ -434,7 +434,7 @@ static ssize_t error_store(struct device *dev, struct device_attribute *attr,
 	if (kstrtou32(buf, 10, &error) != 0)
 		return -EINVAL;
 
-	ret = visorchannel_write(ControlVm_channel,
+	ret = visorchannel_write(controlvm_channel,
 			offsetof(struct spar_controlvm_channel_protocol,
 				installation_error),
 			&error, sizeof(u32));
@@ -448,7 +448,7 @@ static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
 {
 	u32 textId;
 
-	visorchannel_read(ControlVm_channel, offsetof(
+	visorchannel_read(controlvm_channel, offsetof(
 		struct spar_controlvm_channel_protocol, installation_text_id),
 		&textId, sizeof(u32));
 	return scnprintf(buf, PAGE_SIZE, "%i\n", textId);
@@ -463,7 +463,7 @@ static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
 	if (kstrtou32(buf, 10, &textId) != 0)
 		return -EINVAL;
 
-	ret = visorchannel_write(ControlVm_channel,
+	ret = visorchannel_write(controlvm_channel,
 			offsetof(struct spar_controlvm_channel_protocol,
 				installation_text_id),
 			&textId, sizeof(u32));
@@ -478,7 +478,7 @@ static ssize_t remaining_steps_show(struct device *dev,
 {
 	u16 remainingSteps;
 
-	visorchannel_read(ControlVm_channel,
+	visorchannel_read(controlvm_channel,
 		offsetof(struct spar_controlvm_channel_protocol,
 			installation_remaining_steps),
 		&remainingSteps,
@@ -495,7 +495,7 @@ static ssize_t remaining_steps_store(struct device *dev,
 	if (kstrtou16(buf, 10, &remainingSteps) != 0)
 		return -EINVAL;
 
-	ret = visorchannel_write(ControlVm_channel,
+	ret = visorchannel_write(controlvm_channel,
 			offsetof(struct spar_controlvm_channel_protocol,
 				installation_remaining_steps),
 			&remainingSteps, sizeof(u16));
@@ -714,7 +714,7 @@ controlvm_respond(struct controlvm_message_header *msgHdr, int response)
 	if (outmsg.hdr.flags.test_message == 1)
 		return;
 
-	if (!visorchannel_signalinsert(ControlVm_channel,
+	if (!visorchannel_signalinsert(controlvm_channel,
 				       CONTROLVM_QUEUE_REQUEST, &outmsg)) {
 		return;
 	}
@@ -729,7 +729,7 @@ controlvm_respond_chipset_init(struct controlvm_message_header *msgHdr,
 
 	controlvm_init_response(&outmsg, msgHdr, response);
 	outmsg.cmd.init_chipset.features = features;
-	if (!visorchannel_signalinsert(ControlVm_channel,
+	if (!visorchannel_signalinsert(controlvm_channel,
 				       CONTROLVM_QUEUE_REQUEST, &outmsg)) {
 		return;
 	}
@@ -744,7 +744,7 @@ static void controlvm_respond_physdev_changestate(
 	controlvm_init_response(&outmsg, msgHdr, response);
 	outmsg.cmd.device_change_state.state = state;
 	outmsg.cmd.device_change_state.flags.phys_device = 1;
-	if (!visorchannel_signalinsert(ControlVm_channel,
+	if (!visorchannel_signalinsert(controlvm_channel,
 				       CONTROLVM_QUEUE_REQUEST, &outmsg)) {
 		return;
 	}
@@ -758,7 +758,7 @@ visorchipset_save_message(struct controlvm_message *msg,
 	u16 localSavedCrashMsgCount;
 
 	/* get saved message count */
-	if (visorchannel_read(ControlVm_channel,
+	if (visorchannel_read(controlvm_channel,
 			      offsetof(struct spar_controlvm_channel_protocol,
 				       saved_crash_message_count),
 			      &localSavedCrashMsgCount, sizeof(u16)) < 0) {
@@ -775,7 +775,7 @@ visorchipset_save_message(struct controlvm_message *msg,
 	}
 
 	/* get saved crash message offset */
-	if (visorchannel_read(ControlVm_channel,
+	if (visorchannel_read(controlvm_channel,
 			      offsetof(struct spar_controlvm_channel_protocol,
 				       saved_crash_message_offset),
 			      &localSavedCrashMsgOffset, sizeof(u32)) < 0) {
@@ -785,7 +785,7 @@ visorchipset_save_message(struct controlvm_message *msg,
 	}
 
 	if (type == CRASH_BUS) {
-		if (visorchannel_write(ControlVm_channel,
+		if (visorchannel_write(controlvm_channel,
 				       localSavedCrashMsgOffset,
 				       msg,
 				       sizeof(struct controlvm_message)) < 0) {
@@ -794,7 +794,7 @@ visorchipset_save_message(struct controlvm_message *msg,
 			return;
 		}
 	} else {
-		if (visorchannel_write(ControlVm_channel,
+		if (visorchannel_write(controlvm_channel,
 				       localSavedCrashMsgOffset +
 				       sizeof(struct controlvm_message), msg,
 				       sizeof(struct controlvm_message)) < 0) {
@@ -862,7 +862,7 @@ device_changestate_responder(enum controlvm_id cmdId,
 	outmsg.cmd.device_change_state.dev_no = devNo;
 	outmsg.cmd.device_change_state.state = responseState;
 
-	if (!visorchannel_signalinsert(ControlVm_channel,
+	if (!visorchannel_signalinsert(controlvm_channel,
 				       CONTROLVM_QUEUE_REQUEST, &outmsg))
 		return;
 
@@ -1363,11 +1363,11 @@ destroy_controlvm_payload_info(struct controlvm_payload_info *info)
 static void
 initialize_controlvm_payload(void)
 {
-	HOSTADDRESS phys_addr = visorchannel_get_physaddr(ControlVm_channel);
+	HOSTADDRESS phys_addr = visorchannel_get_physaddr(controlvm_channel);
 	u64 payloadOffset = 0;
 	u32 payloadBytes = 0;
 
-	if (visorchannel_read(ControlVm_channel,
+	if (visorchannel_read(controlvm_channel,
 			      offsetof(struct spar_controlvm_channel_protocol,
 				       request_payload_offset),
 			      &payloadOffset, sizeof(payloadOffset)) < 0) {
@@ -1375,7 +1375,7 @@ initialize_controlvm_payload(void)
 				 POSTCODE_SEVERITY_ERR);
 		return;
 	}
-	if (visorchannel_read(ControlVm_channel,
+	if (visorchannel_read(controlvm_channel,
 			      offsetof(struct spar_controlvm_channel_protocol,
 				       request_payload_bytes),
 			      &payloadBytes, sizeof(payloadBytes)) < 0) {
@@ -1468,7 +1468,7 @@ chipset_notready(struct controlvm_message_header *msgHdr)
 static BOOL
 read_controlvm_event(struct controlvm_message *msg)
 {
-	if (visorchannel_signalremove(ControlVm_channel,
+	if (visorchannel_signalremove(controlvm_channel,
 				      CONTROLVM_QUEUE_EVENT, msg)) {
 		/* got a message */
 		if (msg->hdr.flags.test_message == 1)
@@ -1727,8 +1727,8 @@ handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
 	if (!isLocalAddr) {
 		controlvm_init_response(&ackmsg, &inmsg.hdr,
 					CONTROLVM_RESP_SUCCESS);
-		if (ControlVm_channel)
-			visorchannel_signalinsert(ControlVm_channel,
+		if (controlvm_channel)
+			visorchannel_signalinsert(controlvm_channel,
 						  CONTROLVM_QUEUE_ACK,
 						  &ackmsg);
 	}
@@ -1838,10 +1838,10 @@ controlvm_periodic_work(struct work_struct *work)
 		}
 	}
 
-	while (visorchannel_signalremove(ControlVm_channel,
+	while (visorchannel_signalremove(controlvm_channel,
 					 CONTROLVM_QUEUE_RESPONSE,
-					 &inmsg)) {
-	}
+					 &inmsg))
+		;
 	if (!gotACommand) {
 		if (ControlVm_Pending_Msg_Valid) {
 			/* we throttled processing of a prior
@@ -1860,7 +1860,7 @@ controlvm_periodic_work(struct work_struct *work)
 		most_recent_message_jiffies = jiffies;
 		if (handle_command(inmsg,
 				   visorchannel_get_physaddr
-				   (ControlVm_channel)))
+				   (controlvm_channel)))
 			gotACommand = read_controlvm_event(&inmsg);
 		else {
 			/* this is a scenario where throttling
@@ -1927,7 +1927,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
 	chipset_init(&msg);
 
 	/* get saved message count */
-	if (visorchannel_read(ControlVm_channel,
+	if (visorchannel_read(controlvm_channel,
 			      offsetof(struct spar_controlvm_channel_protocol,
 				       saved_crash_message_count),
 			      &localSavedCrashMsgCount, sizeof(u16)) < 0) {
@@ -1944,7 +1944,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
 	}
 
 	/* get saved crash message offset */
-	if (visorchannel_read(ControlVm_channel,
+	if (visorchannel_read(controlvm_channel,
 			      offsetof(struct spar_controlvm_channel_protocol,
 				       saved_crash_message_offset),
 			      &localSavedCrashMsgOffset, sizeof(u32)) < 0) {
@@ -1954,7 +1954,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
 	}
 
 	/* read create device message for storage bus offset */
-	if (visorchannel_read(ControlVm_channel,
+	if (visorchannel_read(controlvm_channel,
 			      localSavedCrashMsgOffset,
 			      &localCrashCreateBusMsg,
 			      sizeof(struct controlvm_message)) < 0) {
@@ -1964,7 +1964,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
 	}
 
 	/* read create device message for storage device */
-	if (visorchannel_read(ControlVm_channel,
+	if (visorchannel_read(controlvm_channel,
 			      localSavedCrashMsgOffset +
 			      sizeof(struct controlvm_message),
 			      &localCrashCreateDevMsg,
@@ -2208,17 +2208,17 @@ visorchipset_init(void)
 
 	addr = controlvm_get_channel_address();
 	if (addr != 0) {
-		ControlVm_channel =
+		controlvm_channel =
 		    visorchannel_create_with_lock
 		    (addr,
 		     sizeof(struct spar_controlvm_channel_protocol),
 		     spar_controlvm_channel_protocol_uuid);
 		if (SPAR_CONTROLVM_CHANNEL_OK_CLIENT(
-				visorchannel_get_header(ControlVm_channel))) {
+				visorchannel_get_header(controlvm_channel))) {
 			initialize_controlvm_payload();
 		} else {
-			visorchannel_destroy(ControlVm_channel);
-			ControlVm_channel = NULL;
+			visorchannel_destroy(controlvm_channel);
+			controlvm_channel = NULL;
 			return -ENODEV;
 		}
 	} else {
@@ -2226,7 +2226,7 @@ visorchipset_init(void)
 	}
 
 	MajorDev = MKDEV(visorchipset_major, 0);
-	rc = visorchipset_file_init(MajorDev, &ControlVm_channel);
+	rc = visorchipset_file_init(MajorDev, &controlvm_channel);
 	if (rc < 0) {
 		POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
 		goto Away;
@@ -2320,7 +2320,7 @@ visorchipset_exit(void)
 
 	memset(&g_del_dump_msg_hdr, 0, sizeof(struct controlvm_message_header));
 
-	visorchannel_destroy(ControlVm_channel);
+	visorchannel_destroy(controlvm_channel);
 
 	visorchipset_file_cleanup();
 	POSTCODE_LINUX_2(DRIVER_EXIT_PC, POSTCODE_SEVERITY_INFO);
-- 
2.1.0

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

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

* [PATCH 23/69] staging: unisys: get rid of Test_Vnic_channel
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (21 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 22/69] staging: unisys: fix CamelCase channel name ControlVm_channel Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 24/69] staging: unisys: fix CamelCase global ControlVm_payload_info Benjamin Romer
                   ` (45 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Nobody is using this, so remove it.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 793ff1b..9ce2dcd 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -108,8 +108,6 @@ struct controlvm_payload_info {
 /* Manages the request payload in the controlvm channel */
 static struct controlvm_payload_info ControlVm_payload_info;
 
-static struct channel_header *Test_Vnic_channel;
-
 struct livedump_info {
 	struct controlvm_message_header Dumpcapture_header;
 	struct controlvm_message_header Gettextdump_header;
@@ -2306,7 +2304,6 @@ visorchipset_exit(void)
 		periodic_controlvm_workqueue = NULL;
 		destroy_controlvm_payload_info(&ControlVm_payload_info);
 	}
-	Test_Vnic_channel = NULL;
 	if (Putfile_buffer_list_pool) {
 		kmem_cache_destroy(Putfile_buffer_list_pool);
 		Putfile_buffer_list_pool = NULL;
-- 
2.1.0

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

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

* [PATCH 24/69] staging: unisys: fix CamelCase global ControlVm_payload_info
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (22 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 23/69] staging: unisys: get rid of Test_Vnic_channel Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 25/69] staging: unisys: refactor livedump_info structure Benjamin Romer
                   ` (44 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Rename the CamelCase global structure

ControlVm_payload_info => controlvm_payload_info

Move the declaration to the struct definition, and update all references
to use the new name.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 9ce2dcd..875281d 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -98,15 +98,13 @@ static LIST_HEAD(dev_info_list);
 
 static struct visorchannel *controlvm_channel;
 
-struct controlvm_payload_info {
+/* Manages the request payload in the controlvm channel */
+static struct controlvm_payload_info {
 	u8 __iomem *ptr;	/* pointer to base address of payload pool */
 	u64 offset;		/* offset from beginning of controlvm
 				 * channel to beginning of payload * pool */
 	u32 bytes;		/* number of bytes in payload pool */
-};
-
-/* Manages the request payload in the controlvm channel */
-static struct controlvm_payload_info ControlVm_payload_info;
+} controlvm_payload_info;
 
 struct livedump_info {
 	struct controlvm_message_header Dumpcapture_header;
@@ -1383,7 +1381,7 @@ initialize_controlvm_payload(void)
 	}
 	initialize_controlvm_payload_info(phys_addr,
 					  payloadOffset, payloadBytes,
-					  &ControlVm_payload_info);
+					  &controlvm_payload_info);
 }
 
 /*  Send ACTION=online for DEVPATH=/sys/devices/platform/visorchipset.
@@ -2194,7 +2192,7 @@ visorchipset_init(void)
 
 	memset(&BusDev_Server_Notifiers, 0, sizeof(BusDev_Server_Notifiers));
 	memset(&BusDev_Client_Notifiers, 0, sizeof(BusDev_Client_Notifiers));
-	memset(&ControlVm_payload_info, 0, sizeof(ControlVm_payload_info));
+	memset(&controlvm_payload_info, 0, sizeof(controlvm_payload_info));
 	memset(&LiveDump_info, 0, sizeof(LiveDump_info));
 	atomic_set(&LiveDump_info.buffers_in_use, 0);
 
@@ -2302,7 +2300,7 @@ visorchipset_exit(void)
 		flush_workqueue(periodic_controlvm_workqueue);
 		destroy_workqueue(periodic_controlvm_workqueue);
 		periodic_controlvm_workqueue = NULL;
-		destroy_controlvm_payload_info(&ControlVm_payload_info);
+		destroy_controlvm_payload_info(&controlvm_payload_info);
 	}
 	if (Putfile_buffer_list_pool) {
 		kmem_cache_destroy(Putfile_buffer_list_pool);
-- 
2.1.0

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

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

* [PATCH 25/69] staging: unisys: refactor livedump_info structure
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (23 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 24/69] staging: unisys: fix CamelCase global ControlVm_payload_info Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 26/69] staging: unisys: remove extra blank lines in visorchipset_main.c Benjamin Romer
                   ` (43 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase member names and that global variable:

Dumpcapture_header => dumpcapture_header
Gettextdump_header => gettextdump_header
Dumpcomplete_header => dumpcomplete_header
Gettextdump_outstanding => gettextdump_outstanding
LiveDump_info => livedump_info

Update all references and merge the definition and global structure
declaration.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 23 +++++++++++-----------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 875281d..6c6804f8 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -106,20 +106,19 @@ static struct controlvm_payload_info {
 	u32 bytes;		/* number of bytes in payload pool */
 } controlvm_payload_info;
 
-struct livedump_info {
-	struct controlvm_message_header Dumpcapture_header;
-	struct controlvm_message_header Gettextdump_header;
-	struct controlvm_message_header Dumpcomplete_header;
-	BOOL Gettextdump_outstanding;
+/* Manages the info for a CONTROLVM_DUMP_CAPTURESTATE /
+ * CONTROLVM_DUMP_GETTEXTDUMP / CONTROLVM_DUMP_COMPLETE conversation.
+ */
+static struct livedump_info {
+	struct controlvm_message_header dumpcapture_header;
+	struct controlvm_message_header gettextdump_header;
+	struct controlvm_message_header dumpcomplete_header;
+	BOOL gettextdump_outstanding;
 	u32 crc32;
 	ulong length;
 	atomic_t buffers_in_use;
 	ulong destination;
-};
-/* Manages the info for a CONTROLVM_DUMP_CAPTURESTATE /
- * CONTROLVM_DUMP_GETTEXTDUMP / CONTROLVM_DUMP_COMPLETE conversation.
- */
-static struct livedump_info LiveDump_info;
+} livedump_info;
 
 /* The following globals are used to handle the scenario where we are unable to
  * offload the payload from a controlvm message due to memory requirements.  In
@@ -2193,8 +2192,8 @@ visorchipset_init(void)
 	memset(&BusDev_Server_Notifiers, 0, sizeof(BusDev_Server_Notifiers));
 	memset(&BusDev_Client_Notifiers, 0, sizeof(BusDev_Client_Notifiers));
 	memset(&controlvm_payload_info, 0, sizeof(controlvm_payload_info));
-	memset(&LiveDump_info, 0, sizeof(LiveDump_info));
-	atomic_set(&LiveDump_info.buffers_in_use, 0);
+	memset(&livedump_info, 0, sizeof(livedump_info));
+	atomic_set(&livedump_info.buffers_in_use, 0);
 
 	if (visorchipset_testvnic) {
 		POSTCODE_LINUX_3(CHIPSET_INIT_FAILURE_PC, x, DIAG_SEVERITY_ERR);
-- 
2.1.0

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

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

* [PATCH 26/69] staging: unisys: remove extra blank lines in visorchipset_main.c
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (24 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 25/69] staging: unisys: refactor livedump_info structure Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 27/69] staging: unisys: remove old code block " Benjamin Romer
                   ` (42 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix up the line spacing around braces in visorchipset_main.c.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 6c6804f8..e459672 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -467,7 +467,6 @@ static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
 	return count;
 }
 
-
 static ssize_t remaining_steps_show(struct device *dev,
 	struct device_attribute *attr, char *buf)
 {
@@ -1895,7 +1894,6 @@ Away:
 static void
 setup_crash_devices_work_queue(struct work_struct *work)
 {
-
 	struct controlvm_message localCrashCreateBusMsg;
 	struct controlvm_message localCrashCreateDevMsg;
 	struct controlvm_message msg;
@@ -2024,7 +2022,6 @@ device_destroy_response(ulong busNo, ulong devNo, int response)
 void
 visorchipset_device_pause_response(ulong bus_no, ulong dev_no, int response)
 {
-
 	device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
 				     bus_no, dev_no, response,
 				     segment_state_standby);
@@ -2268,7 +2265,6 @@ visorchipset_init(void)
 					 DIAG_SEVERITY_ERR);
 			goto Away;
 		}
-
 	}
 
 	Visorchipset_platform_device.dev.devt = MajorDev;
-- 
2.1.0

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

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

* [PATCH 27/69] staging: unisys: remove old code block in visorchipset_main.c
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (25 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 26/69] staging: unisys: remove extra blank lines in visorchipset_main.c Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 28/69] staging: unisys: fix CamelCase-named clearing functions Benjamin Romer
                   ` (41 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

The block of code is old and #if 0'd out, so just remove it.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 29 ----------------------
 1 file changed, 29 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index e459672..dea2c83 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -498,35 +498,6 @@ static ssize_t remaining_steps_store(struct device *dev,
 	return count;
 }
 
-#if 0
-static void
-testUnicode(void)
-{
-	wchar_t unicodeString[] = { 'a', 'b', 'c', 0 };
-	char s[sizeof(unicodeString) * NLS_MAX_CHARSET_SIZE];
-	wchar_t unicode2[99];
-
-	/* NOTE: Either due to a bug, or feature I don't understand, the
-	 *       kernel utf8_mbstowcs() and utf_wcstombs() do NOT copy the
-	 *       trailed NUL byte!!   REALLY!!!!!    Arrrrgggghhhhh
-	 */
-
-	LOGINF("sizeof(wchar_t) = %d", sizeof(wchar_t));
-	LOGINF("utf8_wcstombs=%d",
-	       chrs = utf8_wcstombs(s, unicodeString, sizeof(s)));
-	if (chrs >= 0)
-		s[chrs] = '\0';	/* GRRRRRRRR */
-	LOGINF("s='%s'", s);
-	LOGINF("utf8_mbstowcs=%d", chrs = utf8_mbstowcs(unicode2, s, 100));
-	if (chrs >= 0)
-		unicode2[chrs] = 0;	/* GRRRRRRRR */
-	if (memcmp(unicodeString, unicode2, sizeof(unicodeString)) == 0)
-		LOGINF("strings match... good");
-	else
-		LOGINF("strings did not match!!");
-}
-#endif
-
 static void
 busInfo_clear(void *v)
 {
-- 
2.1.0

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

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

* [PATCH 28/69] staging: unisys: fix CamelCase-named clearing functions
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (26 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 27/69] staging: unisys: remove old code block " Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 29/69] staging: unisys: remove obsolete proc entry code Benjamin Romer
                   ` (40 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase-named structure clearing functions in
visorchipset_main.c:

busInfo_clear => bus_info_clear
devInfo_clear => dev_info_clear

Update references to use the fixed names.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index dea2c83..98238bc 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -499,7 +499,7 @@ static ssize_t remaining_steps_store(struct device *dev,
 }
 
 static void
-busInfo_clear(void *v)
+bus_info_clear(void *v)
 {
 	struct visorchipset_bus_info *p = (struct visorchipset_bus_info *) (v);
 
@@ -518,7 +518,7 @@ busInfo_clear(void *v)
 }
 
 static void
-devInfo_clear(void *v)
+dev_info_clear(void *v)
 {
 	struct visorchipset_device_info *p =
 			(struct visorchipset_device_info *)(v);
@@ -603,13 +603,13 @@ cleanup_controlvm_structures(void)
 	struct visorchipset_device_info *di, *tmp_di;
 
 	list_for_each_entry_safe(bi, tmp_bi, &bus_info_list, entry) {
-		busInfo_clear(bi);
+		bus_info_clear(bi);
 		list_del(&bi->entry);
 		kfree(bi);
 	}
 
 	list_for_each_entry_safe(di, tmp_di, &dev_info_list, entry) {
-		devInfo_clear(di);
+		dev_info_clear(di);
 		list_del(&di->entry);
 		kfree(di);
 	}
@@ -800,7 +800,7 @@ bus_responder(enum controlvm_id cmdId, ulong busNo, int response)
 	controlvm_respond(&p->pending_msg_hdr, response);
 	p->pending_msg_hdr.id = CONTROLVM_INVALID;
 	if (need_clear) {
-		busInfo_clear(p);
+		bus_info_clear(p);
 		delbusdevices(&dev_info_list, busNo);
 	}
 }
@@ -860,7 +860,7 @@ device_responder(enum controlvm_id cmdId, ulong busNo, ulong devNo,
 	controlvm_respond(&p->pending_msg_hdr, response);
 	p->pending_msg_hdr.id = CONTROLVM_INVALID;
 	if (need_clear)
-		devInfo_clear(p);
+		dev_info_clear(p);
 }
 
 static void
-- 
2.1.0

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

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

* [PATCH 29/69] staging: unisys: remove obsolete proc entry code
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (27 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 28/69] staging: unisys: fix CamelCase-named clearing functions Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 30/69] staging: unisys: fix all NULL comparisons in visorchipset_main.c Benjamin Romer
                   ` (39 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

There is an unused variable in the visorchipset_bus_info structure that
used to be for a proc entry, so remove it, and the code that referenced
it. We don't need it anymore.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset.h      | 1 -
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 4 ----
 2 files changed, 5 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h b/drivers/staging/unisys/visorchipset/visorchipset.h
index 98f3ba4..bd46df9 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -133,7 +133,6 @@ struct visorchipset_bus_info {
 	u8 *description;	/* UTF8 */
 	u64 reserved1;
 	u32 reserved2;
-	MYPROCOBJECT *proc_object;
 	struct {
 		u32 server:1;
 		/* Add new fields above. */
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 98238bc..a60597e 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -503,10 +503,6 @@ bus_info_clear(void *v)
 {
 	struct visorchipset_bus_info *p = (struct visorchipset_bus_info *) (v);
 
-	if (p->proc_object) {
-		visor_proc_DestroyObject(p->proc_object);
-		p->proc_object = NULL;
-	}
 	kfree(p->name);
 	p->name = NULL;
 
-- 
2.1.0

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

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

* [PATCH 30/69] staging: unisys: fix all NULL comparisons in visorchipset_main.c
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (28 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 29/69] staging: unisys: remove obsolete proc entry code Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 31/69] staging: unisys: fix Camelcase Away goto label Benjamin Romer
                   ` (38 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix all of the NULL comparison checks generated by checkpatch.pl.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../staging/unisys/visorchipset/visorchipset_main.c  | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index a60597e..5d1f1fa 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -550,7 +550,7 @@ visorchipset_register_busdev_server(
 			struct ultra_vbus_deviceinfo *driver_info)
 {
 	down(&notifier_lock);
-	if (notifiers == NULL) {
+	if (!notifiers) {
 		memset(&BusDev_Server_Notifiers, 0,
 		       sizeof(BusDev_Server_Notifiers));
 		serverregistered = 0;	/* clear flag */
@@ -575,7 +575,7 @@ visorchipset_register_busdev_client(
 			struct ultra_vbus_deviceinfo *driver_info)
 {
 	down(&notifier_lock);
-	if (notifiers == NULL) {
+	if (!notifiers) {
 		memset(&BusDev_Client_Notifiers, 0,
 		       sizeof(BusDev_Client_Notifiers));
 		clientregistered = 0;	/* clear flag */
@@ -1038,7 +1038,7 @@ bus_create(struct controlvm_message *inmsg)
 		goto Away;
 	}
 	pBusInfo = kzalloc(sizeof(struct visorchipset_bus_info), GFP_KERNEL);
-	if (pBusInfo == NULL) {
+	if (!pBusInfo) {
 		POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, busNo,
 				 POSTCODE_SEVERITY_ERR);
 		rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
@@ -1172,7 +1172,7 @@ my_device_create(struct controlvm_message *inmsg)
 		goto Away;
 	}
 	pDevInfo = kzalloc(sizeof(struct visorchipset_device_info), GFP_KERNEL);
-	if (pDevInfo == NULL) {
+	if (!pDevInfo) {
 		POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
 				 POSTCODE_SEVERITY_ERR);
 		rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
@@ -1282,7 +1282,7 @@ initialize_controlvm_payload_info(HOSTADDRESS phys_addr, u64 offset, u32 bytes,
 	u8 __iomem *payload = NULL;
 	int rc = CONTROLVM_RESP_SUCCESS;
 
-	if (info == NULL) {
+	if (!info) {
 		rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
 		goto Away;
 	}
@@ -1292,7 +1292,7 @@ initialize_controlvm_payload_info(HOSTADDRESS phys_addr, u64 offset, u32 bytes,
 		goto Away;
 	}
 	payload = ioremap_cache(phys_addr + offset, bytes);
-	if (payload == NULL) {
+	if (!payload) {
 		rc = -CONTROLVM_RESP_ERROR_IOREMAP_FAILED;
 		goto Away;
 	}
@@ -1486,7 +1486,7 @@ parahotplug_request_create(struct controlvm_message *msg)
 	struct parahotplug_request *req;
 
 	req = kmalloc(sizeof(*req), GFP_KERNEL|__GFP_NORETRY);
-	if (req == NULL)
+	if (!req)
 		return NULL;
 
 	req->id = parahotplug_next_id();
@@ -1611,7 +1611,7 @@ parahotplug_process_message(struct controlvm_message *inmsg)
 
 	req = parahotplug_request_create(inmsg);
 
-	if (req == NULL)
+	if (!req)
 		return;
 
 	if (inmsg->cmd.device_change_state.state.active) {
@@ -1745,7 +1745,7 @@ handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
 		break;
 	}
 
-	if (parser_ctx != NULL) {
+	if (parser_ctx) {
 		parser_done(parser_ctx);
 		parser_ctx = NULL;
 	}
@@ -2217,7 +2217,7 @@ visorchipset_init(void)
 		periodic_controlvm_workqueue =
 		    create_singlethread_workqueue("visorchipset_controlvm");
 
-		if (periodic_controlvm_workqueue == NULL) {
+		if (!periodic_controlvm_workqueue) {
 			POSTCODE_LINUX_2(CREATE_WORKQUEUE_FAILED_PC,
 					 DIAG_SEVERITY_ERR);
 			rc = -ENOMEM;
-- 
2.1.0

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

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

* [PATCH 31/69] staging: unisys: fix Camelcase Away goto label
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (29 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 30/69] staging: unisys: fix all NULL comparisons in visorchipset_main.c Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 32/69] staging: unisys: fix CamelCase locals in visorchipset_save_message Benjamin Romer
                   ` (37 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Rename the label in both places:

Away => cleanup

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 5d1f1fa..8c58a14 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -621,7 +621,7 @@ chipset_init(struct controlvm_message *inmsg)
 	POSTCODE_LINUX_2(CHIPSET_INIT_ENTRY_PC, POSTCODE_SEVERITY_INFO);
 	if (chipset_inited) {
 		rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
-		goto Away;
+		goto cleanup;
 	}
 	chipset_inited = 1;
 	POSTCODE_LINUX_2(CHIPSET_INIT_EXIT_PC, POSTCODE_SEVERITY_INFO);
@@ -636,7 +636,7 @@ chipset_init(struct controlvm_message *inmsg)
 	 * features-aware driver. */
 	features |= ULTRA_CHIPSET_FEATURE_REPLY;
 
-Away:
+cleanup:
 	if (rc < 0)
 		cleanup_controlvm_structures();
 	if (inmsg->hdr.flags.response_expected)
-- 
2.1.0

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

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

* [PATCH 32/69] staging: unisys: fix CamelCase locals in visorchipset_save_message
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (30 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 31/69] staging: unisys: fix Camelcase Away goto label Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 33/69] staging: unisys: fix CamelCase params in responder functions Benjamin Romer
                   ` (36 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Rename CamelCased local variable names:

localSavedCrashMsgOffset => crash_msg_offset
localSavedCrashMsgCount => crash_msg_count

Update references to use the new names.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 8c58a14..6662442 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -715,22 +715,22 @@ void
 visorchipset_save_message(struct controlvm_message *msg,
 			  enum crash_obj_type type)
 {
-	u32 localSavedCrashMsgOffset;
-	u16 localSavedCrashMsgCount;
+	u32 crash_msg_offset;
+	u16 crash_msg_count;
 
 	/* get saved message count */
 	if (visorchannel_read(controlvm_channel,
 			      offsetof(struct spar_controlvm_channel_protocol,
 				       saved_crash_message_count),
-			      &localSavedCrashMsgCount, sizeof(u16)) < 0) {
+			      &crash_msg_count, sizeof(u16)) < 0) {
 		POSTCODE_LINUX_2(CRASH_DEV_CTRL_RD_FAILURE_PC,
 				 POSTCODE_SEVERITY_ERR);
 		return;
 	}
 
-	if (localSavedCrashMsgCount != CONTROLVM_CRASHMSG_MAX) {
+	if (crash_msg_count != CONTROLVM_CRASHMSG_MAX) {
 		POSTCODE_LINUX_3(CRASH_DEV_COUNT_FAILURE_PC,
-				 localSavedCrashMsgCount,
+				 crash_msg_count,
 				 POSTCODE_SEVERITY_ERR);
 		return;
 	}
@@ -739,7 +739,7 @@ visorchipset_save_message(struct controlvm_message *msg,
 	if (visorchannel_read(controlvm_channel,
 			      offsetof(struct spar_controlvm_channel_protocol,
 				       saved_crash_message_offset),
-			      &localSavedCrashMsgOffset, sizeof(u32)) < 0) {
+			      &crash_msg_offset, sizeof(u32)) < 0) {
 		POSTCODE_LINUX_2(CRASH_DEV_CTRL_RD_FAILURE_PC,
 				 POSTCODE_SEVERITY_ERR);
 		return;
@@ -747,7 +747,7 @@ visorchipset_save_message(struct controlvm_message *msg,
 
 	if (type == CRASH_BUS) {
 		if (visorchannel_write(controlvm_channel,
-				       localSavedCrashMsgOffset,
+				       crash_msg_offset,
 				       msg,
 				       sizeof(struct controlvm_message)) < 0) {
 			POSTCODE_LINUX_2(SAVE_MSG_BUS_FAILURE_PC,
@@ -756,7 +756,7 @@ visorchipset_save_message(struct controlvm_message *msg,
 		}
 	} else {
 		if (visorchannel_write(controlvm_channel,
-				       localSavedCrashMsgOffset +
+				       crash_msg_offset +
 				       sizeof(struct controlvm_message), msg,
 				       sizeof(struct controlvm_message)) < 0) {
 			POSTCODE_LINUX_2(SAVE_MSG_DEV_FAILURE_PC,
-- 
2.1.0

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

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

* [PATCH 33/69] staging: unisys: fix CamelCase params in responder functions
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (31 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 32/69] staging: unisys: fix CamelCase locals in visorchipset_save_message Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 34/69] staging: unisys: fix CamelCase in epilog functions Benjamin Romer
                   ` (35 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase parameter names in the set of responder functions:

cmdId => cmd_id
busNo => bus_no
devNo => dev_no
responseState => response_state

Update all references to use the fixed names.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 42 +++++++++++-----------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 6662442..700b35e 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -768,60 +768,60 @@ visorchipset_save_message(struct controlvm_message *msg,
 EXPORT_SYMBOL_GPL(visorchipset_save_message);
 
 static void
-bus_responder(enum controlvm_id cmdId, ulong busNo, int response)
+bus_responder(enum controlvm_id cmd_id, ulong bus_no, int response)
 {
 	struct visorchipset_bus_info *p = NULL;
 	BOOL need_clear = FALSE;
 
-	p = findbus(&bus_info_list, busNo);
+	p = findbus(&bus_info_list, bus_no);
 	if (!p)
 		return;
 
 	if (response < 0) {
-		if ((cmdId == CONTROLVM_BUS_CREATE) &&
+		if ((cmd_id == CONTROLVM_BUS_CREATE) &&
 		    (response != (-CONTROLVM_RESP_ERROR_ALREADY_DONE)))
 			/* undo the row we just created... */
-			delbusdevices(&dev_info_list, busNo);
+			delbusdevices(&dev_info_list, bus_no);
 	} else {
-		if (cmdId == CONTROLVM_BUS_CREATE)
+		if (cmd_id == CONTROLVM_BUS_CREATE)
 			p->state.created = 1;
-		if (cmdId == CONTROLVM_BUS_DESTROY)
+		if (cmd_id == CONTROLVM_BUS_DESTROY)
 			need_clear = TRUE;
 	}
 
 	if (p->pending_msg_hdr.id == CONTROLVM_INVALID)
 		return;		/* no controlvm response needed */
-	if (p->pending_msg_hdr.id != (u32) cmdId)
+	if (p->pending_msg_hdr.id != (u32) cmd_id)
 		return;
 	controlvm_respond(&p->pending_msg_hdr, response);
 	p->pending_msg_hdr.id = CONTROLVM_INVALID;
 	if (need_clear) {
 		bus_info_clear(p);
-		delbusdevices(&dev_info_list, busNo);
+		delbusdevices(&dev_info_list, bus_no);
 	}
 }
 
 static void
-device_changestate_responder(enum controlvm_id cmdId,
-			     ulong busNo, ulong devNo, int response,
-			     struct spar_segment_state responseState)
+device_changestate_responder(enum controlvm_id cmd_id,
+			     ulong bus_no, ulong dev_no, int response,
+			     struct spar_segment_state response_state)
 {
 	struct visorchipset_device_info *p = NULL;
 	struct controlvm_message outmsg;
 
-	p = finddevice(&dev_info_list, busNo, devNo);
+	p = finddevice(&dev_info_list, bus_no, dev_no);
 	if (!p)
 		return;
 	if (p->pending_msg_hdr.id == CONTROLVM_INVALID)
 		return;		/* no controlvm response needed */
-	if (p->pending_msg_hdr.id != cmdId)
+	if (p->pending_msg_hdr.id != cmd_id)
 		return;
 
 	controlvm_init_response(&outmsg, &p->pending_msg_hdr, response);
 
-	outmsg.cmd.device_change_state.bus_no = busNo;
-	outmsg.cmd.device_change_state.dev_no = devNo;
-	outmsg.cmd.device_change_state.state = responseState;
+	outmsg.cmd.device_change_state.bus_no = bus_no;
+	outmsg.cmd.device_change_state.dev_no = dev_no;
+	outmsg.cmd.device_change_state.state = response_state;
 
 	if (!visorchannel_signalinsert(controlvm_channel,
 				       CONTROLVM_QUEUE_REQUEST, &outmsg))
@@ -831,26 +831,26 @@ device_changestate_responder(enum controlvm_id cmdId,
 }
 
 static void
-device_responder(enum controlvm_id cmdId, ulong busNo, ulong devNo,
+device_responder(enum controlvm_id cmd_id, ulong bus_no, ulong dev_no,
 		 int response)
 {
 	struct visorchipset_device_info *p = NULL;
 	BOOL need_clear = FALSE;
 
-	p = finddevice(&dev_info_list, busNo, devNo);
+	p = finddevice(&dev_info_list, bus_no, dev_no);
 	if (!p)
 		return;
 	if (response >= 0) {
-		if (cmdId == CONTROLVM_DEVICE_CREATE)
+		if (cmd_id == CONTROLVM_DEVICE_CREATE)
 			p->state.created = 1;
-		if (cmdId == CONTROLVM_DEVICE_DESTROY)
+		if (cmd_id == CONTROLVM_DEVICE_DESTROY)
 			need_clear = TRUE;
 	}
 
 	if (p->pending_msg_hdr.id == CONTROLVM_INVALID)
 		return;		/* no controlvm response needed */
 
-	if (p->pending_msg_hdr.id != (u32) cmdId)
+	if (p->pending_msg_hdr.id != (u32) cmd_id)
 		return;
 
 	controlvm_respond(&p->pending_msg_hdr, response);
-- 
2.1.0

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

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

* [PATCH 34/69] staging: unisys: fix CamelCase in epilog functions
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (32 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 33/69] staging: unisys: fix CamelCase params in responder functions Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 35/69] staging: unisys: fix spaces after typecasts in visorchipset_main.c Benjamin Romer
                   ` (34 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Rename the CamelCase parameters:

busNo => bus_no
devNo => dev_no
needResponse => need_response

And the local variables

pBusInfo => bus_info
pDevInfo => dev_info

Update all references to use the corrected names.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 67 +++++++++++-----------
 1 file changed, 34 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 700b35e..4e74799 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -860,22 +860,23 @@ device_responder(enum controlvm_id cmd_id, ulong bus_no, ulong dev_no,
 }
 
 static void
-bus_epilog(u32 busNo,
-	   u32 cmd, struct controlvm_message_header *msgHdr,
-	   int response, BOOL needResponse)
+bus_epilog(u32 bus_no,
+	   u32 cmd, struct controlvm_message_header *msg_hdr,
+	   int response, BOOL need_response)
 {
 	BOOL notified = FALSE;
 
-	struct visorchipset_bus_info *pBusInfo = findbus(&bus_info_list, busNo);
+	struct visorchipset_bus_info *bus_info = findbus(&bus_info_list,
+							 bus_no);
 
-	if (!pBusInfo)
+	if (!bus_info)
 		return;
 
-	if (needResponse) {
-		memcpy(&pBusInfo->pending_msg_hdr, msgHdr,
+	if (need_response) {
+		memcpy(&bus_info->pending_msg_hdr, msg_hdr,
 		       sizeof(struct controlvm_message_header));
 	} else
-		pBusInfo->pending_msg_hdr.id = CONTROLVM_INVALID;
+		bus_info->pending_msg_hdr.id = CONTROLVM_INVALID;
 
 	down(&notifier_lock);
 	if (response == CONTROLVM_RESP_SUCCESS) {
@@ -892,23 +893,23 @@ bus_epilog(u32 busNo,
 			* - BusDev_Client can handle ONLY client
 			* devices */
 			if (BusDev_Server_Notifiers.bus_create) {
-				(*BusDev_Server_Notifiers.bus_create) (busNo);
+				(*BusDev_Server_Notifiers.bus_create) (bus_no);
 				notified = TRUE;
 			}
-			if ((!pBusInfo->flags.server) /*client */ &&
+			if ((!bus_info->flags.server) /*client */ &&
 			    BusDev_Client_Notifiers.bus_create) {
-				(*BusDev_Client_Notifiers.bus_create) (busNo);
+				(*BusDev_Client_Notifiers.bus_create) (bus_no);
 				notified = TRUE;
 			}
 			break;
 		case CONTROLVM_BUS_DESTROY:
 			if (BusDev_Server_Notifiers.bus_destroy) {
-				(*BusDev_Server_Notifiers.bus_destroy) (busNo);
+				(*BusDev_Server_Notifiers.bus_destroy) (bus_no);
 				notified = TRUE;
 			}
-			if ((!pBusInfo->flags.server) /*client */ &&
+			if ((!bus_info->flags.server) /*client */ &&
 			    BusDev_Client_Notifiers.bus_destroy) {
-				(*BusDev_Client_Notifiers.bus_destroy) (busNo);
+				(*BusDev_Client_Notifiers.bus_destroy) (bus_no);
 				notified = TRUE;
 			}
 			break;
@@ -921,44 +922,44 @@ bus_epilog(u32 busNo,
 		 */
 		;
 	else
-		bus_responder(cmd, busNo, response);
+		bus_responder(cmd, bus_no, response);
 	up(&notifier_lock);
 }
 
 static void
-device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
-	      struct controlvm_message_header *msgHdr, int response,
-	      BOOL needResponse, BOOL for_visorbus)
+device_epilog(u32 bus_no, u32 dev_no, struct spar_segment_state state, u32 cmd,
+	      struct controlvm_message_header *msg_hdr, int response,
+	      BOOL need_response, BOOL for_visorbus)
 {
 	struct visorchipset_busdev_notifiers *notifiers = NULL;
 	BOOL notified = FALSE;
 
-	struct visorchipset_device_info *pDevInfo =
-		finddevice(&dev_info_list, busNo, devNo);
+	struct visorchipset_device_info *dev_info =
+		finddevice(&dev_info_list, bus_no, dev_no);
 	char *envp[] = {
 		"SPARSP_DIAGPOOL_PAUSED_STATE = 1",
 		NULL
 	};
 
-	if (!pDevInfo)
+	if (!dev_info)
 		return;
 
 	if (for_visorbus)
 		notifiers = &BusDev_Server_Notifiers;
 	else
 		notifiers = &BusDev_Client_Notifiers;
-	if (needResponse) {
-		memcpy(&pDevInfo->pending_msg_hdr, msgHdr,
+	if (need_response) {
+		memcpy(&dev_info->pending_msg_hdr, msg_hdr,
 		       sizeof(struct controlvm_message_header));
 	} else
-		pDevInfo->pending_msg_hdr.id = CONTROLVM_INVALID;
+		dev_info->pending_msg_hdr.id = CONTROLVM_INVALID;
 
 	down(&notifier_lock);
 	if (response >= 0) {
 		switch (cmd) {
 		case CONTROLVM_DEVICE_CREATE:
 			if (notifiers->device_create) {
-				(*notifiers->device_create) (busNo, devNo);
+				(*notifiers->device_create) (bus_no, dev_no);
 				notified = TRUE;
 			}
 			break;
@@ -968,8 +969,8 @@ device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
 			    state.operating ==
 				segment_state_running.operating) {
 				if (notifiers->device_resume) {
-					(*notifiers->device_resume) (busNo,
-								     devNo);
+					(*notifiers->device_resume) (bus_no,
+								     dev_no);
 					notified = TRUE;
 				}
 			}
@@ -981,8 +982,8 @@ device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
 				 * where server is lost
 				 */
 				if (notifiers->device_pause) {
-					(*notifiers->device_pause) (busNo,
-								    devNo);
+					(*notifiers->device_pause) (bus_no,
+								    dev_no);
 					notified = TRUE;
 				}
 			} else if (state.alive == segment_state_paused.alive &&
@@ -991,8 +992,8 @@ device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
 				/* this is lite pause where channel is
 				 * still valid just 'pause' of it
 				 */
-				if (busNo == g_diagpool_bus_no &&
-				    devNo == g_diagpool_dev_no) {
+				if (bus_no == g_diagpool_bus_no &&
+				    dev_no == g_diagpool_dev_no) {
 					/* this will trigger the
 					 * diag_shutdown.sh script in
 					 * the visorchipset hotplug */
@@ -1004,7 +1005,7 @@ device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
 			break;
 		case CONTROLVM_DEVICE_DESTROY:
 			if (notifiers->device_destroy) {
-				(*notifiers->device_destroy) (busNo, devNo);
+				(*notifiers->device_destroy) (bus_no, dev_no);
 				notified = TRUE;
 			}
 			break;
@@ -1017,7 +1018,7 @@ device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
 		 */
 		;
 	else
-		device_responder(cmd, busNo, devNo, response);
+		device_responder(cmd, bus_no, dev_no, response);
 	up(&notifier_lock);
 }
 
-- 
2.1.0

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

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

* [PATCH 35/69] staging: unisys: fix spaces after typecasts in visorchipset_main.c
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (33 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 34/69] staging: unisys: fix CamelCase in epilog functions Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 36/69] staging: unisys: fix braces " Benjamin Romer
                   ` (33 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Just remove a couple of extra spaces after typecasts.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 4e74799..fed675c 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -791,7 +791,7 @@ bus_responder(enum controlvm_id cmd_id, ulong bus_no, int response)
 
 	if (p->pending_msg_hdr.id == CONTROLVM_INVALID)
 		return;		/* no controlvm response needed */
-	if (p->pending_msg_hdr.id != (u32) cmd_id)
+	if (p->pending_msg_hdr.id != (u32)cmd_id)
 		return;
 	controlvm_respond(&p->pending_msg_hdr, response);
 	p->pending_msg_hdr.id = CONTROLVM_INVALID;
@@ -850,7 +850,7 @@ device_responder(enum controlvm_id cmd_id, ulong bus_no, ulong dev_no,
 	if (p->pending_msg_hdr.id == CONTROLVM_INVALID)
 		return;		/* no controlvm response needed */
 
-	if (p->pending_msg_hdr.id != (u32) cmd_id)
+	if (p->pending_msg_hdr.id != (u32)cmd_id)
 		return;
 
 	controlvm_respond(&p->pending_msg_hdr, response);
-- 
2.1.0

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

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

* [PATCH 36/69] staging: unisys: fix braces in visorchipset_main.c
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (34 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 35/69] staging: unisys: fix spaces after typecasts in visorchipset_main.c Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 37/69] staging: unisys: refactor bus_create() Benjamin Romer
                   ` (32 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix all of the bracing mistakes by adding missing braces, and removing
unnecessary braces.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../staging/unisys/visorchipset/visorchipset_main.c  | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index fed675c..c1bcc4af 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -875,8 +875,9 @@ bus_epilog(u32 bus_no,
 	if (need_response) {
 		memcpy(&bus_info->pending_msg_hdr, msg_hdr,
 		       sizeof(struct controlvm_message_header));
-	} else
+	} else {
 		bus_info->pending_msg_hdr.id = CONTROLVM_INVALID;
+	}
 
 	down(&notifier_lock);
 	if (response == CONTROLVM_RESP_SUCCESS) {
@@ -951,8 +952,9 @@ device_epilog(u32 bus_no, u32 dev_no, struct spar_segment_state state, u32 cmd,
 	if (need_response) {
 		memcpy(&dev_info->pending_msg_hdr, msg_hdr,
 		       sizeof(struct controlvm_message_header));
-	} else
+	} else {
 		dev_info->pending_msg_hdr.id = CONTROLVM_INVALID;
+	}
 
 	down(&notifier_lock);
 	if (response >= 0) {
@@ -1257,9 +1259,8 @@ my_device_destroy(struct controlvm_message *inmsg)
 		rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
 		goto Away;
 	}
-	if (pDevInfo->state.created == 0) {
+	if (pDevInfo->state.created == 0)
 		rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
-	}
 
 Away:
 	if ((rc >= CONTROLVM_RESP_SUCCESS) && pDevInfo)
@@ -1813,8 +1814,9 @@ controlvm_periodic_work(struct work_struct *work)
 			inmsg = ControlVm_Pending_Msg;
 			ControlVm_Pending_Msg_Valid = FALSE;
 			gotACommand = TRUE;
-		} else
+		} else {
 			gotACommand = read_controlvm_event(&inmsg);
+		}
 	}
 
 	handle_command_failed = FALSE;
@@ -1936,18 +1938,18 @@ setup_crash_devices_work_queue(struct work_struct *work)
 	}
 
 	/* reuse IOVM create bus message */
-	if (localCrashCreateBusMsg.cmd.create_bus.channel_addr != 0)
+	if (localCrashCreateBusMsg.cmd.create_bus.channel_addr != 0) {
 		bus_create(&localCrashCreateBusMsg);
-	else {
+	} else {
 		POSTCODE_LINUX_2(CRASH_DEV_BUS_NULL_FAILURE_PC,
 				 POSTCODE_SEVERITY_ERR);
 		return;
 	}
 
 	/* reuse create device message for storage device */
-	if (localCrashCreateDevMsg.cmd.create_device.channel_addr != 0)
+	if (localCrashCreateDevMsg.cmd.create_device.channel_addr != 0) {
 		my_device_create(&localCrashCreateDevMsg);
-	else {
+	} else {
 		POSTCODE_LINUX_2(CRASH_DEV_DEV_NULL_FAILURE_PC,
 				 POSTCODE_SEVERITY_ERR);
 		return;
-- 
2.1.0

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

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

* [PATCH 37/69] staging: unisys: refactor bus_create()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (35 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 36/69] staging: unisys: fix braces " Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 38/69] staging: unisys: refactor bus_destroy() Benjamin Romer
                   ` (31 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

First, fix all CamelCase names:

busNo => bus_no
pBusInfo => bus_info
Away => cleanup

Fix the kzalloc() call so it uses the variable name rather than the
type, and update all of the references to the renamed variables and
labels.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 51 +++++++++++-----------
 1 file changed, 25 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index c1bcc4af..e8795ac 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1028,50 +1028,49 @@ static void
 bus_create(struct controlvm_message *inmsg)
 {
 	struct controlvm_message_packet *cmd = &inmsg->cmd;
-	ulong busNo = cmd->create_bus.bus_no;
+	ulong bus_no = cmd->create_bus.bus_no;
 	int rc = CONTROLVM_RESP_SUCCESS;
-	struct visorchipset_bus_info *pBusInfo = NULL;
-
+	struct visorchipset_bus_info *bus_info = NULL;
 
-	pBusInfo = findbus(&bus_info_list, busNo);
-	if (pBusInfo && (pBusInfo->state.created == 1)) {
-		POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, busNo,
+	bus_info = findbus(&bus_info_list, bus_no);
+	if (bus_info && (bus_info->state.created == 1)) {
+		POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, bus_no,
 				 POSTCODE_SEVERITY_ERR);
 		rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
-		goto Away;
+		goto cleanup;
 	}
-	pBusInfo = kzalloc(sizeof(struct visorchipset_bus_info), GFP_KERNEL);
-	if (!pBusInfo) {
-		POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, busNo,
+	bus_info = kzalloc(sizeof(*bus_info), GFP_KERNEL);
+	if (!bus_info) {
+		POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, bus_no,
 				 POSTCODE_SEVERITY_ERR);
 		rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
-		goto Away;
+		goto cleanup;
 	}
 
-	INIT_LIST_HEAD(&pBusInfo->entry);
-	pBusInfo->bus_no = busNo;
-	pBusInfo->dev_no = cmd->create_bus.dev_count;
+	INIT_LIST_HEAD(&bus_info->entry);
+	bus_info->bus_no = bus_no;
+	bus_info->dev_no = cmd->create_bus.dev_count;
 
-	POSTCODE_LINUX_3(BUS_CREATE_ENTRY_PC, busNo, POSTCODE_SEVERITY_INFO);
+	POSTCODE_LINUX_3(BUS_CREATE_ENTRY_PC, bus_no, POSTCODE_SEVERITY_INFO);
 
 	if (inmsg->hdr.flags.test_message == 1)
-		pBusInfo->chan_info.addr_type = ADDRTYPE_LOCALTEST;
+		bus_info->chan_info.addr_type = ADDRTYPE_LOCALTEST;
 	else
-		pBusInfo->chan_info.addr_type = ADDRTYPE_LOCALPHYSICAL;
+		bus_info->chan_info.addr_type = ADDRTYPE_LOCALPHYSICAL;
 
-	pBusInfo->flags.server = inmsg->hdr.flags.server;
-	pBusInfo->chan_info.channel_addr = cmd->create_bus.channel_addr;
-	pBusInfo->chan_info.n_channel_bytes = cmd->create_bus.channel_bytes;
-	pBusInfo->chan_info.channel_type_uuid =
+	bus_info->flags.server = inmsg->hdr.flags.server;
+	bus_info->chan_info.channel_addr = cmd->create_bus.channel_addr;
+	bus_info->chan_info.n_channel_bytes = cmd->create_bus.channel_bytes;
+	bus_info->chan_info.channel_type_uuid =
 			cmd->create_bus.bus_data_type_uuid;
-	pBusInfo->chan_info.channel_inst_uuid = cmd->create_bus.bus_inst_uuid;
+	bus_info->chan_info.channel_inst_uuid = cmd->create_bus.bus_inst_uuid;
 
-	list_add(&pBusInfo->entry, &bus_info_list);
+	list_add(&bus_info->entry, &bus_info_list);
 
-	POSTCODE_LINUX_3(BUS_CREATE_EXIT_PC, busNo, POSTCODE_SEVERITY_INFO);
+	POSTCODE_LINUX_3(BUS_CREATE_EXIT_PC, bus_no, POSTCODE_SEVERITY_INFO);
 
-Away:
-	bus_epilog(busNo, CONTROLVM_BUS_CREATE, &inmsg->hdr,
+cleanup:
+	bus_epilog(bus_no, CONTROLVM_BUS_CREATE, &inmsg->hdr,
 		   rc, inmsg->hdr.flags.response_expected == 1);
 }
 
-- 
2.1.0

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

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

* [PATCH 38/69] staging: unisys: refactor bus_destroy()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (36 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 37/69] staging: unisys: refactor bus_create() Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 39/69] staging: unisys: refactor bus_configure() Benjamin Romer
                   ` (30 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix CamelCase names:

busNo => bus_no
pBusInfo => bus_info

Update all references to use the corrected names, and remove the goto
statements and labels entirely.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index e8795ac..ac0a381 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1078,22 +1078,17 @@ static void
 bus_destroy(struct controlvm_message *inmsg)
 {
 	struct controlvm_message_packet *cmd = &inmsg->cmd;
-	ulong busNo = cmd->destroy_bus.bus_no;
-	struct visorchipset_bus_info *pBusInfo;
+	ulong bus_no = cmd->destroy_bus.bus_no;
+	struct visorchipset_bus_info *bus_info;
 	int rc = CONTROLVM_RESP_SUCCESS;
 
-	pBusInfo = findbus(&bus_info_list, busNo);
-	if (!pBusInfo) {
+	bus_info = findbus(&bus_info_list, bus_no);
+	if (!bus_info)
 		rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
-		goto Away;
-	}
-	if (pBusInfo->state.created == 0) {
+	else if (bus_info->state.created == 0)
 		rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
-		goto Away;
-	}
 
-Away:
-	bus_epilog(busNo, CONTROLVM_BUS_DESTROY, &inmsg->hdr,
+	bus_epilog(bus_no, CONTROLVM_BUS_DESTROY, &inmsg->hdr,
 		   rc, inmsg->hdr.flags.response_expected == 1);
 }
 
-- 
2.1.0

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

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

* [PATCH 39/69] staging: unisys: refactor bus_configure()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (37 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 38/69] staging: unisys: refactor bus_destroy() Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 40/69] staging: unisys: refactor my_device_create() Benjamin Romer
                   ` (29 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

First, fix the CamelCase names:

busNo => bus_no
pBusInfo => bus_info

Update all references to use the corrected names, and remove the messy
goto and label.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 49 ++++++++++------------
 1 file changed, 22 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index ac0a381..b6a2810 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1097,44 +1097,39 @@ 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;
-	struct visorchipset_bus_info *pBusInfo = NULL;
+	ulong bus_no = cmd->configure_bus.bus_no;
+	struct visorchipset_bus_info *bus_info = NULL;
 	int rc = CONTROLVM_RESP_SUCCESS;
 	char s[99];
 
-	busNo = cmd->configure_bus.bus_no;
-	POSTCODE_LINUX_3(BUS_CONFIGURE_ENTRY_PC, busNo, POSTCODE_SEVERITY_INFO);
+	bus_no = cmd->configure_bus.bus_no;
+	POSTCODE_LINUX_3(BUS_CONFIGURE_ENTRY_PC, bus_no,
+			 POSTCODE_SEVERITY_INFO);
 
-	pBusInfo = findbus(&bus_info_list, busNo);
-	if (!pBusInfo) {
-		POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, busNo,
+	bus_info = findbus(&bus_info_list, bus_no);
+	if (!bus_info) {
+		POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, bus_no,
 				 POSTCODE_SEVERITY_ERR);
 		rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
-		goto Away;
-	}
-	if (pBusInfo->state.created == 0) {
-		POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, busNo,
+	} else if (bus_info->state.created == 0) {
+		POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, bus_no,
 				 POSTCODE_SEVERITY_ERR);
 		rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
-		goto Away;
-	}
-	/* TBD - add this check to other commands also... */
-	if (pBusInfo->pending_msg_hdr.id != CONTROLVM_INVALID) {
-		POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, busNo,
+	} else if (bus_info->pending_msg_hdr.id != CONTROLVM_INVALID) {
+		POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, bus_no,
 				 POSTCODE_SEVERITY_ERR);
 		rc = -CONTROLVM_RESP_ERROR_MESSAGE_ID_INVALID_FOR_CLIENT;
-		goto Away;
-	}
-
-	pBusInfo->partition_handle = cmd->configure_bus.guest_handle;
-	pBusInfo->partition_uuid = parser_id_get(parser_ctx);
-	parser_param_start(parser_ctx, PARSERSTRING_NAME);
-	pBusInfo->name = parser_string_get(parser_ctx);
+	} else {
+		bus_info->partition_handle = cmd->configure_bus.guest_handle;
+		bus_info->partition_uuid = parser_id_get(parser_ctx);
+		parser_param_start(parser_ctx, PARSERSTRING_NAME);
+		bus_info->name = parser_string_get(parser_ctx);
 
-	visorchannel_uuid_id(&pBusInfo->partition_uuid, s);
-	POSTCODE_LINUX_3(BUS_CONFIGURE_EXIT_PC, busNo, POSTCODE_SEVERITY_INFO);
-Away:
-	bus_epilog(busNo, CONTROLVM_BUS_CONFIGURE, &inmsg->hdr,
+		visorchannel_uuid_id(&bus_info->partition_uuid, s);
+		POSTCODE_LINUX_3(BUS_CONFIGURE_EXIT_PC, bus_no,
+				 POSTCODE_SEVERITY_INFO);
+	}
+	bus_epilog(bus_no, CONTROLVM_BUS_CONFIGURE, &inmsg->hdr,
 		   rc, inmsg->hdr.flags.response_expected == 1);
 }
 
-- 
2.1.0

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

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

* [PATCH 40/69] staging: unisys: refactor my_device_create()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (38 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 39/69] staging: unisys: refactor bus_configure() Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 41/69] staging: unisys: refactor my_device_changestate() Benjamin Romer
                   ` (28 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix local CamelCase variable names:

busNo => bus_no
devNo => dev_no
pDevinfo => dev_info
pBusInfo => bus_info
Away => cleanup

Update references to use the corrected names, and change the kzalloc()
to use the variable itself rather than the type.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 78 +++++++++++-----------
 1 file changed, 39 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index b6a2810..603afed 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1137,70 +1137,70 @@ static void
 my_device_create(struct controlvm_message *inmsg)
 {
 	struct controlvm_message_packet *cmd = &inmsg->cmd;
-	ulong busNo = cmd->create_device.bus_no;
-	ulong devNo = cmd->create_device.dev_no;
-	struct visorchipset_device_info *pDevInfo = NULL;
-	struct visorchipset_bus_info *pBusInfo = NULL;
+	ulong bus_no = cmd->create_device.bus_no;
+	ulong dev_no = cmd->create_device.dev_no;
+	struct visorchipset_device_info *dev_info = NULL;
+	struct visorchipset_bus_info *bus_info = NULL;
 	int rc = CONTROLVM_RESP_SUCCESS;
 
-	pDevInfo = finddevice(&dev_info_list, busNo, devNo);
-	if (pDevInfo && (pDevInfo->state.created == 1)) {
-		POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
+	dev_info = finddevice(&dev_info_list, bus_no, dev_no);
+	if (dev_info && (dev_info->state.created == 1)) {
+		POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no,
 				 POSTCODE_SEVERITY_ERR);
 		rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
-		goto Away;
+		goto cleanup;
 	}
-	pBusInfo = findbus(&bus_info_list, busNo);
-	if (!pBusInfo) {
-		POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
+	bus_info = findbus(&bus_info_list, bus_no);
+	if (!bus_info) {
+		POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no,
 				 POSTCODE_SEVERITY_ERR);
 		rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
-		goto Away;
+		goto cleanup;
 	}
-	if (pBusInfo->state.created == 0) {
-		POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
+	if (bus_info->state.created == 0) {
+		POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no,
 				 POSTCODE_SEVERITY_ERR);
 		rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
-		goto Away;
+		goto cleanup;
 	}
-	pDevInfo = kzalloc(sizeof(struct visorchipset_device_info), GFP_KERNEL);
-	if (!pDevInfo) {
-		POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
+	dev_info = kzalloc(sizeof(*dev_info), GFP_KERNEL);
+	if (!dev_info) {
+		POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no,
 				 POSTCODE_SEVERITY_ERR);
 		rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
-		goto Away;
+		goto cleanup;
 	}
 
-	INIT_LIST_HEAD(&pDevInfo->entry);
-	pDevInfo->bus_no = busNo;
-	pDevInfo->dev_no = devNo;
-	pDevInfo->dev_inst_uuid = cmd->create_device.dev_inst_uuid;
-	POSTCODE_LINUX_4(DEVICE_CREATE_ENTRY_PC, devNo, busNo,
+	INIT_LIST_HEAD(&dev_info->entry);
+	dev_info->bus_no = bus_no;
+	dev_info->dev_no = dev_no;
+	dev_info->dev_inst_uuid = cmd->create_device.dev_inst_uuid;
+	POSTCODE_LINUX_4(DEVICE_CREATE_ENTRY_PC, dev_no, bus_no,
 			 POSTCODE_SEVERITY_INFO);
 
 	if (inmsg->hdr.flags.test_message == 1)
-		pDevInfo->chan_info.addr_type = ADDRTYPE_LOCALTEST;
+		dev_info->chan_info.addr_type = ADDRTYPE_LOCALTEST;
 	else
-		pDevInfo->chan_info.addr_type = ADDRTYPE_LOCALPHYSICAL;
-	pDevInfo->chan_info.channel_addr = cmd->create_device.channel_addr;
-	pDevInfo->chan_info.n_channel_bytes = cmd->create_device.channel_bytes;
-	pDevInfo->chan_info.channel_type_uuid =
+		dev_info->chan_info.addr_type = ADDRTYPE_LOCALPHYSICAL;
+	dev_info->chan_info.channel_addr = cmd->create_device.channel_addr;
+	dev_info->chan_info.n_channel_bytes = cmd->create_device.channel_bytes;
+	dev_info->chan_info.channel_type_uuid =
 			cmd->create_device.data_type_uuid;
-	pDevInfo->chan_info.intr = cmd->create_device.intr;
-	list_add(&pDevInfo->entry, &dev_info_list);
-	POSTCODE_LINUX_4(DEVICE_CREATE_EXIT_PC, devNo, busNo,
+	dev_info->chan_info.intr = cmd->create_device.intr;
+	list_add(&dev_info->entry, &dev_info_list);
+	POSTCODE_LINUX_4(DEVICE_CREATE_EXIT_PC, dev_no, bus_no,
 			 POSTCODE_SEVERITY_INFO);
-Away:
+cleanup:
 	/* get the bus and devNo for DiagPool channel */
-	if (pDevInfo &&
-	    is_diagpool_channel(pDevInfo->chan_info.channel_type_uuid)) {
-		g_diagpool_bus_no = busNo;
-		g_diagpool_dev_no = devNo;
+	if (dev_info &&
+	    is_diagpool_channel(dev_info->chan_info.channel_type_uuid)) {
+		g_diagpool_bus_no = bus_no;
+		g_diagpool_dev_no = dev_no;
 	}
-	device_epilog(busNo, devNo, segment_state_running,
+	device_epilog(bus_no, dev_no, segment_state_running,
 		      CONTROLVM_DEVICE_CREATE, &inmsg->hdr, rc,
 		      inmsg->hdr.flags.response_expected == 1,
-		      FOR_VISORBUS(pDevInfo->chan_info.channel_type_uuid));
+		      FOR_VISORBUS(dev_info->chan_info.channel_type_uuid));
 }
 
 static void
-- 
2.1.0

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

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

* [PATCH 41/69] staging: unisys: refactor my_device_changestate()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (39 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 40/69] staging: unisys: refactor my_device_create() Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 42/69] staging: unisys: refactor my_device_destroy() Benjamin Romer
                   ` (27 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase names:

busNo => bus_no
devNo => dev_no
pDevInfo => dev_info

Update all references to use the new names, and remove the goto and
label entirely.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 27 ++++++++++------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 603afed..9327837 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1207,31 +1207,28 @@ static void
 my_device_changestate(struct controlvm_message *inmsg)
 {
 	struct controlvm_message_packet *cmd = &inmsg->cmd;
-	ulong busNo = cmd->device_change_state.bus_no;
-	ulong devNo = cmd->device_change_state.dev_no;
+	ulong bus_no = cmd->device_change_state.bus_no;
+	ulong dev_no = cmd->device_change_state.dev_no;
 	struct spar_segment_state state = cmd->device_change_state.state;
-	struct visorchipset_device_info *pDevInfo = NULL;
+	struct visorchipset_device_info *dev_info = NULL;
 	int rc = CONTROLVM_RESP_SUCCESS;
 
-	pDevInfo = finddevice(&dev_info_list, busNo, devNo);
-	if (!pDevInfo) {
-		POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, devNo, busNo,
+	dev_info = finddevice(&dev_info_list, bus_no, dev_no);
+	if (!dev_info) {
+		POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no,
 				 POSTCODE_SEVERITY_ERR);
 		rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
-		goto Away;
-	}
-	if (pDevInfo->state.created == 0) {
-		POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, devNo, busNo,
+	} else if (dev_info->state.created == 0) {
+		POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no,
 				 POSTCODE_SEVERITY_ERR);
 		rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
 	}
-Away:
-	if ((rc >= CONTROLVM_RESP_SUCCESS) && pDevInfo)
-		device_epilog(busNo, devNo, state, CONTROLVM_DEVICE_CHANGESTATE,
-			      &inmsg->hdr, rc,
+	if ((rc >= CONTROLVM_RESP_SUCCESS) && dev_info)
+		device_epilog(bus_no, dev_no, state,
+			      CONTROLVM_DEVICE_CHANGESTATE, &inmsg->hdr, rc,
 			      inmsg->hdr.flags.response_expected == 1,
 			      FOR_VISORBUS(
-					pDevInfo->chan_info.channel_type_uuid));
+					dev_info->chan_info.channel_type_uuid));
 }
 
 static void
-- 
2.1.0

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

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

* [PATCH 42/69] staging: unisys: refactor my_device_destroy()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (40 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 41/69] staging: unisys: refactor my_device_changestate() Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 43/69] staging: unisys: refactor initialize_controlvm_payload_info() Benjamin Romer
                   ` (26 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase variable names:

busNo => bus_no
devNo => dev_no
pDevInfo => dev_info

Update all the references to the updated names, then remove the goto and
its label.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../staging/unisys/visorchipset/visorchipset_main.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 9327837..4fe1ad1 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1235,26 +1235,23 @@ static void
 my_device_destroy(struct controlvm_message *inmsg)
 {
 	struct controlvm_message_packet *cmd = &inmsg->cmd;
-	ulong busNo = cmd->destroy_device.bus_no;
-	ulong devNo = cmd->destroy_device.dev_no;
-	struct visorchipset_device_info *pDevInfo = NULL;
+	ulong bus_no = cmd->destroy_device.bus_no;
+	ulong dev_no = cmd->destroy_device.dev_no;
+	struct visorchipset_device_info *dev_info = NULL;
 	int rc = CONTROLVM_RESP_SUCCESS;
 
-	pDevInfo = finddevice(&dev_info_list, busNo, devNo);
-	if (!pDevInfo) {
+	dev_info = finddevice(&dev_info_list, bus_no, dev_no);
+	if (!dev_info)
 		rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
-		goto Away;
-	}
-	if (pDevInfo->state.created == 0)
+	else if (dev_info->state.created == 0)
 		rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
 
-Away:
-	if ((rc >= CONTROLVM_RESP_SUCCESS) && pDevInfo)
-		device_epilog(busNo, devNo, segment_state_running,
+	if ((rc >= CONTROLVM_RESP_SUCCESS) && dev_info)
+		device_epilog(bus_no, dev_no, segment_state_running,
 			      CONTROLVM_DEVICE_DESTROY, &inmsg->hdr, rc,
 			      inmsg->hdr.flags.response_expected == 1,
 			      FOR_VISORBUS(
-					pDevInfo->chan_info.channel_type_uuid));
+					dev_info->chan_info.channel_type_uuid));
 }
 
 /* When provided with the physical address of the controlvm channel
-- 
2.1.0

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

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

* [PATCH 43/69] staging: unisys: refactor initialize_controlvm_payload_info()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (41 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 42/69] staging: unisys: refactor my_device_destroy() Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 44/69] staging: unisys: fix NULL comparison in destroy_controlvm_payload_info() Benjamin Romer
                   ` (25 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCased goto label:

Away => cleanup

and get rid of the NULL comparison.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 4fe1ad1..7956ae71 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1269,26 +1269,26 @@ initialize_controlvm_payload_info(HOSTADDRESS phys_addr, u64 offset, u32 bytes,
 
 	if (!info) {
 		rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
-		goto Away;
+		goto cleanup;
 	}
 	memset(info, 0, sizeof(struct controlvm_payload_info));
 	if ((offset == 0) || (bytes == 0)) {
 		rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
-		goto Away;
+		goto cleanup;
 	}
 	payload = ioremap_cache(phys_addr + offset, bytes);
 	if (!payload) {
 		rc = -CONTROLVM_RESP_ERROR_IOREMAP_FAILED;
-		goto Away;
+		goto cleanup;
 	}
 
 	info->offset = offset;
 	info->bytes = bytes;
 	info->ptr = payload;
 
-Away:
+cleanup:
 	if (rc < 0) {
-		if (payload != NULL) {
+		if (payload) {
 			iounmap(payload);
 			payload = NULL;
 		}
-- 
2.1.0

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

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

* [PATCH 44/69] staging: unisys: fix NULL comparison in destroy_controlvm_payload_info()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (42 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 43/69] staging: unisys: refactor initialize_controlvm_payload_info() Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 45/69] staging: unisys: fix Camelcase in initialize_controlvm_payload() Benjamin Romer
                   ` (24 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Just remove the NULL from the check and test the pointer directly.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 7956ae71..0f791fb 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1299,7 +1299,7 @@ cleanup:
 static void
 destroy_controlvm_payload_info(struct controlvm_payload_info *info)
 {
-	if (info->ptr != NULL) {
+	if (info->ptr) {
 		iounmap(info->ptr);
 		info->ptr = NULL;
 	}
-- 
2.1.0

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

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

* [PATCH 45/69] staging: unisys: fix Camelcase in initialize_controlvm_payload()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (43 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 44/69] staging: unisys: fix NULL comparison in destroy_controlvm_payload_info() Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 46/69] staging: unisys: refactor parahotplug_process_list() Benjamin Romer
                   ` (23 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase local variables:

payloadOffset => payload_offset
payloadBytes => payload_bytes

Update all references to use the new names.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 0f791fb..a32d092 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1310,13 +1310,13 @@ static void
 initialize_controlvm_payload(void)
 {
 	HOSTADDRESS phys_addr = visorchannel_get_physaddr(controlvm_channel);
-	u64 payloadOffset = 0;
-	u32 payloadBytes = 0;
+	u64 payload_offset = 0;
+	u32 payload_bytes = 0;
 
 	if (visorchannel_read(controlvm_channel,
 			      offsetof(struct spar_controlvm_channel_protocol,
 				       request_payload_offset),
-			      &payloadOffset, sizeof(payloadOffset)) < 0) {
+			      &payload_offset, sizeof(payload_offset)) < 0) {
 		POSTCODE_LINUX_2(CONTROLVM_INIT_FAILURE_PC,
 				 POSTCODE_SEVERITY_ERR);
 		return;
@@ -1324,13 +1324,13 @@ initialize_controlvm_payload(void)
 	if (visorchannel_read(controlvm_channel,
 			      offsetof(struct spar_controlvm_channel_protocol,
 				       request_payload_bytes),
-			      &payloadBytes, sizeof(payloadBytes)) < 0) {
+			      &payload_bytes, sizeof(payload_bytes)) < 0) {
 		POSTCODE_LINUX_2(CONTROLVM_INIT_FAILURE_PC,
 				 POSTCODE_SEVERITY_ERR);
 		return;
 	}
 	initialize_controlvm_payload_info(phys_addr,
-					  payloadOffset, payloadBytes,
+					  payload_offset, payload_bytes,
 					  &controlvm_payload_info);
 }
 
-- 
2.1.0

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

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

* [PATCH 46/69] staging: unisys: refactor parahotplug_process_list()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (44 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 45/69] staging: unisys: fix Camelcase in initialize_controlvm_payload() Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 47/69] staging: unisys: fix spacing in parahotplug_request_create Benjamin Romer
                   ` (22 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Simplify the code a little and shorten the indentation levels by
reversing the check for time_after_eq().

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index a32d092..e25bf80 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1535,15 +1535,17 @@ parahotplug_process_list(void)
 	list_for_each_safe(pos, tmp, &Parahotplug_request_list) {
 		struct parahotplug_request *req =
 		    list_entry(pos, struct parahotplug_request, list);
-		if (time_after_eq(jiffies, req->expiration)) {
-			list_del(pos);
-			if (req->msg.hdr.flags.response_expected)
-				controlvm_respond_physdev_changestate(
-					&req->msg.hdr,
-					CONTROLVM_RESP_ERROR_DEVICE_UDEV_TIMEOUT,
-					req->msg.cmd.device_change_state.state);
-			parahotplug_request_destroy(req);
-		}
+
+		if (!time_after_eq(jiffies, req->expiration))
+			continue;
+
+		list_del(pos);
+		if (req->msg.hdr.flags.response_expected)
+			controlvm_respond_physdev_changestate(
+				&req->msg.hdr,
+				CONTROLVM_RESP_ERROR_DEVICE_UDEV_TIMEOUT,
+				req->msg.cmd.device_change_state.state);
+		parahotplug_request_destroy(req);
 	}
 
 	spin_unlock(&Parahotplug_request_list_lock);
@@ -1621,7 +1623,7 @@ parahotplug_process_message(struct controlvm_message *inmsg)
 		* indicated it's done.
 		*/
 		spin_lock(&Parahotplug_request_list_lock);
-		list_add_tail(&(req->list), &Parahotplug_request_list);
+		list_add_tail(&req->list, &Parahotplug_request_list);
 		spin_unlock(&Parahotplug_request_list_lock);
 
 		parahotplug_request_kickoff(req);
-- 
2.1.0

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

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

* [PATCH 47/69] staging: unisys: fix spacing in parahotplug_request_create
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (45 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 46/69] staging: unisys: refactor parahotplug_process_list() Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 48/69] staging: unisys: refactor handle_command() Benjamin Romer
                   ` (21 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Just fix the spacing around the logical or operator in this function.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index e25bf80..1056831 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1470,7 +1470,7 @@ parahotplug_request_create(struct controlvm_message *msg)
 {
 	struct parahotplug_request *req;
 
-	req = kmalloc(sizeof(*req), GFP_KERNEL|__GFP_NORETRY);
+	req = kmalloc(sizeof(*req), GFP_KERNEL | __GFP_NORETRY);
 	if (!req)
 		return NULL;
 
-- 
2.1.0

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

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

* [PATCH 48/69] staging: unisys: refactor handle_command()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (46 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 47/69] staging: unisys: fix spacing in parahotplug_request_create Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 49/69] staging: unisys: refactor controlvm_periodic_work() Benjamin Romer
                   ` (20 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

First, fix the CamelCase local variable names:

parametersAddr => parm_addr
parametersBytes => parm_bytes
isLocalAddr => local_addr

Change the type of local_addr to bool instead of using the #defined
type. Update all references to use the fixed names. Fix the indentation of that
line that's over the 80 column limit.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 1056831..7f1dec7 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1645,34 +1645,34 @@ static BOOL
 handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
 {
 	struct controlvm_message_packet *cmd = &inmsg.cmd;
-	u64 parametersAddr = 0;
-	u32 parametersBytes = 0;
+	u64 parm_addr = 0;
+	u32 parm_bytes = 0;
 	struct parser_context *parser_ctx = NULL;
-	BOOL isLocalAddr = FALSE;
+	bool local_addr = false;
 	struct controlvm_message ackmsg;
 
 	/* create parsing context if necessary */
-	isLocalAddr = (inmsg.hdr.flags.test_message == 1);
+	local_addr = (inmsg.hdr.flags.test_message == 1);
 	if (channel_addr == 0)
 		return TRUE;
-	parametersAddr = channel_addr + inmsg.hdr.payload_vm_offset;
-	parametersBytes = inmsg.hdr.payload_bytes;
+	parm_addr = channel_addr + inmsg.hdr.payload_vm_offset;
+	parm_bytes = inmsg.hdr.payload_bytes;
 
 	/* Parameter and channel addresses within test messages actually lie
 	 * within our OS-controlled memory.  We need to know that, because it
 	 * makes a difference in how we compute the virtual address.
 	 */
-	if (parametersAddr != 0 && parametersBytes != 0) {
+	if (parm_addr != 0 && parm_bytes != 0) {
 		BOOL retry = FALSE;
 
 		parser_ctx =
-		    parser_init_byte_stream(parametersAddr, parametersBytes,
-					   isLocalAddr, &retry);
+		    parser_init_byte_stream(parm_addr, parm_bytes,
+					    local_addr, &retry);
 		if (!parser_ctx && retry)
 			return FALSE;
 	}
 
-	if (!isLocalAddr) {
+	if (!local_addr) {
 		controlvm_init_response(&ackmsg, &inmsg.hdr,
 					CONTROLVM_RESP_SUCCESS);
 		if (controlvm_channel)
@@ -1728,7 +1728,7 @@ handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
 	default:
 		if (inmsg.hdr.flags.response_expected)
 			controlvm_respond(&inmsg.hdr,
-					  -CONTROLVM_RESP_ERROR_MESSAGE_ID_UNKNOWN);
+				-CONTROLVM_RESP_ERROR_MESSAGE_ID_UNKNOWN);
 		break;
 	}
 
-- 
2.1.0

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

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

* [PATCH 49/69] staging: unisys: refactor controlvm_periodic_work()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (47 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 48/69] staging: unisys: refactor handle_command() Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 50/69] staging: unisys: fix CamelCase in setup_crash_devices_work_queue() Benjamin Romer
                   ` (19 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase variable names:

gotACommand => got_command
Poll_Count => poll_count
Away => cleanup

Fix all references to use the new names. Remove the empty braces in the
while() and put in a trailing semicolon, for clarity.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 26 +++++++++++-----------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 7f1dec7..4a25630 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1754,24 +1754,24 @@ static void
 controlvm_periodic_work(struct work_struct *work)
 {
 	struct controlvm_message inmsg;
-	BOOL gotACommand = FALSE;
+	BOOL got_command = FALSE;
 	BOOL handle_command_failed = FALSE;
-	static u64 Poll_Count;
+	static u64 poll_count;
 
 	/* make sure visorbus server is registered for controlvm callbacks */
 	if (visorchipset_serverregwait && !serverregistered)
-		goto Away;
+		goto cleanup;
 	/* make sure visorclientbus server is regsitered for controlvm
 	 * callbacks
 	 */
 	if (visorchipset_clientregwait && !clientregistered)
-		goto Away;
+		goto cleanup;
 
-	Poll_Count++;
-	if (Poll_Count >= 250)
+	poll_count++;
+	if (poll_count >= 250)
 		;	/* keep going */
 	else
-		goto Away;
+		goto cleanup;
 
 	/* Check events to determine if response to CHIPSET_READY
 	 * should be sent
@@ -1790,7 +1790,7 @@ controlvm_periodic_work(struct work_struct *work)
 					 CONTROLVM_QUEUE_RESPONSE,
 					 &inmsg))
 		;
-	if (!gotACommand) {
+	if (!got_command) {
 		if (ControlVm_Pending_Msg_Valid) {
 			/* we throttled processing of a prior
 			* msg, so try to process it again
@@ -1798,19 +1798,19 @@ controlvm_periodic_work(struct work_struct *work)
 			*/
 			inmsg = ControlVm_Pending_Msg;
 			ControlVm_Pending_Msg_Valid = FALSE;
-			gotACommand = TRUE;
+			got_command = true;
 		} else {
-			gotACommand = read_controlvm_event(&inmsg);
+			got_command = read_controlvm_event(&inmsg);
 		}
 	}
 
 	handle_command_failed = FALSE;
-	while (gotACommand && (!handle_command_failed)) {
+	while (got_command && (!handle_command_failed)) {
 		most_recent_message_jiffies = jiffies;
 		if (handle_command(inmsg,
 				   visorchannel_get_physaddr
 				   (controlvm_channel)))
-			gotACommand = read_controlvm_event(&inmsg);
+			got_command = read_controlvm_event(&inmsg);
 		else {
 			/* this is a scenario where throttling
 			* is required, but probably NOT an
@@ -1827,7 +1827,7 @@ controlvm_periodic_work(struct work_struct *work)
 	/* parahotplug_worker */
 	parahotplug_process_list();
 
-Away:
+cleanup:
 
 	if (time_after(jiffies,
 		       most_recent_message_jiffies + (HZ * MIN_IDLE_SECONDS))) {
-- 
2.1.0

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

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

* [PATCH 50/69] staging: unisys: fix CamelCase in setup_crash_devices_work_queue()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (48 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 49/69] staging: unisys: refactor controlvm_periodic_work() Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 51/69] staging: unisys: fix CamelCase label in visorchipset_init() Benjamin Romer
                   ` (18 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix CamelCase names:

localCrashCreateBusMsg => local_crash_bus_msg
localCrashCreateDevMsg => local_crash_dev_msg
localSavedCrashMsgOffset => local_crash_msg_offset
localSavedCrashMsgCount => local_crash_msg_count
Away => cleanup

Update all references to use the fixed names.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 38 +++++++++++-----------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 4a25630..275a0a3 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1849,21 +1849,21 @@ cleanup:
 static void
 setup_crash_devices_work_queue(struct work_struct *work)
 {
-	struct controlvm_message localCrashCreateBusMsg;
-	struct controlvm_message localCrashCreateDevMsg;
+	struct controlvm_message local_crash_bus_msg;
+	struct controlvm_message local_crash_dev_msg;
 	struct controlvm_message msg;
-	u32 localSavedCrashMsgOffset;
-	u16 localSavedCrashMsgCount;
+	u32 local_crash_msg_offset;
+	u16 local_crash_msg_count;
 
 	/* make sure visorbus server is registered for controlvm callbacks */
 	if (visorchipset_serverregwait && !serverregistered)
-		goto Away;
+		goto cleanup;
 
 	/* make sure visorclientbus server is regsitered for controlvm
 	 * callbacks
 	 */
 	if (visorchipset_clientregwait && !clientregistered)
-		goto Away;
+		goto cleanup;
 
 	POSTCODE_LINUX_2(CRASH_DEV_ENTRY_PC, POSTCODE_SEVERITY_INFO);
 
@@ -1878,15 +1878,15 @@ setup_crash_devices_work_queue(struct work_struct *work)
 	if (visorchannel_read(controlvm_channel,
 			      offsetof(struct spar_controlvm_channel_protocol,
 				       saved_crash_message_count),
-			      &localSavedCrashMsgCount, sizeof(u16)) < 0) {
+			      &local_crash_msg_count, sizeof(u16)) < 0) {
 		POSTCODE_LINUX_2(CRASH_DEV_CTRL_RD_FAILURE_PC,
 				 POSTCODE_SEVERITY_ERR);
 		return;
 	}
 
-	if (localSavedCrashMsgCount != CONTROLVM_CRASHMSG_MAX) {
+	if (local_crash_msg_count != CONTROLVM_CRASHMSG_MAX) {
 		POSTCODE_LINUX_3(CRASH_DEV_COUNT_FAILURE_PC,
-				 localSavedCrashMsgCount,
+				 local_crash_msg_count,
 				 POSTCODE_SEVERITY_ERR);
 		return;
 	}
@@ -1895,7 +1895,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
 	if (visorchannel_read(controlvm_channel,
 			      offsetof(struct spar_controlvm_channel_protocol,
 				       saved_crash_message_offset),
-			      &localSavedCrashMsgOffset, sizeof(u32)) < 0) {
+			      &local_crash_msg_offset, sizeof(u32)) < 0) {
 		POSTCODE_LINUX_2(CRASH_DEV_CTRL_RD_FAILURE_PC,
 				 POSTCODE_SEVERITY_ERR);
 		return;
@@ -1903,8 +1903,8 @@ setup_crash_devices_work_queue(struct work_struct *work)
 
 	/* read create device message for storage bus offset */
 	if (visorchannel_read(controlvm_channel,
-			      localSavedCrashMsgOffset,
-			      &localCrashCreateBusMsg,
+			      local_crash_msg_offset,
+			      &local_crash_bus_msg,
 			      sizeof(struct controlvm_message)) < 0) {
 		POSTCODE_LINUX_2(CRASH_DEV_RD_BUS_FAIULRE_PC,
 				 POSTCODE_SEVERITY_ERR);
@@ -1913,9 +1913,9 @@ setup_crash_devices_work_queue(struct work_struct *work)
 
 	/* read create device message for storage device */
 	if (visorchannel_read(controlvm_channel,
-			      localSavedCrashMsgOffset +
+			      local_crash_msg_offset +
 			      sizeof(struct controlvm_message),
-			      &localCrashCreateDevMsg,
+			      &local_crash_dev_msg,
 			      sizeof(struct controlvm_message)) < 0) {
 		POSTCODE_LINUX_2(CRASH_DEV_RD_DEV_FAIULRE_PC,
 				 POSTCODE_SEVERITY_ERR);
@@ -1923,8 +1923,8 @@ setup_crash_devices_work_queue(struct work_struct *work)
 	}
 
 	/* reuse IOVM create bus message */
-	if (localCrashCreateBusMsg.cmd.create_bus.channel_addr != 0) {
-		bus_create(&localCrashCreateBusMsg);
+	if (local_crash_bus_msg.cmd.create_bus.channel_addr != 0) {
+		bus_create(&local_crash_bus_msg);
 	} else {
 		POSTCODE_LINUX_2(CRASH_DEV_BUS_NULL_FAILURE_PC,
 				 POSTCODE_SEVERITY_ERR);
@@ -1932,8 +1932,8 @@ setup_crash_devices_work_queue(struct work_struct *work)
 	}
 
 	/* reuse create device message for storage device */
-	if (localCrashCreateDevMsg.cmd.create_device.channel_addr != 0) {
-		my_device_create(&localCrashCreateDevMsg);
+	if (local_crash_dev_msg.cmd.create_device.channel_addr != 0) {
+		my_device_create(&local_crash_dev_msg);
 	} else {
 		POSTCODE_LINUX_2(CRASH_DEV_DEV_NULL_FAILURE_PC,
 				 POSTCODE_SEVERITY_ERR);
@@ -1942,7 +1942,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
 	POSTCODE_LINUX_2(CRASH_DEV_EXIT_PC, POSTCODE_SEVERITY_INFO);
 	return;
 
-Away:
+cleanup:
 
 	poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW;
 
-- 
2.1.0

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

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

* [PATCH 51/69] staging: unisys: fix CamelCase label in visorchipset_init()
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (49 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 50/69] staging: unisys: fix CamelCase in setup_crash_devices_work_queue() Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 52/69] staging: unisys: fix NULL pointer comparisons in uislib.c Benjamin Romer
                   ` (17 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase label:

Away => cleanup

Update all references to use the fixed name.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 275a0a3..f4309b3 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -2150,7 +2150,7 @@ visorchipset_init(void)
 	if (visorchipset_testvnic) {
 		POSTCODE_LINUX_3(CHIPSET_INIT_FAILURE_PC, x, DIAG_SEVERITY_ERR);
 		rc = x;
-		goto Away;
+		goto cleanup;
 	}
 
 	addr = controlvm_get_channel_address();
@@ -2176,7 +2176,7 @@ visorchipset_init(void)
 	rc = visorchipset_file_init(MajorDev, &controlvm_channel);
 	if (rc < 0) {
 		POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
-		goto Away;
+		goto cleanup;
 	}
 
 	memset(&g_diag_msg_hdr, 0, sizeof(struct controlvm_message_header));
@@ -2192,7 +2192,7 @@ visorchipset_init(void)
 	if (!Putfile_buffer_list_pool) {
 		POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
 		rc = -1;
-		goto Away;
+		goto cleanup;
 	}
 	if (!visorchipset_disable_controlvm) {
 		/* if booting in a crash kernel */
@@ -2209,7 +2209,7 @@ visorchipset_init(void)
 			POSTCODE_LINUX_2(CREATE_WORKQUEUE_FAILED_PC,
 					 DIAG_SEVERITY_ERR);
 			rc = -ENOMEM;
-			goto Away;
+			goto cleanup;
 		}
 		most_recent_message_jiffies = jiffies;
 		poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
@@ -2218,7 +2218,7 @@ visorchipset_init(void)
 		if (rc < 0) {
 			POSTCODE_LINUX_2(QUEUE_DELAYED_WORK_PC,
 					 DIAG_SEVERITY_ERR);
-			goto Away;
+			goto cleanup;
 		}
 	}
 
@@ -2226,11 +2226,11 @@ visorchipset_init(void)
 	if (platform_device_register(&Visorchipset_platform_device) < 0) {
 		POSTCODE_LINUX_2(DEVICE_REGISTER_FAILURE_PC, DIAG_SEVERITY_ERR);
 		rc = -1;
-		goto Away;
+		goto cleanup;
 	}
 	POSTCODE_LINUX_2(CHIPSET_INIT_SUCCESS_PC, POSTCODE_SEVERITY_INFO);
 	rc = 0;
-Away:
+cleanup:
 	if (rc) {
 		POSTCODE_LINUX_3(CHIPSET_INIT_FAILURE_PC, rc,
 				 POSTCODE_SEVERITY_ERR);
-- 
2.1.0

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

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

* [PATCH 52/69] staging: unisys: fix NULL pointer comparisons in uislib.c
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (50 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 51/69] staging: unisys: fix CamelCase label in visorchipset_init() Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 53/69] staging: unisys: remove unnecessary brackets " Benjamin Romer
                   ` (16 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Change pointer comparisons to NULL to just use the pointer directly.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/uislib/uislib.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c
index 4318f06..e150bbd 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -281,7 +281,7 @@ destroy_bus(struct controlvm_message *msg, char *buf)
 
 	/* verify that this bus has no devices. */
 	for (i = 0; i < bus->device_count; i++) {
-		if (bus->device[i] != NULL) {
+		if (bus->device[i]) {
 			read_unlock(&bus_list_lock);
 			return CONTROLVM_RESP_ERROR_BUS_DEVICE_ATTACHED;
 		}
@@ -969,7 +969,7 @@ uislib_cache_alloc(struct kmem_cache *cur_pool, char *fn, int ln)
 	*/
 	void *p = kmem_cache_alloc(cur_pool, GFP_ATOMIC | __GFP_NORETRY);
 
-	if (p == NULL)
+	if (!p)
 		return NULL;
 	return p;
 }
@@ -978,7 +978,7 @@ EXPORT_SYMBOL_GPL(uislib_cache_alloc);
 void
 uislib_cache_free(struct kmem_cache *cur_pool, void *p, char *fn, int ln)
 {
-	if (p == NULL)
+	if (!p)
 		return;
 	kmem_cache_free(cur_pool, p);
 }
@@ -1057,10 +1057,10 @@ static ssize_t info_debugfs_read(struct file *file, char __user *buf,
 	int remaining_bytes = PROC_READ_BUFFER_SIZE;
 
 /* *start = buf; */
-	if (debug_buf == NULL) {
+	if (!debug_buf) {
 		debug_buf = vmalloc(PROC_READ_BUFFER_SIZE);
 
-		if (debug_buf == NULL)
+		if (!debug_buf)
 			return -ENOMEM;
 	}
 
@@ -1163,7 +1163,7 @@ static int process_incoming(void *v)
 				* Reschedule work to occur as soon as
 				* possible. */
 				idle_cycles = 0;
-				if (new_tail == NULL) {
+				if (!new_tail) {
 					dev->first_busy_cnt++;
 					if (!
 					    (list_is_last
@@ -1179,7 +1179,7 @@ static int process_incoming(void *v)
 			if (kthread_should_stop())
 				break;
 		}
-		if (new_tail != NULL) {
+		if (new_tail) {
 			tot_moved_to_tail_cnt++;
 			list_move_tail(new_tail, &poll_dev_chan);
 		}
-- 
2.1.0

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

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

* [PATCH 53/69] staging: unisys: remove unnecessary brackets in uislib.c
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (51 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 52/69] staging: unisys: fix NULL pointer comparisons in uislib.c Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-23 21:00   ` Greg KH
  2015-03-16 17:58 ` [PATCH 54/69] staging: unisys: remove last remnants of proc entry code Benjamin Romer
                   ` (15 subsequent siblings)
  68 siblings, 1 reply; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Take out extra braces from if statements with only a single line of code
inside.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/uislib/uislib.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c
index e150bbd..f93d0bb 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -534,9 +534,8 @@ static int pause_device(struct controlvm_message *msg)
 		} else {
 			return CONTROLVM_RESP_ERROR_CHANNEL_TYPE_UNKNOWN;
 		}
-		if (!virt_control_chan_func) {
+		if (!virt_control_chan_func)
 			return CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_FAILURE;
-		}
 		if (!virt_control_chan_func(&cmd)) {
 			return
 			  CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_CALLBACK_ERROR;
@@ -593,9 +592,8 @@ static int resume_device(struct controlvm_message *msg)
 		} else {
 			return CONTROLVM_RESP_ERROR_CHANNEL_TYPE_UNKNOWN;
 		}
-		if (!virt_control_chan_func) {
+		if (!virt_control_chan_func)
 			return CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_FAILURE;
-		}
 		if (!virt_control_chan_func(&cmd)) {
 			return
 			  CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_CALLBACK_ERROR;
@@ -665,13 +663,11 @@ static int destroy_device(struct controlvm_message *msg, char *buf)
  * on which accesses the channel and you will get a "unable to handle
  * kernel paging request"
  */
-		if (dev->polling) {
+		if (dev->polling)
 			uislib_disable_channel_interrupts(bus_no, dev_no);
-		}
 		/* unmap the channel memory for the device. */
-		if (!msg->hdr.flags.test_message) {
+		if (!msg->hdr.flags.test_message)
 			uislib_iounmap(dev->chanptr);
-		}
 		kfree(dev);
 		bus->device[dev_no] = NULL;
 	}
@@ -928,9 +924,8 @@ uislib_client_inject_pause_vnic(u32 bus_no, u32 dev_no)
 	msg.cmd.device_change_state.dev_no = dev_no;
 	msg.cmd.device_change_state.state = segment_state_standby;
 	rc = pause_device(&msg);
-	if (rc != CONTROLVM_RESP_SUCCESS) {
+	if (rc != CONTROLVM_RESP_SUCCESS)
 		return -1;
-	}
 	return 0;
 }
 EXPORT_SYMBOL_GPL(uislib_client_inject_pause_vnic);
@@ -1195,9 +1190,8 @@ static int process_incoming(void *v)
 		*/
 		if (kthread_should_stop())
 			break;
-		if (en_smart_wakeup == 0xFF) {
+		if (en_smart_wakeup == 0xFF)
 			break;
-		}
 		/* wait for POLLJIFFIES_NORMAL jiffies, or until
 		* someone wakes up poll_dev_wake_q,
 		* whichever comes first only do a wait when we have
-- 
2.1.0

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

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

* [PATCH 54/69] staging: unisys: remove last remnants of proc entry code
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (52 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 53/69] staging: unisys: remove unnecessary brackets " Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 55/69] staging: unisys: fix CamelCased ControlVM globals Benjamin Romer
                   ` (14 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

All of the proc code using easyproc and procobjecttree support is gone,
so we can remove it from the source entirely.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorutil/Makefile         |   3 +-
 drivers/staging/unisys/visorutil/easyproc.c       | 356 ----------------------
 drivers/staging/unisys/visorutil/easyproc.h       |  92 ------
 drivers/staging/unisys/visorutil/procobjecttree.c | 335 --------------------
 4 files changed, 1 insertion(+), 785 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorutil/easyproc.c
 delete mode 100644 drivers/staging/unisys/visorutil/easyproc.h
 delete mode 100644 drivers/staging/unisys/visorutil/procobjecttree.c

diff --git a/drivers/staging/unisys/visorutil/Makefile b/drivers/staging/unisys/visorutil/Makefile
index d871bbb..d9ab5a3 100644
--- a/drivers/staging/unisys/visorutil/Makefile
+++ b/drivers/staging/unisys/visorutil/Makefile
@@ -4,7 +4,6 @@
 
 obj-$(CONFIG_UNISYS_VISORUTIL)	+= visorutil.o
 
-visorutil-y := charqueue.o  easyproc.o  periodic_work.o  procobjecttree.o  \
-		memregion_direct.o visorkmodutils.o
+visorutil-y := charqueue.o  periodic_work.o  memregion_direct.o visorkmodutils.o
 
 ccflags-y += -Idrivers/staging/unisys/include
diff --git a/drivers/staging/unisys/visorutil/easyproc.c b/drivers/staging/unisys/visorutil/easyproc.c
deleted file mode 100644
index 3cb55d3..0000000
--- a/drivers/staging/unisys/visorutil/easyproc.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/* Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-/** @file *********************************************************************
- *
- *  Handle procfs-specific tasks.
- *  Note that this file does not know about any module-specific things, nor
- *  does it know anything about what information to reveal as part of the proc
- *  entries.  The 2 functions that take care of displaying device and
- *  driver specific information are passed as parameters to
- *  visor_easyproc_InitDriver().
- *
- *      void show_device_info(struct seq_file *seq, void *p);
- *      void show_driver_info(struct seq_file *seq);
- *
- *  The second parameter to show_device_info is actually a pointer to the
- *  device-specific info to show.  It is the context that was originally
- *  passed to visor_easyproc_InitDevice().
- *
- ******************************************************************************
- */
-
-#include <linux/proc_fs.h>
-
-#include "timskmod.h"
-#include "easyproc.h"
-
-#define MYDRVNAME "easyproc"
-
-
-
-/*
- *   /proc/<ProcId>                              ProcDir
- *   /proc/<ProcId>/driver                       ProcDriverDir
- *   /proc/<ProcId>/driver/diag                  ProcDriverDiagFile
- *   /proc/<ProcId>/device                       ProcDeviceDir
- *   /proc/<ProcId>/device/0                     procDevicexDir
- *   /proc/<ProcId>/device/0/diag                procDevicexDiagFile
- */
-
-
-static ssize_t proc_write_device(struct file *file, const char __user *buffer,
-				 size_t count, loff_t *ppos);
-static ssize_t proc_write_driver(struct file *file, const char __user *buffer,
-				 size_t count, loff_t *ppos);
-
-static struct proc_dir_entry *
-	createProcDir(char *name, struct proc_dir_entry *parent)
-{
-	struct proc_dir_entry *p = proc_mkdir_mode(name, S_IFDIR, parent);
-	return p;
-}
-
-static int seq_show_driver(struct seq_file *seq, void *offset);
-static int proc_open_driver(struct inode *inode, struct file *file)
-{
-	return single_open(file, seq_show_driver, PDE_DATA(inode));
-}
-static const struct file_operations proc_fops_driver = {
-	.open = proc_open_driver,
-	.read = seq_read,
-	.write = proc_write_driver,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
-
-static int seq_show_device(struct seq_file *seq, void *offset);
-static int seq_show_device_property(struct seq_file *seq, void *offset);
-static int proc_open_device(struct inode *inode, struct file *file)
-{
-	return single_open(file, seq_show_device, PDE_DATA(inode));
-}
-static const struct file_operations proc_fops_device = {
-	.open = proc_open_device,
-	.read = seq_read,
-	.write = proc_write_device,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
-static int proc_open_device_property(struct inode *inode, struct file *file)
-{
-	return single_open(file, seq_show_device_property, PDE_DATA(inode));
-}
-static const struct file_operations proc_fops_device_property = {
-	.open = proc_open_device_property,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
-
-
-
-void visor_easyproc_InitDriver(struct easyproc_driver_info *pdriver,
-			       char *procId,
-			       void (*show_driver_info)(struct seq_file *),
-			       void (*show_device_info)(struct seq_file *,
-							void *))
-{
-	memset(pdriver, 0, sizeof(struct easyproc_driver_info));
-	pdriver->ProcId = procId;
-	pdriver->Show_driver_info = show_driver_info;
-	pdriver->Show_device_info = show_device_info;
-	if (pdriver->ProcDir == NULL)
-		pdriver->ProcDir = createProcDir(pdriver->ProcId, NULL);
-	if ((pdriver->ProcDir != NULL) && (pdriver->ProcDriverDir == NULL))
-		pdriver->ProcDriverDir = createProcDir("driver",
-						       pdriver->ProcDir);
-	if ((pdriver->ProcDir != NULL) && (pdriver->ProcDeviceDir == NULL))
-		pdriver->ProcDeviceDir = createProcDir("device",
-						       pdriver->ProcDir);
-	if ((pdriver->ProcDriverDir != NULL) &&
-	    (pdriver->ProcDriverDiagFile == NULL)) {
-		pdriver->ProcDriverDiagFile =
-			proc_create_data("diag", 0,
-					 pdriver->ProcDriverDir,
-					 &proc_fops_driver, pdriver);
-	}
-}
-EXPORT_SYMBOL_GPL(visor_easyproc_InitDriver);
-
-
-
-void visor_easyproc_InitDriverEx(struct easyproc_driver_info *pdriver,
-				 char *procId,
-				 void (*show_driver_info)(struct seq_file *),
-				 void (*show_device_info)(struct seq_file *,
-							  void *),
-				 void (*write_driver_info)(char *buf,
-							   size_t count,
-							   loff_t *ppos),
-				 void (*write_device_info)(char *buf,
-							   size_t count,
-							   loff_t *ppos,
-							   void *p))
-{
-	visor_easyproc_InitDriver(pdriver, procId,
-				  show_driver_info, show_device_info);
-	pdriver->Write_driver_info = write_driver_info;
-	pdriver->Write_device_info = write_device_info;
-}
-EXPORT_SYMBOL_GPL(visor_easyproc_InitDriverEx);
-
-
-
-void visor_easyproc_DeInitDriver(struct easyproc_driver_info *pdriver)
-{
-	if (pdriver->ProcDriverDiagFile != NULL) {
-		remove_proc_entry("diag", pdriver->ProcDriverDir);
-		pdriver->ProcDriverDiagFile = NULL;
-	}
-	if (pdriver->ProcDriverDir != NULL) {
-		remove_proc_entry("driver", pdriver->ProcDir);
-		pdriver->ProcDriverDir = NULL;
-	}
-	if (pdriver->ProcDeviceDir != NULL) {
-		remove_proc_entry("device", pdriver->ProcDir);
-		pdriver->ProcDeviceDir = NULL;
-	}
-	if (pdriver->ProcDir != NULL) {
-		remove_proc_entry(pdriver->ProcId, NULL);
-		pdriver->ProcDir = NULL;
-	}
-	pdriver->ProcId = NULL;
-	pdriver->Show_driver_info = NULL;
-	pdriver->Show_device_info = NULL;
-	pdriver->Write_driver_info = NULL;
-	pdriver->Write_device_info = NULL;
-}
-EXPORT_SYMBOL_GPL(visor_easyproc_DeInitDriver);
-
-
-
-void visor_easyproc_InitDevice(struct easyproc_driver_info *pdriver,
-			       struct easyproc_device_info *p, int devno,
-			       void *devdata)
-{
-	if ((pdriver->ProcDeviceDir != NULL) && (p->procDevicexDir == NULL)) {
-		char s[29];
-
-		sprintf(s, "%d", devno);
-		p->procDevicexDir = createProcDir(s, pdriver->ProcDeviceDir);
-		p->devno = devno;
-	}
-	p->devdata = devdata;
-	p->pdriver = pdriver;
-	p->devno = devno;
-	if ((p->procDevicexDir != NULL) && (p->procDevicexDiagFile == NULL)) {
-		p->procDevicexDiagFile =
-			proc_create_data("diag", 0, p->procDevicexDir,
-					 &proc_fops_device, p);
-	}
-	memset(&(p->device_property_info[0]), 0,
-	       sizeof(p->device_property_info));
-}
-EXPORT_SYMBOL_GPL(visor_easyproc_InitDevice);
-
-
-
-void visor_easyproc_CreateDeviceProperty(struct easyproc_device_info *p,
-					 void (*show_property_info)
-					 (struct seq_file *, void *),
-					 char *property_name)
-{
-	size_t i;
-	struct easyproc_device_property_info *px = NULL;
-
-	if (p->procDevicexDir == NULL)
-		return;
-	for (i = 0; i < ARRAY_SIZE(p->device_property_info); i++) {
-		if (p->device_property_info[i].procEntry == NULL) {
-			px = &(p->device_property_info[i]);
-			break;
-		}
-	}
-	if (!px)
-		return;
-
-	px->devdata = p->devdata;
-	px->pdriver = p->pdriver;
-	px->procEntry = proc_create_data(property_name, 0, p->procDevicexDir,
-					 &proc_fops_device_property, px);
-	if (strlen(property_name)+1 > sizeof(px->property_name)) {
-		return;
-	}
-	strcpy(px->property_name, property_name);
-	if (px->procEntry == NULL) {
-		return;
-	}
-	px->show_device_property_info = show_property_info;
-}
-EXPORT_SYMBOL_GPL(visor_easyproc_CreateDeviceProperty);
-
-
-
-void visor_easyproc_DeInitDevice(struct easyproc_driver_info *pdriver,
-				 struct easyproc_device_info *p, int devno)
-{
-	size_t i;
-
-	for (i = 0; i < ARRAY_SIZE(p->device_property_info); i++) {
-		if (p->device_property_info[i].procEntry != NULL) {
-			struct easyproc_device_property_info *px =
-				&(p->device_property_info[i]);
-			remove_proc_entry(px->property_name, p->procDevicexDir);
-			px->procEntry = NULL;
-		}
-	}
-	if (p->procDevicexDiagFile != NULL) {
-		remove_proc_entry("diag", p->procDevicexDir);
-		p->procDevicexDiagFile = NULL;
-	}
-	if (p->procDevicexDir != NULL) {
-		char s[29];
-
-		sprintf(s, "%d", devno);
-		remove_proc_entry(s, pdriver->ProcDeviceDir);
-		p->procDevicexDir = NULL;
-	}
-	p->devdata = NULL;
-	p->pdriver = NULL;
-}
-EXPORT_SYMBOL_GPL(visor_easyproc_DeInitDevice);
-
-
-
-static int seq_show_driver(struct seq_file *seq, void *offset)
-{
-	struct easyproc_driver_info *p =
-		(struct easyproc_driver_info *)(seq->private);
-	if (!p)
-		return 0;
-	(*(p->Show_driver_info))(seq);
-	return 0;
-}
-
-
-
-static int seq_show_device(struct seq_file *seq, void *offset)
-{
-	struct easyproc_device_info *p =
-		(struct easyproc_device_info *)(seq->private);
-	if ((!p) || (!(p->pdriver)))
-		return 0;
-	(*(p->pdriver->Show_device_info))(seq, p->devdata);
-	return 0;
-}
-
-
-
-static int seq_show_device_property(struct seq_file *seq, void *offset)
-{
-	struct easyproc_device_property_info *p =
-		(struct easyproc_device_property_info *)(seq->private);
-	if ((!p) || (!(p->show_device_property_info)))
-		return 0;
-	(*(p->show_device_property_info))(seq, p->devdata);
-	return 0;
-}
-
-
-
-static ssize_t proc_write_driver(struct file *file, const char __user *buffer,
-				 size_t count, loff_t *ppos)
-{
-	struct seq_file *seq = (struct seq_file *)file->private_data;
-	struct easyproc_driver_info *p = NULL;
-	char local_buf[256];
-
-	if (seq == NULL)
-		return 0;
-	p = (struct easyproc_driver_info *)(seq->private);
-	if ((!p) || (!(p->Write_driver_info)))
-		return 0;
-	if (count >= sizeof(local_buf))
-		return -ENOMEM;
-	if (copy_from_user(local_buf, buffer, count))
-		return -EFAULT;
-	local_buf[count] = '\0';  /* be friendly */
-	(*(p->Write_driver_info))(local_buf, count, ppos);
-	return count;
-}
-
-
-
-static ssize_t proc_write_device(struct file *file, const char __user *buffer,
-				 size_t count, loff_t *ppos)
-{
-	struct seq_file *seq = (struct seq_file *)file->private_data;
-	struct easyproc_device_info *p = NULL;
-	char local_buf[256];
-
-	if (seq == NULL)
-		return 0;
-	p = (struct easyproc_device_info *)(seq->private);
-	if ((!p) || (!(p->pdriver)) || (!(p->pdriver->Write_device_info)))
-		return 0;
-	if (count >= sizeof(local_buf))
-		return -ENOMEM;
-	if (copy_from_user(local_buf, buffer, count))
-		return -EFAULT;
-	local_buf[count] = '\0';  /* be friendly */
-	(*(p->pdriver->Write_device_info))(local_buf, count, ppos, p->devdata);
-	return count;
-}
diff --git a/drivers/staging/unisys/visorutil/easyproc.h b/drivers/staging/unisys/visorutil/easyproc.h
deleted file mode 100644
index 6ce7d5e..0000000
--- a/drivers/staging/unisys/visorutil/easyproc.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* easyproc.h
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-/** @file *********************************************************************
- *
- *  This describes the interfaces necessary for a simple /proc file
- *  implementation for a driver.
- *
- ******************************************************************************
- */
-
-#ifndef __EASYPROC_H__
-#define __EASYPROC_H__
-
-#include "timskmod.h"
-
-
-struct easyproc_driver_info {
-	struct proc_dir_entry *ProcDir;
-	struct proc_dir_entry *ProcDriverDir;
-	struct proc_dir_entry *ProcDriverDiagFile;
-	struct proc_dir_entry *ProcDeviceDir;
-	char *ProcId;
-	void (*Show_device_info)(struct seq_file *seq, void *p);
-	void (*Show_driver_info)(struct seq_file *seq);
-	void (*Write_device_info)(char *buf, size_t count,
-				  loff_t *ppos, void *p);
-	void (*Write_driver_info)(char *buf, size_t count, loff_t *ppos);
-};
-
-/* property is a file under /proc/<x>/device/<x>/<property_name> */
-struct easyproc_device_property_info {
-	char property_name[25];
-	struct proc_dir_entry *procEntry;
-	struct easyproc_driver_info *pdriver;
-	void *devdata;
-	void (*show_device_property_info)(struct seq_file *seq, void *p);
-};
-
-struct easyproc_device_info {
-	struct proc_dir_entry *procDevicexDir;
-	struct proc_dir_entry *procDevicexDiagFile;
-	struct easyproc_driver_info *pdriver;
-	void *devdata;
-	int devno;
-	/*  allow for a number of custom properties for each device: */
-	struct easyproc_device_property_info device_property_info[10];
-};
-
-void visor_easyproc_InitDevice(struct easyproc_driver_info *pdriver,
-			       struct easyproc_device_info *p, int devno,
-			       void *devdata);
-void visor_easyproc_DeInitDevice(struct easyproc_driver_info *pdriver,
-				 struct easyproc_device_info *p, int devno);
-void visor_easyproc_InitDriver(struct easyproc_driver_info *pdriver,
-			       char *procId,
-			       void (*show_driver_info)(struct seq_file *),
-			       void (*show_device_info)(struct seq_file *,
-							void *));
-void visor_easyproc_InitDriverEx(struct easyproc_driver_info *pdriver,
-				 char *procId,
-				 void (*show_driver_info)(struct seq_file *),
-				 void (*show_device_info)(struct seq_file *,
-							  void *),
-				 void (*Write_driver_info)(char *buf,
-							   size_t count,
-							   loff_t *ppos),
-				 void (*Write_device_info)(char *buf,
-							   size_t count,
-							   loff_t *ppos,
-							   void *p));
-void visor_easyproc_DeInitDriver(struct easyproc_driver_info *pdriver);
-void visor_easyproc_CreateDeviceProperty(struct easyproc_device_info *p,
-					 void (*show_property_info)
-					 (struct seq_file *, void *),
-					 char *property_name);
-
-#endif
diff --git a/drivers/staging/unisys/visorutil/procobjecttree.c b/drivers/staging/unisys/visorutil/procobjecttree.c
deleted file mode 100644
index e4e954e..0000000
--- a/drivers/staging/unisys/visorutil/procobjecttree.c
+++ /dev/null
@@ -1,335 +0,0 @@
-/* procobjecttree.c
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-#include "procobjecttree.h"
-
-#define MYDRVNAME "procobjecttree"
-
-
-
-/** This is context info that we stash in each /proc file entry, which we
- *  need in order to call the callback function that supplies the /proc read
- *  info for that file.
- */
-struct proc_dir_entry_context {
-	void (*show_property)(struct seq_file *, void *, int);
-	MYPROCOBJECT *procObject;
-	int propertyIndex;
-
-};
-
-/** This describes the attributes of a tree rooted at
- *  <procDirRoot>/<name[0]>/<name[1]>/...
- *  Properties for each object of this type will be located under
- *  <procDirRoot>/<name[0]>/<name[1]>/.../<objectName>/<propertyName>.
- */
-struct MYPROCTYPE_Tag {
-	const char **name;  /**< node names for this type, ending with NULL */
-	int nNames;         /**< num of node names in <name> */
-
-	/** root dir for this type tree in /proc */
-	struct proc_dir_entry *procDirRoot;
-
-	struct proc_dir_entry **procDirs;  /**< for each node in <name> */
-
-	/** bottom dir where objects will be rooted; i.e., this is
-	 *  <procDirRoot>/<name[0]>/<name[1]>/.../, which is the same as the
-	 *  last entry in the <procDirs> array. */
-	struct proc_dir_entry *procDir;
-
-	/** name for each property that objects of this type can have */
-	const char **propertyNames;
-
-	int nProperties;       /**< num of names in <propertyNames> */
-
-	/** Call this, passing MYPROCOBJECT.context and the property index
-	 *  whenever someone reads the proc entry */
-	void (*show_property)(struct seq_file *, void *, int);
-};
-
-
-
-struct MYPROCOBJECT_Tag {
-	MYPROCTYPE *type;
-
-	/** This is the name of the dir node in /proc under which the
-	 *  properties of this object will appear as files. */
-	char *name;
-
-	int namesize;   /**< number of bytes allocated for name */
-	void *context;  /**< passed to MYPROCTYPE.show_property */
-
-	/** <type.procDirRoot>/<type.name[0]>/<type.name[1]>/.../<name> */
-	struct proc_dir_entry *procDir;
-
-	/** a proc dir entry for each of the properties of the object;
-	 *  properties are identified in MYPROCTYPE.propertyNames, so each of
-	 *  the <procDirProperties> describes a single file like
-	 *  <type.procDirRoot>/<type.name[0]>/<type.name[1]>/...
-	 *           /<name>/<propertyName>
-	 */
-	struct proc_dir_entry **procDirProperties;
-
-	/** this is a holding area for the context information that is needed
-	 *  to run the /proc callback function */
-	struct proc_dir_entry_context *procDirPropertyContexts;
-};
-
-
-
-static struct proc_dir_entry *
-createProcDir(const char *name, struct proc_dir_entry *parent)
-{
-	struct proc_dir_entry *p = proc_mkdir_mode(name, S_IFDIR, parent);
-
-	return p;
-}
-
-static struct proc_dir_entry *
-createProcFile(const char *name, struct proc_dir_entry *parent,
-	       const struct file_operations *fops, void *data)
-{
-	struct proc_dir_entry *p = proc_create_data(name, 0, parent,
-						    fops, data);
-	return p;
-}
-
-static int seq_show(struct seq_file *seq, void *offset);
-static int proc_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, seq_show, PDE_DATA(inode));
-}
-
-static const struct file_operations proc_fops = {
-	.open = proc_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
-
-
-
-MYPROCTYPE *visor_proc_CreateType(struct proc_dir_entry *procDirRoot,
-				  const char **name,
-				  const char **propertyNames,
-				  void (*show_property)(struct seq_file *,
-							void *, int))
-{
-	int i = 0;
-	MYPROCTYPE *rc = NULL, *type = NULL;
-	struct proc_dir_entry *parent = NULL;
-
-	if (procDirRoot == NULL)
-		goto Away;
-
-	if (name == NULL || name[0] == NULL)
-		goto Away;
-
-	type = kzalloc(sizeof(MYPROCTYPE), GFP_KERNEL | __GFP_NORETRY);
-	if (type == NULL)
-		goto Away;
-
-	type->name = name;
-	type->propertyNames = propertyNames;
-	type->nProperties = 0;
-	type->nNames = 0;
-	type->show_property = show_property;
-	type->procDirRoot = procDirRoot;
-	if (type->propertyNames != NULL)
-		while (type->propertyNames[type->nProperties] != NULL)
-			type->nProperties++;
-	while (type->name[type->nNames] != NULL)
-		type->nNames++;
-	type->procDirs = kcalloc((type->nNames + 1),
-				 sizeof(struct proc_dir_entry *),
-				 GFP_KERNEL | __GFP_NORETRY);
-	if (type->procDirs == NULL)
-		goto Away;
-	parent = procDirRoot;
-	for (i = 0; i < type->nNames; i++) {
-		type->procDirs[i] = createProcDir(type->name[i], parent);
-		if (type->procDirs[i] == NULL) {
-			rc = NULL;
-			goto Away;
-		}
-		parent = type->procDirs[i];
-	}
-	type->procDir = type->procDirs[type->nNames-1];
-	rc = type;
-Away:
-	if (rc == NULL) {
-		if (type != NULL) {
-			visor_proc_DestroyType(type);
-			type = NULL;
-		}
-	}
-	return rc;
-}
-EXPORT_SYMBOL_GPL(visor_proc_CreateType);
-
-
-
-void visor_proc_DestroyType(MYPROCTYPE *type)
-{
-	if (type == NULL)
-		return;
-	if (type->procDirs != NULL) {
-		int i = type->nNames-1;
-
-		while (i >= 0) {
-			if (type->procDirs[i] != NULL) {
-				struct proc_dir_entry *parent = NULL;
-
-				if (i == 0)
-					parent = type->procDirRoot;
-				else
-					parent = type->procDirs[i-1];
-				remove_proc_entry(type->name[i], parent);
-			}
-			i--;
-		}
-		kfree(type->procDirs);
-		type->procDirs = NULL;
-	}
-	kfree(type);
-}
-EXPORT_SYMBOL_GPL(visor_proc_DestroyType);
-
-
-
-MYPROCOBJECT *visor_proc_CreateObject(MYPROCTYPE *type,
-				      const char *name, void *context)
-{
-	MYPROCOBJECT *obj = NULL, *rc = NULL;
-	int i = 0;
-
-	if (type == NULL)
-		goto Away;
-
-	obj = kzalloc(sizeof(MYPROCOBJECT), GFP_KERNEL | __GFP_NORETRY);
-	if (obj == NULL)
-		goto Away;
-
-	obj->type = type;
-	obj->context = context;
-	if (name == NULL) {
-		obj->name = NULL;
-		obj->procDir = type->procDir;
-	} else {
-		obj->namesize = strlen(name)+1;
-		obj->name = kmalloc(obj->namesize, GFP_KERNEL | __GFP_NORETRY);
-		if (obj->name == NULL) {
-			obj->namesize = 0;
-			goto Away;
-		}
-		strcpy(obj->name, name);
-		obj->procDir = createProcDir(obj->name, type->procDir);
-		if (obj->procDir == NULL)
-			goto Away;
-	}
-	obj->procDirPropertyContexts =
-		kcalloc((type->nProperties + 1),
-			sizeof(struct proc_dir_entry_context),
-			GFP_KERNEL | __GFP_NORETRY);
-	if (obj->procDirPropertyContexts == NULL)
-		goto Away;
-	obj->procDirProperties = kcalloc((type->nProperties + 1),
-					 sizeof(struct proc_dir_entry *),
-					 GFP_KERNEL | __GFP_NORETRY);
-	if (obj->procDirProperties == NULL)
-		goto Away;
-	for (i = 0; i < type->nProperties; i++) {
-		obj->procDirPropertyContexts[i].procObject = obj;
-		obj->procDirPropertyContexts[i].propertyIndex = i;
-		obj->procDirPropertyContexts[i].show_property =
-			type->show_property;
-		if (type->propertyNames[i][0] != '\0') {
-			/* only create properties that have names */
-			obj->procDirProperties[i] =
-				createProcFile(type->propertyNames[i],
-					obj->procDir, &proc_fops,
-					&obj->procDirPropertyContexts[i]);
-			if (obj->procDirProperties[i] == NULL) {
-				rc = NULL;
-				goto Away;
-			}
-		}
-	}
-	rc = obj;
-Away:
-	if (rc == NULL) {
-		if (obj != NULL) {
-			visor_proc_DestroyObject(obj);
-			obj = NULL;
-		}
-	}
-	return rc;
-}
-EXPORT_SYMBOL_GPL(visor_proc_CreateObject);
-
-
-
-void visor_proc_DestroyObject(MYPROCOBJECT *obj)
-{
-	MYPROCTYPE *type = NULL;
-
-	if (obj == NULL)
-		return;
-	type = obj->type;
-	if (type == NULL)
-		return;
-	if (obj->procDirProperties != NULL) {
-		int i = 0;
-
-		for (i = 0; i < type->nProperties; i++) {
-			if (obj->procDirProperties[i] != NULL) {
-				remove_proc_entry(type->propertyNames[i],
-						  obj->procDir);
-				obj->procDirProperties[i] = NULL;
-			}
-		}
-		kfree(obj->procDirProperties);
-		obj->procDirProperties = NULL;
-	}
-
-	kfree(obj->procDirPropertyContexts);
-	obj->procDirPropertyContexts = NULL;
-
-	if (obj->procDir != NULL) {
-		if (obj->name != NULL)
-			remove_proc_entry(obj->name, type->procDir);
-		obj->procDir = NULL;
-	}
-
-	kfree(obj->name);
-	obj->name = NULL;
-	kfree(obj);
-}
-EXPORT_SYMBOL_GPL(visor_proc_DestroyObject);
-
-
-
-static int seq_show(struct seq_file *seq, void *offset)
-{
-	struct proc_dir_entry_context *ctx = seq->private;
-
-	if (ctx == NULL)
-		return 0;
-	(*ctx->show_property)(seq, ctx->procObject->context,
-			      ctx->propertyIndex);
-	return 0;
-}
-- 
2.1.0

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

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

* [PATCH 55/69] staging: unisys: fix CamelCased ControlVM globals
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (53 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 54/69] staging: unisys: remove last remnants of proc entry code Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 56/69] staging: unisys: fix CamelCase in putfile-related globals Benjamin Romer
                   ` (13 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase global names:

ControlVm_Pending_Msg => controlvm_pending_msg
ControlVm_Pending_Msg_Valid => controlvm_pending_msg_valid

Update all references to use the corrected names.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index f4309b3..670ac5b 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -125,8 +125,8 @@ static struct livedump_info {
  * this scenario, we simply stash the controlvm message, then attempt to
  * process it again the next time controlvm_periodic_work() runs.
  */
-static struct controlvm_message ControlVm_Pending_Msg;
-static BOOL ControlVm_Pending_Msg_Valid = FALSE;
+static struct controlvm_message controlvm_pending_msg;
+static BOOL controlvm_pending_msg_valid = FALSE;
 
 /* Pool of struct putfile_buffer_entry, for keeping track of pending (incoming)
  * TRANSMIT_FILE PutFile payloads.
@@ -1791,13 +1791,13 @@ controlvm_periodic_work(struct work_struct *work)
 					 &inmsg))
 		;
 	if (!got_command) {
-		if (ControlVm_Pending_Msg_Valid) {
+		if (controlvm_pending_msg_valid) {
 			/* we throttled processing of a prior
 			* msg, so try to process it again
 			* rather than reading a new one
 			*/
-			inmsg = ControlVm_Pending_Msg;
-			ControlVm_Pending_Msg_Valid = FALSE;
+			inmsg = controlvm_pending_msg;
+			controlvm_pending_msg_valid = FALSE;
 			got_command = true;
 		} else {
 			got_command = read_controlvm_event(&inmsg);
@@ -1819,8 +1819,8 @@ controlvm_periodic_work(struct work_struct *work)
 			* reprocess it on our next loop
 			*/
 			handle_command_failed = TRUE;
-			ControlVm_Pending_Msg = inmsg;
-			ControlVm_Pending_Msg_Valid = TRUE;
+			controlvm_pending_msg = inmsg;
+			controlvm_pending_msg_valid = TRUE;
 		}
 	}
 
-- 
2.1.0

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

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

* [PATCH 56/69] staging: unisys: fix CamelCase in putfile-related globals
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (54 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 55/69] staging: unisys: fix CamelCased ControlVM globals Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 57/69] staging: unisys: fix CamelCase global Visorchipset_cache_buffers_in_use Benjamin Romer
                   ` (12 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase global names:

Putfile_buffer_list_pool => putfile_buffer_list_pool
Putfile_buffer_list_pool_name => putfile_buffer_list_pool_name
Putfile_request_list => putfile_request_list

Update all references to use the corrected names.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../staging/unisys/visorchipset/visorchipset_main.c    | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 670ac5b..0b09102 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -131,8 +131,8 @@ static BOOL controlvm_pending_msg_valid = FALSE;
 /* Pool of struct putfile_buffer_entry, for keeping track of pending (incoming)
  * TRANSMIT_FILE PutFile payloads.
  */
-static struct kmem_cache *Putfile_buffer_list_pool;
-static const char Putfile_buffer_list_pool_name[] =
+static struct kmem_cache *putfile_buffer_list_pool;
+static const char putfile_buffer_list_pool_name[] =
 	"controlvm_putfile_buffer_list_pool";
 
 /* This identifies a data buffer that has been received via a controlvm messages
@@ -147,7 +147,7 @@ struct putfile_buffer_entry {
  * Each entry in this list identifies an outstanding TRANSMIT_FILE
  * conversation.
  */
-static LIST_HEAD(Putfile_request_list);
+static LIST_HEAD(putfile_request_list);
 
 /* This describes a buffer and its current state of transfer (e.g., how many
  * bytes have already been supplied as putfile data, and how many bytes are
@@ -2185,11 +2185,11 @@ visorchipset_init(void)
 
 	memset(&g_del_dump_msg_hdr, 0, sizeof(struct controlvm_message_header));
 
-	Putfile_buffer_list_pool =
-	    kmem_cache_create(Putfile_buffer_list_pool_name,
+	putfile_buffer_list_pool =
+	    kmem_cache_create(putfile_buffer_list_pool_name,
 			      sizeof(struct putfile_buffer_entry),
 			      0, SLAB_HWCACHE_ALIGN, NULL);
-	if (!Putfile_buffer_list_pool) {
+	if (!putfile_buffer_list_pool) {
 		POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
 		rc = -1;
 		goto cleanup;
@@ -2252,9 +2252,9 @@ visorchipset_exit(void)
 		periodic_controlvm_workqueue = NULL;
 		destroy_controlvm_payload_info(&controlvm_payload_info);
 	}
-	if (Putfile_buffer_list_pool) {
-		kmem_cache_destroy(Putfile_buffer_list_pool);
-		Putfile_buffer_list_pool = NULL;
+	if (putfile_buffer_list_pool) {
+		kmem_cache_destroy(putfile_buffer_list_pool);
+		putfile_buffer_list_pool = NULL;
 	}
 
 	cleanup_controlvm_structures();
-- 
2.1.0

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

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

* [PATCH 57/69] staging: unisys: fix CamelCase global Visorchipset_cache_buffers_in_use
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (55 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 56/69] staging: unisys: fix CamelCase in putfile-related globals Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 58/69] staging: unisys: fix CamelCased Parahotplug globals Benjamin Romer
                   ` (11 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Rename this variable:

Visorchipset_cache_buffers_in_use => visorchipset_cache_buffers_in_use

Update all references to use the fixed name.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 0b09102..cea62fd 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -203,7 +203,7 @@ struct putfile_request {
 	int completion_status;
 };
 
-static atomic_t Visorchipset_cache_buffers_in_use = ATOMIC_INIT(0);
+static atomic_t visorchipset_cache_buffers_in_use = ATOMIC_INIT(0);
 
 struct parahotplug_request {
 	struct list_head list;
@@ -2066,7 +2066,7 @@ visorchipset_cache_alloc(struct kmem_cache *pool, BOOL ok_to_block,
 	if (!p)
 		return NULL;
 
-	atomic_inc(&Visorchipset_cache_buffers_in_use);
+	atomic_inc(&visorchipset_cache_buffers_in_use);
 	return p;
 }
 
@@ -2078,7 +2078,7 @@ visorchipset_cache_free(struct kmem_cache *pool, void *p, char *fn, int ln)
 	if (!p)
 		return;
 
-	atomic_dec(&Visorchipset_cache_buffers_in_use);
+	atomic_dec(&visorchipset_cache_buffers_in_use);
 	kmem_cache_free(pool, p);
 }
 
-- 
2.1.0

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

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

* [PATCH 58/69] staging: unisys: fix CamelCased Parahotplug globals
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (56 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 57/69] staging: unisys: fix CamelCase global Visorchipset_cache_buffers_in_use Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 59/69] staging: unisys: fix CamelCased notifier globals Benjamin Romer
                   ` (10 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase names:

Parahotplug_request_list => parahotplug_request_list
Parahotplug_request_list_lock => parahotplug_request_list_lock

Update references to use the corrected names.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index cea62fd..4dba816 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -212,8 +212,8 @@ struct parahotplug_request {
 	struct controlvm_message msg;
 };
 
-static LIST_HEAD(Parahotplug_request_list);
-static DEFINE_SPINLOCK(Parahotplug_request_list_lock);	/* lock for above */
+static LIST_HEAD(parahotplug_request_list);
+static DEFINE_SPINLOCK(parahotplug_request_list_lock);	/* lock for above */
 static void parahotplug_process_list(void);
 
 /* Manages the info for a CONTROLVM_DUMP_CAPTURESTATE /
@@ -1530,9 +1530,9 @@ parahotplug_process_list(void)
 	struct list_head *pos = NULL;
 	struct list_head *tmp = NULL;
 
-	spin_lock(&Parahotplug_request_list_lock);
+	spin_lock(&parahotplug_request_list_lock);
 
-	list_for_each_safe(pos, tmp, &Parahotplug_request_list) {
+	list_for_each_safe(pos, tmp, &parahotplug_request_list) {
 		struct parahotplug_request *req =
 		    list_entry(pos, struct parahotplug_request, list);
 
@@ -1548,7 +1548,7 @@ parahotplug_process_list(void)
 		parahotplug_request_destroy(req);
 	}
 
-	spin_unlock(&Parahotplug_request_list_lock);
+	spin_unlock(&parahotplug_request_list_lock);
 }
 
 /*
@@ -1562,10 +1562,10 @@ parahotplug_request_complete(int id, u16 active)
 	struct list_head *pos = NULL;
 	struct list_head *tmp = NULL;
 
-	spin_lock(&Parahotplug_request_list_lock);
+	spin_lock(&parahotplug_request_list_lock);
 
 	/* Look for a request matching "id". */
-	list_for_each_safe(pos, tmp, &Parahotplug_request_list) {
+	list_for_each_safe(pos, tmp, &parahotplug_request_list) {
 		struct parahotplug_request *req =
 		    list_entry(pos, struct parahotplug_request, list);
 		if (req->id == id) {
@@ -1573,7 +1573,7 @@ parahotplug_request_complete(int id, u16 active)
 			 * respond.
 			 */
 			list_del(pos);
-			spin_unlock(&Parahotplug_request_list_lock);
+			spin_unlock(&parahotplug_request_list_lock);
 			req->msg.cmd.device_change_state.state.active = active;
 			if (req->msg.hdr.flags.response_expected)
 				controlvm_respond_physdev_changestate(
@@ -1584,7 +1584,7 @@ parahotplug_request_complete(int id, u16 active)
 		}
 	}
 
-	spin_unlock(&Parahotplug_request_list_lock);
+	spin_unlock(&parahotplug_request_list_lock);
 	return -1;
 }
 
@@ -1622,9 +1622,9 @@ parahotplug_process_message(struct controlvm_message *inmsg)
 		* won't get responded to until the script has
 		* indicated it's done.
 		*/
-		spin_lock(&Parahotplug_request_list_lock);
-		list_add_tail(&req->list, &Parahotplug_request_list);
-		spin_unlock(&Parahotplug_request_list_lock);
+		spin_lock(&parahotplug_request_list_lock);
+		list_add_tail(&req->list, &parahotplug_request_list);
+		spin_unlock(&parahotplug_request_list_lock);
 
 		parahotplug_request_kickoff(req);
 	}
-- 
2.1.0

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

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

* [PATCH 59/69] staging: unisys: fix CamelCased notifier globals
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (57 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 58/69] staging: unisys: fix CamelCased Parahotplug globals Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 60/69] staging: unisys: fix CamelCase in responders functions Benjamin Romer
                   ` (9 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix these CamelCased names:

BusDev_Server_Notifiers => busdev_server_notifiers
BusDev_Client_Notifiers => busdev_client_notifiers

Update references to use the fixed names.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 40 +++++++++++-----------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 4dba816..4314b80 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -219,8 +219,8 @@ static void parahotplug_process_list(void);
 /* Manages the info for a CONTROLVM_DUMP_CAPTURESTATE /
  * CONTROLVM_REPORTEVENT.
  */
-static struct visorchipset_busdev_notifiers BusDev_Server_Notifiers;
-static struct visorchipset_busdev_notifiers BusDev_Client_Notifiers;
+static struct visorchipset_busdev_notifiers busdev_server_notifiers;
+static struct visorchipset_busdev_notifiers busdev_client_notifiers;
 
 static void bus_create_response(ulong busNo, int response);
 static void bus_destroy_response(ulong busNo, int response);
@@ -551,11 +551,11 @@ visorchipset_register_busdev_server(
 {
 	down(&notifier_lock);
 	if (!notifiers) {
-		memset(&BusDev_Server_Notifiers, 0,
-		       sizeof(BusDev_Server_Notifiers));
+		memset(&busdev_server_notifiers, 0,
+		       sizeof(busdev_server_notifiers));
 		serverregistered = 0;	/* clear flag */
 	} else {
-		BusDev_Server_Notifiers = *notifiers;
+		busdev_server_notifiers = *notifiers;
 		serverregistered = 1;	/* set flag */
 	}
 	if (responders)
@@ -576,11 +576,11 @@ visorchipset_register_busdev_client(
 {
 	down(&notifier_lock);
 	if (!notifiers) {
-		memset(&BusDev_Client_Notifiers, 0,
-		       sizeof(BusDev_Client_Notifiers));
+		memset(&busdev_client_notifiers, 0,
+		       sizeof(busdev_client_notifiers));
 		clientregistered = 0;	/* clear flag */
 	} else {
-		BusDev_Client_Notifiers = *notifiers;
+		busdev_client_notifiers = *notifiers;
 		clientregistered = 1;	/* set flag */
 	}
 	if (responders)
@@ -893,24 +893,24 @@ bus_epilog(u32 bus_no,
 			* either server or client devices
 			* - BusDev_Client can handle ONLY client
 			* devices */
-			if (BusDev_Server_Notifiers.bus_create) {
-				(*BusDev_Server_Notifiers.bus_create) (bus_no);
+			if (busdev_server_notifiers.bus_create) {
+				(*busdev_server_notifiers.bus_create) (bus_no);
 				notified = TRUE;
 			}
 			if ((!bus_info->flags.server) /*client */ &&
-			    BusDev_Client_Notifiers.bus_create) {
-				(*BusDev_Client_Notifiers.bus_create) (bus_no);
+			    busdev_client_notifiers.bus_create) {
+				(*busdev_client_notifiers.bus_create) (bus_no);
 				notified = TRUE;
 			}
 			break;
 		case CONTROLVM_BUS_DESTROY:
-			if (BusDev_Server_Notifiers.bus_destroy) {
-				(*BusDev_Server_Notifiers.bus_destroy) (bus_no);
+			if (busdev_server_notifiers.bus_destroy) {
+				(*busdev_server_notifiers.bus_destroy) (bus_no);
 				notified = TRUE;
 			}
 			if ((!bus_info->flags.server) /*client */ &&
-			    BusDev_Client_Notifiers.bus_destroy) {
-				(*BusDev_Client_Notifiers.bus_destroy) (bus_no);
+			    busdev_client_notifiers.bus_destroy) {
+				(*busdev_client_notifiers.bus_destroy) (bus_no);
 				notified = TRUE;
 			}
 			break;
@@ -946,9 +946,9 @@ device_epilog(u32 bus_no, u32 dev_no, struct spar_segment_state state, u32 cmd,
 		return;
 
 	if (for_visorbus)
-		notifiers = &BusDev_Server_Notifiers;
+		notifiers = &busdev_server_notifiers;
 	else
-		notifiers = &BusDev_Client_Notifiers;
+		notifiers = &busdev_client_notifiers;
 	if (need_response) {
 		memcpy(&dev_info->pending_msg_hdr, msg_hdr,
 		       sizeof(struct controlvm_message_header));
@@ -2141,8 +2141,8 @@ visorchipset_init(void)
 	if (!unisys_spar_platform)
 		return -ENODEV;
 
-	memset(&BusDev_Server_Notifiers, 0, sizeof(BusDev_Server_Notifiers));
-	memset(&BusDev_Client_Notifiers, 0, sizeof(BusDev_Client_Notifiers));
+	memset(&busdev_server_notifiers, 0, sizeof(busdev_server_notifiers));
+	memset(&busdev_client_notifiers, 0, sizeof(busdev_client_notifiers));
 	memset(&controlvm_payload_info, 0, sizeof(controlvm_payload_info));
 	memset(&livedump_info, 0, sizeof(livedump_info));
 	atomic_set(&livedump_info.buffers_in_use, 0);
-- 
2.1.0

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

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

* [PATCH 60/69] staging: unisys: fix CamelCase in responders functions
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (58 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 59/69] staging: unisys: fix CamelCased notifier globals Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 61/69] staging: unisys: fix CamelCased global MajorDev Benjamin Romer
                   ` (8 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase parameters:

busNo => bus_no
devNo => dev_no

In the functions bus_create_response(), bus_destroy_response(),
device_create_response(), device_destroy_response(), and
device_resume_response().

Fix the CamelCase global structure name

BusDev_Responders => busdev_responders

And update all references to use the corrected names.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 36 +++++++++++-----------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 4314b80..2530389 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -222,13 +222,13 @@ static void parahotplug_process_list(void);
 static struct visorchipset_busdev_notifiers busdev_server_notifiers;
 static struct visorchipset_busdev_notifiers busdev_client_notifiers;
 
-static void bus_create_response(ulong busNo, int response);
-static void bus_destroy_response(ulong busNo, int response);
-static void device_create_response(ulong busNo, ulong devNo, int response);
-static void device_destroy_response(ulong busNo, ulong devNo, int response);
-static void device_resume_response(ulong busNo, ulong devNo, int response);
+static void bus_create_response(ulong bus_no, int response);
+static void bus_destroy_response(ulong bus_no, int response);
+static void device_create_response(ulong bus_no, ulong dev_no, int response);
+static void device_destroy_response(ulong bus_no, ulong dev_no, int response);
+static void device_resume_response(ulong bus_no, ulong dev_no, int response);
 
-static struct visorchipset_busdev_responders BusDev_Responders = {
+static struct visorchipset_busdev_responders busdev_responders = {
 	.bus_create = bus_create_response,
 	.bus_destroy = bus_destroy_response,
 	.device_create = device_create_response,
@@ -559,7 +559,7 @@ visorchipset_register_busdev_server(
 		serverregistered = 1;	/* set flag */
 	}
 	if (responders)
-		*responders = BusDev_Responders;
+		*responders = busdev_responders;
 	if (driver_info)
 		bus_device_info_init(driver_info, "chipset", "visorchipset",
 				   VERSION, NULL);
@@ -584,7 +584,7 @@ visorchipset_register_busdev_client(
 		clientregistered = 1;	/* set flag */
 	}
 	if (responders)
-		*responders = BusDev_Responders;
+		*responders = busdev_responders;
 	if (driver_info)
 		bus_device_info_init(driver_info, "chipset(bolts)",
 				     "visorchipset", VERSION, NULL);
@@ -1951,27 +1951,27 @@ cleanup:
 }
 
 static void
-bus_create_response(ulong busNo, int response)
+bus_create_response(ulong bus_no, int response)
 {
-	bus_responder(CONTROLVM_BUS_CREATE, busNo, response);
+	bus_responder(CONTROLVM_BUS_CREATE, bus_no, response);
 }
 
 static void
-bus_destroy_response(ulong busNo, int response)
+bus_destroy_response(ulong bus_no, int response)
 {
-	bus_responder(CONTROLVM_BUS_DESTROY, busNo, response);
+	bus_responder(CONTROLVM_BUS_DESTROY, bus_no, response);
 }
 
 static void
-device_create_response(ulong busNo, ulong devNo, int response)
+device_create_response(ulong bus_no, ulong dev_no, int response)
 {
-	device_responder(CONTROLVM_DEVICE_CREATE, busNo, devNo, response);
+	device_responder(CONTROLVM_DEVICE_CREATE, bus_no, dev_no, response);
 }
 
 static void
-device_destroy_response(ulong busNo, ulong devNo, int response)
+device_destroy_response(ulong bus_no, ulong dev_no, int response)
 {
-	device_responder(CONTROLVM_DEVICE_DESTROY, busNo, devNo, response);
+	device_responder(CONTROLVM_DEVICE_DESTROY, bus_no, dev_no, response);
 }
 
 void
@@ -1984,10 +1984,10 @@ visorchipset_device_pause_response(ulong bus_no, ulong dev_no, int response)
 EXPORT_SYMBOL_GPL(visorchipset_device_pause_response);
 
 static void
-device_resume_response(ulong busNo, ulong devNo, int response)
+device_resume_response(ulong bus_no, ulong dev_no, int response)
 {
 	device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
-				     busNo, devNo, response,
+				     bus_no, dev_no, response,
 				     segment_state_running);
 }
 
-- 
2.1.0

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

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

* [PATCH 61/69] staging: unisys: fix CamelCased global MajorDev
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (59 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 60/69] staging: unisys: fix CamelCase in responders functions Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 62/69] staging: unisys: fix CamelCase global Visorchipset_platform_device Benjamin Romer
                   ` (7 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Rename the CamelCase global:

MajorDev => major_dev

Update references to use the corrected name.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 2530389..5017c95 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -238,7 +238,7 @@ static struct visorchipset_busdev_responders busdev_responders = {
 };
 
 /* info for /dev/visorchipset */
-static dev_t MajorDev = -1; /**< indicates major num for device */
+static dev_t major_dev = -1; /**< indicates major num for device */
 
 /* prototypes for attributes */
 static ssize_t toolaction_show(struct device *dev,
@@ -2172,8 +2172,8 @@ visorchipset_init(void)
 		return -ENODEV;
 	}
 
-	MajorDev = MKDEV(visorchipset_major, 0);
-	rc = visorchipset_file_init(MajorDev, &controlvm_channel);
+	major_dev = MKDEV(visorchipset_major, 0);
+	rc = visorchipset_file_init(major_dev, &controlvm_channel);
 	if (rc < 0) {
 		POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
 		goto cleanup;
@@ -2222,7 +2222,7 @@ visorchipset_init(void)
 		}
 	}
 
-	Visorchipset_platform_device.dev.devt = MajorDev;
+	Visorchipset_platform_device.dev.devt = major_dev;
 	if (platform_device_register(&Visorchipset_platform_device) < 0) {
 		POSTCODE_LINUX_2(DEVICE_REGISTER_FAILURE_PC, DIAG_SEVERITY_ERR);
 		rc = -1;
-- 
2.1.0

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

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

* [PATCH 62/69] staging: unisys: fix CamelCase global Visorchipset_platform_device
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (60 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 61/69] staging: unisys: fix CamelCased global MajorDev Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 63/69] staging: unisys: fix CamelCase parameter msgHdr in controlvm functions Benjamin Romer
                   ` (6 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Rename the CamelCase variable:

Visorchipset_platform_device => visorchipset_platform_device

Update all references to use the corrected name.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 5017c95..6427bad 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -326,7 +326,7 @@ static const struct attribute_group *visorchipset_dev_groups[] = {
 };
 
 /* /sys/devices/platform/visorchipset */
-static struct platform_device Visorchipset_platform_device = {
+static struct platform_device visorchipset_platform_device = {
 	.name = "visorchipset",
 	.id = -1,
 	.dev.groups = visorchipset_dev_groups,
@@ -1000,7 +1000,7 @@ device_epilog(u32 bus_no, u32 dev_no, struct spar_segment_state state, u32 cmd,
 					 * diag_shutdown.sh script in
 					 * the visorchipset hotplug */
 					kobject_uevent_env
-					    (&Visorchipset_platform_device.dev.
+					    (&visorchipset_platform_device.dev.
 					     kobj, KOBJ_ONLINE, envp);
 				}
 			}
@@ -1340,7 +1340,7 @@ initialize_controlvm_payload(void)
 int
 visorchipset_chipset_ready(void)
 {
-	kobject_uevent(&Visorchipset_platform_device.dev.kobj, KOBJ_ONLINE);
+	kobject_uevent(&visorchipset_platform_device.dev.kobj, KOBJ_ONLINE);
 	return CONTROLVM_RESP_SUCCESS;
 }
 EXPORT_SYMBOL_GPL(visorchipset_chipset_ready);
@@ -1352,7 +1352,7 @@ visorchipset_chipset_selftest(void)
 	char *envp[] = { env_selftest, NULL };
 
 	sprintf(env_selftest, "SPARSP_SELFTEST=%d", 1);
-	kobject_uevent_env(&Visorchipset_platform_device.dev.kobj, KOBJ_CHANGE,
+	kobject_uevent_env(&visorchipset_platform_device.dev.kobj, KOBJ_CHANGE,
 			   envp);
 	return CONTROLVM_RESP_SUCCESS;
 }
@@ -1364,7 +1364,7 @@ EXPORT_SYMBOL_GPL(visorchipset_chipset_selftest);
 int
 visorchipset_chipset_notready(void)
 {
-	kobject_uevent(&Visorchipset_platform_device.dev.kobj, KOBJ_OFFLINE);
+	kobject_uevent(&visorchipset_platform_device.dev.kobj, KOBJ_OFFLINE);
 	return CONTROLVM_RESP_SUCCESS;
 }
 EXPORT_SYMBOL_GPL(visorchipset_chipset_notready);
@@ -1516,7 +1516,7 @@ parahotplug_request_kickoff(struct parahotplug_request *req)
 	sprintf(env_func, "SPAR_PARAHOTPLUG_FUNCTION=%d",
 		cmd->device_change_state.dev_no & 0x7);
 
-	kobject_uevent_env(&Visorchipset_platform_device.dev.kobj, KOBJ_CHANGE,
+	kobject_uevent_env(&visorchipset_platform_device.dev.kobj, KOBJ_CHANGE,
 			   envp);
 }
 
@@ -2222,8 +2222,8 @@ visorchipset_init(void)
 		}
 	}
 
-	Visorchipset_platform_device.dev.devt = major_dev;
-	if (platform_device_register(&Visorchipset_platform_device) < 0) {
+	visorchipset_platform_device.dev.devt = major_dev;
+	if (platform_device_register(&visorchipset_platform_device) < 0) {
 		POSTCODE_LINUX_2(DEVICE_REGISTER_FAILURE_PC, DIAG_SEVERITY_ERR);
 		rc = -1;
 		goto cleanup;
-- 
2.1.0

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

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

* [PATCH 63/69] staging: unisys: fix CamelCase parameter msgHdr in controlvm functions
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (61 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 62/69] staging: unisys: fix CamelCase global Visorchipset_platform_device Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 64/69] staging: unisys: fix CamelCase parameter in chipset functions Benjamin Romer
                   ` (5 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase parameter name

msgHdr => msg_hdr

In all of the controlvm functions in visorchipset_main.c. Update all references
to use the corrected name.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 6427bad..8ca73b6 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -333,13 +333,13 @@ static struct platform_device visorchipset_platform_device = {
 };
 
 /* Function prototypes */
-static void controlvm_respond(struct controlvm_message_header *msgHdr,
+static void controlvm_respond(struct controlvm_message_header *msg_hdr,
 			      int response);
 static void controlvm_respond_chipset_init(
-		struct controlvm_message_header *msgHdr, int response,
+		struct controlvm_message_header *msg_hdr, int response,
 		enum ultra_chipset_feature features);
 static void controlvm_respond_physdev_changestate(
-		struct controlvm_message_header *msgHdr, int response,
+		struct controlvm_message_header *msg_hdr, int response,
 		struct spar_segment_state state);
 
 static ssize_t toolaction_show(struct device *dev,
@@ -645,10 +645,10 @@ cleanup:
 
 static void
 controlvm_init_response(struct controlvm_message *msg,
-			struct controlvm_message_header *msgHdr, int response)
+			struct controlvm_message_header *msg_hdr, int response)
 {
 	memset(msg, 0, sizeof(struct controlvm_message));
-	memcpy(&msg->hdr, msgHdr, sizeof(struct controlvm_message_header));
+	memcpy(&msg->hdr, msg_hdr, sizeof(struct controlvm_message_header));
 	msg->hdr.payload_bytes = 0;
 	msg->hdr.payload_vm_offset = 0;
 	msg->hdr.payload_max_bytes = 0;
@@ -659,14 +659,14 @@ controlvm_init_response(struct controlvm_message *msg,
 }
 
 static void
-controlvm_respond(struct controlvm_message_header *msgHdr, int response)
+controlvm_respond(struct controlvm_message_header *msg_hdr, int response)
 {
 	struct controlvm_message outmsg;
 
-	controlvm_init_response(&outmsg, msgHdr, response);
+	controlvm_init_response(&outmsg, msg_hdr, response);
 	/* For DiagPool channel DEVICE_CHANGESTATE, we need to send
 	* back the deviceChangeState structure in the packet. */
-	if (msgHdr->id == CONTROLVM_DEVICE_CHANGESTATE &&
+	if (msg_hdr->id == CONTROLVM_DEVICE_CHANGESTATE &&
 	    g_devicechangestate_packet.device_change_state.bus_no ==
 	    g_diagpool_bus_no &&
 	    g_devicechangestate_packet.device_change_state.dev_no ==
@@ -682,13 +682,13 @@ controlvm_respond(struct controlvm_message_header *msgHdr, int response)
 }
 
 static void
-controlvm_respond_chipset_init(struct controlvm_message_header *msgHdr,
+controlvm_respond_chipset_init(struct controlvm_message_header *msg_hdr,
 			       int response,
 			       enum ultra_chipset_feature features)
 {
 	struct controlvm_message outmsg;
 
-	controlvm_init_response(&outmsg, msgHdr, response);
+	controlvm_init_response(&outmsg, msg_hdr, response);
 	outmsg.cmd.init_chipset.features = features;
 	if (!visorchannel_signalinsert(controlvm_channel,
 				       CONTROLVM_QUEUE_REQUEST, &outmsg)) {
@@ -697,12 +697,12 @@ controlvm_respond_chipset_init(struct controlvm_message_header *msgHdr,
 }
 
 static void controlvm_respond_physdev_changestate(
-		struct controlvm_message_header *msgHdr, int response,
+		struct controlvm_message_header *msg_hdr, int response,
 		struct spar_segment_state state)
 {
 	struct controlvm_message outmsg;
 
-	controlvm_init_response(&outmsg, msgHdr, response);
+	controlvm_init_response(&outmsg, msg_hdr, response);
 	outmsg.cmd.device_change_state.state = state;
 	outmsg.cmd.device_change_state.flags.phys_device = 1;
 	if (!visorchannel_signalinsert(controlvm_channel,
-- 
2.1.0

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

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

* [PATCH 64/69] staging: unisys: fix CamelCase parameter in chipset functions
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (62 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 63/69] staging: unisys: fix CamelCase parameter msgHdr in controlvm functions Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 65/69] staging: unisys: fix CamelCase local toolAction Benjamin Romer
                   ` (4 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCase parameter

msgHdr => msg_hdr

In all of the chipset functions. Update all references to use the corrected
name.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 8ca73b6..17fe06e 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1370,42 +1370,42 @@ visorchipset_chipset_notready(void)
 EXPORT_SYMBOL_GPL(visorchipset_chipset_notready);
 
 static void
-chipset_ready(struct controlvm_message_header *msgHdr)
+chipset_ready(struct controlvm_message_header *msg_hdr)
 {
 	int rc = visorchipset_chipset_ready();
 
 	if (rc != CONTROLVM_RESP_SUCCESS)
 		rc = -rc;
-	if (msgHdr->flags.response_expected && !visorchipset_holdchipsetready)
-		controlvm_respond(msgHdr, rc);
-	if (msgHdr->flags.response_expected && visorchipset_holdchipsetready) {
+	if (msg_hdr->flags.response_expected && !visorchipset_holdchipsetready)
+		controlvm_respond(msg_hdr, rc);
+	if (msg_hdr->flags.response_expected && visorchipset_holdchipsetready) {
 		/* Send CHIPSET_READY response when all modules have been loaded
 		 * and disks mounted for the partition
 		 */
-		g_chipset_msg_hdr = *msgHdr;
+		g_chipset_msg_hdr = *msg_hdr;
 	}
 }
 
 static void
-chipset_selftest(struct controlvm_message_header *msgHdr)
+chipset_selftest(struct controlvm_message_header *msg_hdr)
 {
 	int rc = visorchipset_chipset_selftest();
 
 	if (rc != CONTROLVM_RESP_SUCCESS)
 		rc = -rc;
-	if (msgHdr->flags.response_expected)
-		controlvm_respond(msgHdr, rc);
+	if (msg_hdr->flags.response_expected)
+		controlvm_respond(msg_hdr, rc);
 }
 
 static void
-chipset_notready(struct controlvm_message_header *msgHdr)
+chipset_notready(struct controlvm_message_header *msg_hdr)
 {
 	int rc = visorchipset_chipset_notready();
 
 	if (rc != CONTROLVM_RESP_SUCCESS)
 		rc = -rc;
-	if (msgHdr->flags.response_expected)
-		controlvm_respond(msgHdr, rc);
+	if (msg_hdr->flags.response_expected)
+		controlvm_respond(msg_hdr, rc);
 }
 
 /* This is your "one-stop" shop for grabbing the next message from the
-- 
2.1.0

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

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

* [PATCH 65/69] staging: unisys: fix CamelCase local toolAction
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (63 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 64/69] staging: unisys: fix CamelCase parameter in chipset functions Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 66/69] staging: unisys: fix CamelCase variables in boottotool functions Benjamin Romer
                   ` (3 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Rename the CamelCase local

toolAction => tool_action

In both of the sysfs functions for exposing this value, and update all
references to use the corrected name.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 17fe06e..c5eecce 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -346,27 +346,27 @@ static ssize_t toolaction_show(struct device *dev,
 			       struct device_attribute *attr,
 			       char *buf)
 {
-	u8 toolAction;
+	u8 tool_action;
 
 	visorchannel_read(controlvm_channel,
 		offsetof(struct spar_controlvm_channel_protocol,
-			   tool_action), &toolAction, sizeof(u8));
-	return scnprintf(buf, PAGE_SIZE, "%u\n", toolAction);
+			   tool_action), &tool_action, sizeof(u8));
+	return scnprintf(buf, PAGE_SIZE, "%u\n", tool_action);
 }
 
 static ssize_t toolaction_store(struct device *dev,
 				struct device_attribute *attr,
 				const char *buf, size_t count)
 {
-	u8 toolAction;
+	u8 tool_action;
 	int ret;
 
-	if (kstrtou8(buf, 10, &toolAction) != 0)
+	if (kstrtou8(buf, 10, &tool_action) != 0)
 		return -EINVAL;
 
 	ret = visorchannel_write(controlvm_channel,
 		offsetof(struct spar_controlvm_channel_protocol, tool_action),
-		&toolAction, sizeof(u8));
+		&tool_action, sizeof(u8));
 
 	if (ret)
 		return ret;
-- 
2.1.0

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

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

* [PATCH 66/69] staging: unisys: fix CamelCase variables in boottotool functions
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (64 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 65/69] staging: unisys: fix CamelCase local toolAction Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 67/69] staging: unisys: fix CamelCase local in textid functions Benjamin Romer
                   ` (2 subsequent siblings)
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Rename the local CamelCase variable

efiSparIndication => efi_spar_indication

Update all references to use the corrected name.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index c5eecce..b59988d 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -377,14 +377,14 @@ static ssize_t boottotool_show(struct device *dev,
 			       struct device_attribute *attr,
 			       char *buf)
 {
-	struct efi_spar_indication efiSparIndication;
+	struct efi_spar_indication efi_spar_indication;
 
 	visorchannel_read(controlvm_channel,
 		offsetof(struct spar_controlvm_channel_protocol,
-			efi_spar_ind), &efiSparIndication,
+			efi_spar_ind), &efi_spar_indication,
 		sizeof(struct efi_spar_indication));
 	return scnprintf(buf, PAGE_SIZE, "%u\n",
-			efiSparIndication.boot_to_tool);
+			efi_spar_indication.boot_to_tool);
 }
 
 static ssize_t boottotool_store(struct device *dev,
@@ -392,16 +392,16 @@ static ssize_t boottotool_store(struct device *dev,
 				const char *buf, size_t count)
 {
 	int val, ret;
-	struct efi_spar_indication efiSparIndication;
+	struct efi_spar_indication efi_spar_indication;
 
 	if (kstrtoint(buf, 10, &val) != 0)
 		return -EINVAL;
 
-	efiSparIndication.boot_to_tool = val;
+	efi_spar_indication.boot_to_tool = val;
 	ret = visorchannel_write(controlvm_channel,
 			offsetof(struct spar_controlvm_channel_protocol,
 				efi_spar_ind),
-			&(efiSparIndication),
+			&(efi_spar_indication),
 		sizeof(struct efi_spar_indication));
 
 	if (ret)
-- 
2.1.0

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

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

* [PATCH 67/69] staging: unisys: fix CamelCase local in textid functions
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (65 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 66/69] staging: unisys: fix CamelCase variables in boottotool functions Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 68/69] staging: unisys: Fix CamelCase local variable in remaining_steps functions Benjamin Romer
  2015-03-16 17:58 ` [PATCH 69/69] staging: unisys: fix parenthesis alignment in visorchipset_main.c Benjamin Romer
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix the CamelCased local variable

textId => text_id

In both of the textid sysfs functions, and update all references to use the
corrected name.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index b59988d..6f4b491 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -441,27 +441,27 @@ static ssize_t error_store(struct device *dev, struct device_attribute *attr,
 static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
 		char *buf)
 {
-	u32 textId;
+	u32 text_id;
 
 	visorchannel_read(controlvm_channel, offsetof(
 		struct spar_controlvm_channel_protocol, installation_text_id),
-		&textId, sizeof(u32));
-	return scnprintf(buf, PAGE_SIZE, "%i\n", textId);
+		&text_id, sizeof(u32));
+	return scnprintf(buf, PAGE_SIZE, "%i\n", text_id);
 }
 
 static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
 		const char *buf, size_t count)
 {
-	u32 textId;
+	u32 text_id;
 	int ret;
 
-	if (kstrtou32(buf, 10, &textId) != 0)
+	if (kstrtou32(buf, 10, &text_id) != 0)
 		return -EINVAL;
 
 	ret = visorchannel_write(controlvm_channel,
 			offsetof(struct spar_controlvm_channel_protocol,
 				installation_text_id),
-			&textId, sizeof(u32));
+			&text_id, sizeof(u32));
 	if (ret)
 		return ret;
 	return count;
-- 
2.1.0

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

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

* [PATCH 68/69] staging: unisys: Fix CamelCase local variable in remaining_steps functions
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (66 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 67/69] staging: unisys: fix CamelCase local in textid functions Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  2015-03-16 17:58 ` [PATCH 69/69] staging: unisys: fix parenthesis alignment in visorchipset_main.c Benjamin Romer
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Rename the CamelCase local variable

remainingSteps => remaining_steps

Update all references to use the corrected name.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 6f4b491..ec48132 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -470,29 +470,29 @@ static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
 static ssize_t remaining_steps_show(struct device *dev,
 	struct device_attribute *attr, char *buf)
 {
-	u16 remainingSteps;
+	u16 remaining_steps;
 
 	visorchannel_read(controlvm_channel,
 		offsetof(struct spar_controlvm_channel_protocol,
 			installation_remaining_steps),
-		&remainingSteps,
+		&remaining_steps,
 		sizeof(u16));
-	return scnprintf(buf, PAGE_SIZE, "%hu\n", remainingSteps);
+	return scnprintf(buf, PAGE_SIZE, "%hu\n", remaining_steps);
 }
 
 static ssize_t remaining_steps_store(struct device *dev,
 	struct device_attribute *attr, const char *buf, size_t count)
 {
-	u16 remainingSteps;
+	u16 remaining_steps;
 	int ret;
 
-	if (kstrtou16(buf, 10, &remainingSteps) != 0)
+	if (kstrtou16(buf, 10, &remaining_steps) != 0)
 		return -EINVAL;
 
 	ret = visorchannel_write(controlvm_channel,
 			offsetof(struct spar_controlvm_channel_protocol,
 				installation_remaining_steps),
-			&remainingSteps, sizeof(u16));
+			&remaining_steps, sizeof(u16));
 	if (ret)
 		return ret;
 	return count;
-- 
2.1.0

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

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

* [PATCH 69/69] staging: unisys: fix parenthesis alignment in visorchipset_main.c
  2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
                   ` (67 preceding siblings ...)
  2015-03-16 17:58 ` [PATCH 68/69] staging: unisys: Fix CamelCase local variable in remaining_steps functions Benjamin Romer
@ 2015-03-16 17:58 ` Benjamin Romer
  68 siblings, 0 replies; 71+ messages in thread
From: Benjamin Romer @ 2015-03-16 17:58 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix as many parenthesis alignment problems in this file as possible.

In cases where there was no good way to align to the leading parenthesis, the
content of the parenthesis were aligned as if there were no limit, and then the
leading indentation was moved back to one tab in from the previous line.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/visorchipset/visorchipset_main.c        | 117 +++++++++++----------
 1 file changed, 64 insertions(+), 53 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index ec48132..9c8605d 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -242,45 +242,51 @@ static dev_t major_dev = -1; /**< indicates major num for device */
 
 /* prototypes for attributes */
 static ssize_t toolaction_show(struct device *dev,
-	struct device_attribute *attr, char *buf);
+			       struct device_attribute *attr, char *buf);
 static ssize_t toolaction_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t count);
+				struct device_attribute *attr,
+				const char *buf, size_t count);
 static DEVICE_ATTR_RW(toolaction);
 
 static ssize_t boottotool_show(struct device *dev,
-	struct device_attribute *attr, char *buf);
+			       struct device_attribute *attr, char *buf);
 static ssize_t boottotool_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t count);
+				struct device_attribute *attr, const char *buf,
+				size_t count);
 static DEVICE_ATTR_RW(boottotool);
 
 static ssize_t error_show(struct device *dev, struct device_attribute *attr,
-	char *buf);
+			  char *buf);
 static ssize_t error_store(struct device *dev, struct device_attribute *attr,
-	const char *buf, size_t count);
+			   const char *buf, size_t count);
 static DEVICE_ATTR_RW(error);
 
 static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
-	char *buf);
+			   char *buf);
 static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
-	const char *buf, size_t count);
+			    const char *buf, size_t count);
 static DEVICE_ATTR_RW(textid);
 
 static ssize_t remaining_steps_show(struct device *dev,
-	struct device_attribute *attr, char *buf);
+				    struct device_attribute *attr, char *buf);
 static ssize_t remaining_steps_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t count);
+				     struct device_attribute *attr,
+				     const char *buf, size_t count);
 static DEVICE_ATTR_RW(remaining_steps);
 
 static ssize_t chipsetready_store(struct device *dev,
-		struct device_attribute *attr, const char *buf, size_t count);
+				  struct device_attribute *attr,
+				  const char *buf, size_t count);
 static DEVICE_ATTR_WO(chipsetready);
 
 static ssize_t devicedisabled_store(struct device *dev,
-		struct device_attribute *attr, const char *buf, size_t count);
+				    struct device_attribute *attr,
+				    const char *buf, size_t count);
 static DEVICE_ATTR_WO(devicedisabled);
 
 static ssize_t deviceenabled_store(struct device *dev,
-		struct device_attribute *attr, const char *buf, size_t count);
+				   struct device_attribute *attr,
+				   const char *buf, size_t count);
 static DEVICE_ATTR_WO(deviceenabled);
 
 static struct attribute *visorchipset_install_attrs[] = {
@@ -350,7 +356,7 @@ static ssize_t toolaction_show(struct device *dev,
 
 	visorchannel_read(controlvm_channel,
 		offsetof(struct spar_controlvm_channel_protocol,
-			   tool_action), &tool_action, sizeof(u8));
+			 tool_action), &tool_action, sizeof(u8));
 	return scnprintf(buf, PAGE_SIZE, "%u\n", tool_action);
 }
 
@@ -365,7 +371,8 @@ static ssize_t toolaction_store(struct device *dev,
 		return -EINVAL;
 
 	ret = visorchannel_write(controlvm_channel,
-		offsetof(struct spar_controlvm_channel_protocol, tool_action),
+		offsetof(struct spar_controlvm_channel_protocol,
+			 tool_action),
 		&tool_action, sizeof(u8));
 
 	if (ret)
@@ -380,11 +387,11 @@ static ssize_t boottotool_show(struct device *dev,
 	struct efi_spar_indication efi_spar_indication;
 
 	visorchannel_read(controlvm_channel,
-		offsetof(struct spar_controlvm_channel_protocol,
-			efi_spar_ind), &efi_spar_indication,
-		sizeof(struct efi_spar_indication));
+			  offsetof(struct spar_controlvm_channel_protocol,
+				   efi_spar_ind), &efi_spar_indication,
+			  sizeof(struct efi_spar_indication));
 	return scnprintf(buf, PAGE_SIZE, "%u\n",
-			efi_spar_indication.boot_to_tool);
+			 efi_spar_indication.boot_to_tool);
 }
 
 static ssize_t boottotool_store(struct device *dev,
@@ -400,9 +407,8 @@ static ssize_t boottotool_store(struct device *dev,
 	efi_spar_indication.boot_to_tool = val;
 	ret = visorchannel_write(controlvm_channel,
 			offsetof(struct spar_controlvm_channel_protocol,
-				efi_spar_ind),
-			&(efi_spar_indication),
-		sizeof(struct efi_spar_indication));
+				 efi_spar_ind), &(efi_spar_indication),
+				 sizeof(struct efi_spar_indication));
 
 	if (ret)
 		return ret;
@@ -410,18 +416,19 @@ static ssize_t boottotool_store(struct device *dev,
 }
 
 static ssize_t error_show(struct device *dev, struct device_attribute *attr,
-		char *buf)
+			  char *buf)
 {
 	u32 error;
 
-	visorchannel_read(controlvm_channel, offsetof(
-		struct spar_controlvm_channel_protocol, installation_error),
-		&error, sizeof(u32));
+	visorchannel_read(controlvm_channel,
+			  offsetof(struct spar_controlvm_channel_protocol,
+				   installation_error),
+			  &error, sizeof(u32));
 	return scnprintf(buf, PAGE_SIZE, "%i\n", error);
 }
 
 static ssize_t error_store(struct device *dev, struct device_attribute *attr,
-		const char *buf, size_t count)
+			   const char *buf, size_t count)
 {
 	u32 error;
 	int ret;
@@ -430,27 +437,28 @@ static ssize_t error_store(struct device *dev, struct device_attribute *attr,
 		return -EINVAL;
 
 	ret = visorchannel_write(controlvm_channel,
-			offsetof(struct spar_controlvm_channel_protocol,
-				installation_error),
-			&error, sizeof(u32));
+		offsetof(struct spar_controlvm_channel_protocol,
+			 installation_error),
+		&error, sizeof(u32));
 	if (ret)
 		return ret;
 	return count;
 }
 
 static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
-		char *buf)
+			   char *buf)
 {
 	u32 text_id;
 
-	visorchannel_read(controlvm_channel, offsetof(
-		struct spar_controlvm_channel_protocol, installation_text_id),
-		&text_id, sizeof(u32));
+	visorchannel_read(controlvm_channel,
+			  offsetof(struct spar_controlvm_channel_protocol,
+				   installation_text_id),
+			  &text_id, sizeof(u32));
 	return scnprintf(buf, PAGE_SIZE, "%i\n", text_id);
 }
 
 static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
-		const char *buf, size_t count)
+			    const char *buf, size_t count)
 {
 	u32 text_id;
 	int ret;
@@ -459,29 +467,29 @@ static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
 		return -EINVAL;
 
 	ret = visorchannel_write(controlvm_channel,
-			offsetof(struct spar_controlvm_channel_protocol,
-				installation_text_id),
-			&text_id, sizeof(u32));
+		offsetof(struct spar_controlvm_channel_protocol,
+			 installation_text_id),
+		&text_id, sizeof(u32));
 	if (ret)
 		return ret;
 	return count;
 }
 
 static ssize_t remaining_steps_show(struct device *dev,
-	struct device_attribute *attr, char *buf)
+				    struct device_attribute *attr, char *buf)
 {
 	u16 remaining_steps;
 
 	visorchannel_read(controlvm_channel,
-		offsetof(struct spar_controlvm_channel_protocol,
-			installation_remaining_steps),
-		&remaining_steps,
-		sizeof(u16));
+			  offsetof(struct spar_controlvm_channel_protocol,
+				   installation_remaining_steps),
+			  &remaining_steps, sizeof(u16));
 	return scnprintf(buf, PAGE_SIZE, "%hu\n", remaining_steps);
 }
 
 static ssize_t remaining_steps_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t count)
+				     struct device_attribute *attr,
+				     const char *buf, size_t count)
 {
 	u16 remaining_steps;
 	int ret;
@@ -490,9 +498,9 @@ static ssize_t remaining_steps_store(struct device *dev,
 		return -EINVAL;
 
 	ret = visorchannel_write(controlvm_channel,
-			offsetof(struct spar_controlvm_channel_protocol,
-				installation_remaining_steps),
-			&remaining_steps, sizeof(u16));
+		offsetof(struct spar_controlvm_channel_protocol,
+			 installation_remaining_steps),
+		&remaining_steps, sizeof(u16));
 	if (ret)
 		return ret;
 	return count;
@@ -562,7 +570,7 @@ visorchipset_register_busdev_server(
 		*responders = busdev_responders;
 	if (driver_info)
 		bus_device_info_init(driver_info, "chipset", "visorchipset",
-				   VERSION, NULL);
+				     VERSION, NULL);
 
 	up(&notifier_lock);
 }
@@ -1613,8 +1621,8 @@ parahotplug_process_message(struct controlvm_message *inmsg)
 		*/
 		parahotplug_request_kickoff(req);
 		controlvm_respond_physdev_changestate(&inmsg->hdr,
-				CONTROLVM_RESP_SUCCESS, inmsg->cmd.
-				device_change_state.state);
+			CONTROLVM_RESP_SUCCESS,
+			inmsg->cmd.device_change_state.state);
 		parahotplug_request_destroy(req);
 	} else {
 		/* For disable messages, add the request to the
@@ -2083,7 +2091,8 @@ visorchipset_cache_free(struct kmem_cache *pool, void *p, char *fn, int ln)
 }
 
 static ssize_t chipsetready_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t count)
+				  struct device_attribute *attr,
+				  const char *buf, size_t count)
 {
 	char msgtype[64];
 
@@ -2105,7 +2114,8 @@ static ssize_t chipsetready_store(struct device *dev,
  * and then passed back when the device has been removed.
  */
 static ssize_t devicedisabled_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t count)
+				    struct device_attribute *attr,
+				    const char *buf, size_t count)
 {
 	uint id;
 
@@ -2121,7 +2131,8 @@ static ssize_t devicedisabled_store(struct device *dev,
  * and then passed back when the device has been brought back up.
  */
 static ssize_t deviceenabled_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t count)
+				   struct device_attribute *attr,
+				   const char *buf, size_t count)
 {
 	uint id;
 
-- 
2.1.0

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

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

* Re: [PATCH 53/69] staging: unisys: remove unnecessary brackets in uislib.c
  2015-03-16 17:58 ` [PATCH 53/69] staging: unisys: remove unnecessary brackets " Benjamin Romer
@ 2015-03-23 21:00   ` Greg KH
  0 siblings, 0 replies; 71+ messages in thread
From: Greg KH @ 2015-03-23 21:00 UTC (permalink / raw)
  To: Benjamin Romer; +Cc: sparmaintainer, driverdev-devel

On Mon, Mar 16, 2015 at 01:58:36PM -0400, Benjamin Romer wrote:
> Take out extra braces from if statements with only a single line of code
> inside.
> 
> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
> ---
>  drivers/staging/unisys/uislib/uislib.c | 18 ++++++------------
>  1 file changed, 6 insertions(+), 12 deletions(-)

This patch didn't apply :(
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2015-03-23 23:19 UTC | newest]

Thread overview: 71+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-16 17:57 [PATCH 00/69] staging: unisys: driver code cleanup series Benjamin Romer
2015-03-16 17:57 ` [PATCH 01/69] staging: unisys: clean up NULL comparisons in visorchannel_funcs.c Benjamin Romer
2015-03-16 17:57 ` [PATCH 02/69] staging: unisys: cleanup NULL comparisons in virthba.c Benjamin Romer
2015-03-16 17:57 ` [PATCH 03/69] staging: unisys: fix CamelCase in virthba_probe() Benjamin Romer
2015-03-16 17:57 ` [PATCH 04/69] staging: unisys: fix CamelCase global Poll_jiffies Benjamin Romer
2015-03-16 17:57 ` [PATCH 05/69] staging: unisys: remove unnecessary complication from delete_vbus_device Benjamin Romer
2015-03-16 17:57 ` [PATCH 06/69] staging: unisys: clean up NULL compares in virtpci.c Benjamin Romer
2015-03-16 17:57 ` [PATCH 07/69] staging: unisys: fix CamelCase variable Controlvm_Payload_Bytes_Buffered Benjamin Romer
2015-03-16 17:57 ` [PATCH 08/69] staging: unisys: remove typedef for PARSER_CONTEXT Benjamin Romer
2015-03-16 17:57 ` [PATCH 09/69] staging: unisys: refactor parser_init_guts() Benjamin Romer
2015-03-16 17:57 ` [PATCH 10/69] staging: unisys: fix CamelCase names in parser_init() Benjamin Romer
2015-03-16 17:57 ` [PATCH 11/69] staging: unisys: refactor parser_init_byteStream Benjamin Romer
2015-03-16 17:57 ` [PATCH 12/69] staging: unisys: refactor parser_byteStream_get Benjamin Romer
2015-03-16 17:57 ` [PATCH 13/69] staging: unisys: fix CamelCase global Most_recent_message_jiffies Benjamin Romer
2015-03-16 17:57 ` [PATCH 14/69] staging: unisys: fix CamelCase controlvm globals Benjamin Romer
2015-03-16 17:57 ` [PATCH 15/69] staging: unisys: fix CamelCase message header variables Benjamin Romer
2015-03-16 17:57 ` [PATCH 16/69] staging: unisys: fix CamelCase semaphore NotifierLock Benjamin Romer
2015-03-16 17:58 ` [PATCH 17/69] staging: unisys: fix CamelCase name Benjamin Romer
2015-03-16 17:58 ` [PATCH 18/69] staging: unisys: fix CamelCased diagpool bus/dev names Benjamin Romer
2015-03-16 17:58 ` [PATCH 19/69] staging: unisys: fix CamelCase name for devicechangestate packet Benjamin Romer
2015-03-16 17:58 ` [PATCH 20/69] staging: unisys: fix CamelCase list names Benjamin Romer
2015-03-16 17:58 ` [PATCH 21/69] staging: unisys: fix placement of logical ops in visorchipset_main.c Benjamin Romer
2015-03-16 17:58 ` [PATCH 22/69] staging: unisys: fix CamelCase channel name ControlVm_channel Benjamin Romer
2015-03-16 17:58 ` [PATCH 23/69] staging: unisys: get rid of Test_Vnic_channel Benjamin Romer
2015-03-16 17:58 ` [PATCH 24/69] staging: unisys: fix CamelCase global ControlVm_payload_info Benjamin Romer
2015-03-16 17:58 ` [PATCH 25/69] staging: unisys: refactor livedump_info structure Benjamin Romer
2015-03-16 17:58 ` [PATCH 26/69] staging: unisys: remove extra blank lines in visorchipset_main.c Benjamin Romer
2015-03-16 17:58 ` [PATCH 27/69] staging: unisys: remove old code block " Benjamin Romer
2015-03-16 17:58 ` [PATCH 28/69] staging: unisys: fix CamelCase-named clearing functions Benjamin Romer
2015-03-16 17:58 ` [PATCH 29/69] staging: unisys: remove obsolete proc entry code Benjamin Romer
2015-03-16 17:58 ` [PATCH 30/69] staging: unisys: fix all NULL comparisons in visorchipset_main.c Benjamin Romer
2015-03-16 17:58 ` [PATCH 31/69] staging: unisys: fix Camelcase Away goto label Benjamin Romer
2015-03-16 17:58 ` [PATCH 32/69] staging: unisys: fix CamelCase locals in visorchipset_save_message Benjamin Romer
2015-03-16 17:58 ` [PATCH 33/69] staging: unisys: fix CamelCase params in responder functions Benjamin Romer
2015-03-16 17:58 ` [PATCH 34/69] staging: unisys: fix CamelCase in epilog functions Benjamin Romer
2015-03-16 17:58 ` [PATCH 35/69] staging: unisys: fix spaces after typecasts in visorchipset_main.c Benjamin Romer
2015-03-16 17:58 ` [PATCH 36/69] staging: unisys: fix braces " Benjamin Romer
2015-03-16 17:58 ` [PATCH 37/69] staging: unisys: refactor bus_create() Benjamin Romer
2015-03-16 17:58 ` [PATCH 38/69] staging: unisys: refactor bus_destroy() Benjamin Romer
2015-03-16 17:58 ` [PATCH 39/69] staging: unisys: refactor bus_configure() Benjamin Romer
2015-03-16 17:58 ` [PATCH 40/69] staging: unisys: refactor my_device_create() Benjamin Romer
2015-03-16 17:58 ` [PATCH 41/69] staging: unisys: refactor my_device_changestate() Benjamin Romer
2015-03-16 17:58 ` [PATCH 42/69] staging: unisys: refactor my_device_destroy() Benjamin Romer
2015-03-16 17:58 ` [PATCH 43/69] staging: unisys: refactor initialize_controlvm_payload_info() Benjamin Romer
2015-03-16 17:58 ` [PATCH 44/69] staging: unisys: fix NULL comparison in destroy_controlvm_payload_info() Benjamin Romer
2015-03-16 17:58 ` [PATCH 45/69] staging: unisys: fix Camelcase in initialize_controlvm_payload() Benjamin Romer
2015-03-16 17:58 ` [PATCH 46/69] staging: unisys: refactor parahotplug_process_list() Benjamin Romer
2015-03-16 17:58 ` [PATCH 47/69] staging: unisys: fix spacing in parahotplug_request_create Benjamin Romer
2015-03-16 17:58 ` [PATCH 48/69] staging: unisys: refactor handle_command() Benjamin Romer
2015-03-16 17:58 ` [PATCH 49/69] staging: unisys: refactor controlvm_periodic_work() Benjamin Romer
2015-03-16 17:58 ` [PATCH 50/69] staging: unisys: fix CamelCase in setup_crash_devices_work_queue() Benjamin Romer
2015-03-16 17:58 ` [PATCH 51/69] staging: unisys: fix CamelCase label in visorchipset_init() Benjamin Romer
2015-03-16 17:58 ` [PATCH 52/69] staging: unisys: fix NULL pointer comparisons in uislib.c Benjamin Romer
2015-03-16 17:58 ` [PATCH 53/69] staging: unisys: remove unnecessary brackets " Benjamin Romer
2015-03-23 21:00   ` Greg KH
2015-03-16 17:58 ` [PATCH 54/69] staging: unisys: remove last remnants of proc entry code Benjamin Romer
2015-03-16 17:58 ` [PATCH 55/69] staging: unisys: fix CamelCased ControlVM globals Benjamin Romer
2015-03-16 17:58 ` [PATCH 56/69] staging: unisys: fix CamelCase in putfile-related globals Benjamin Romer
2015-03-16 17:58 ` [PATCH 57/69] staging: unisys: fix CamelCase global Visorchipset_cache_buffers_in_use Benjamin Romer
2015-03-16 17:58 ` [PATCH 58/69] staging: unisys: fix CamelCased Parahotplug globals Benjamin Romer
2015-03-16 17:58 ` [PATCH 59/69] staging: unisys: fix CamelCased notifier globals Benjamin Romer
2015-03-16 17:58 ` [PATCH 60/69] staging: unisys: fix CamelCase in responders functions Benjamin Romer
2015-03-16 17:58 ` [PATCH 61/69] staging: unisys: fix CamelCased global MajorDev Benjamin Romer
2015-03-16 17:58 ` [PATCH 62/69] staging: unisys: fix CamelCase global Visorchipset_platform_device Benjamin Romer
2015-03-16 17:58 ` [PATCH 63/69] staging: unisys: fix CamelCase parameter msgHdr in controlvm functions Benjamin Romer
2015-03-16 17:58 ` [PATCH 64/69] staging: unisys: fix CamelCase parameter in chipset functions Benjamin Romer
2015-03-16 17:58 ` [PATCH 65/69] staging: unisys: fix CamelCase local toolAction Benjamin Romer
2015-03-16 17:58 ` [PATCH 66/69] staging: unisys: fix CamelCase variables in boottotool functions Benjamin Romer
2015-03-16 17:58 ` [PATCH 67/69] staging: unisys: fix CamelCase local in textid functions Benjamin Romer
2015-03-16 17:58 ` [PATCH 68/69] staging: unisys: Fix CamelCase local variable in remaining_steps functions Benjamin Romer
2015-03-16 17:58 ` [PATCH 69/69] staging: unisys: fix parenthesis alignment in visorchipset_main.c Benjamin Romer

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.