All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include
@ 2014-09-24 15:56 Benjamin Romer
  2014-09-24 15:56 ` [PATCH 1/9] staging: unisys: clean up periodic_work.c and periodic_work.h Benjamin Romer
                   ` (9 more replies)
  0 siblings, 10 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-09-24 15:56 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

This patch series addresses most of the checkpatch.pl warnings and checks
generated when run with the --strict option, in the include directory for the
Unisys drivers. Most of the issues were handled, with the exception of
CamelCase members of shared structs. These will be addressed in subsequent
patches.

Benjamin Romer (9):
  staging: unisys: clean up periodic_work.c and periodic_work.h
  staging: unisys: clean up timskmod.h
  staging: unisys: remove timskmodutils.h
  staging: unisys: clean up uisqueue.h
  staging: unisys: remove blank lines from uisthread.h
  staging: unisys: clean up uisutils.h
  staging: unisys: clean up uniklog.h
  staging: unisys: cleanup vbushelper.h
  staging: unisys: clean up guestlinuxdebug.h

 drivers/staging/unisys/channels/chanstub.c         |   2 +-
 drivers/staging/unisys/include/guestlinuxdebug.h   |  10 +-
 drivers/staging/unisys/include/periodic_work.h     |  25 ++--
 drivers/staging/unisys/include/timskmod.h          |  93 +------------
 drivers/staging/unisys/include/timskmodutils.h     |  77 ----------
 drivers/staging/unisys/include/uisqueue.h          |  58 ++++----
 drivers/staging/unisys/include/uisthread.h         |   3 -
 drivers/staging/unisys/include/uisutils.h          | 147 +++++++++----------
 drivers/staging/unisys/include/uniklog.h           |   2 -
 drivers/staging/unisys/include/vbushelper.h        |  24 ++--
 drivers/staging/unisys/uislib/uislib.c             |  38 ++---
 drivers/staging/unisys/uislib/uisqueue.c           |   8 +-
 drivers/staging/unisys/uislib/uisutils.c           | 118 ++++++++--------
 drivers/staging/unisys/virthba/virthba.c           |  16 +--
 drivers/staging/unisys/virtpci/virtpci.c           |  14 +-
 drivers/staging/unisys/visorchipset/file.c         |   4 +-
 .../unisys/visorchipset/visorchipset_main.c        |  10 +-
 drivers/staging/unisys/visorutil/periodic_work.c   | 155 ++++++++++-----------
 drivers/staging/unisys/visorutil/visorkmodutils.c  |  40 ------
 19 files changed, 311 insertions(+), 533 deletions(-)
 delete mode 100644 drivers/staging/unisys/include/timskmodutils.h

-- 
1.9.1

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

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

* [PATCH 1/9] staging: unisys: clean up periodic_work.c and periodic_work.h
  2014-09-24 15:56 [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include Benjamin Romer
@ 2014-09-24 15:56 ` Benjamin Romer
  2014-09-24 16:34   ` Dan Carpenter
  2014-09-24 15:56 ` [PATCH 2/9] staging: unisys: clean up timskmod.h Benjamin Romer
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Benjamin Romer @ 2014-09-24 15:56 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Eliminate all checkpatch.pl warnings and checks from these files.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/include/periodic_work.h   |  25 ++--
 drivers/staging/unisys/visorutil/periodic_work.c | 155 +++++++++++------------
 2 files changed, 83 insertions(+), 97 deletions(-)

diff --git a/drivers/staging/unisys/include/periodic_work.h b/drivers/staging/unisys/include/periodic_work.h
index 418ba63..2f8e984 100644
--- a/drivers/staging/unisys/include/periodic_work.h
+++ b/drivers/staging/unisys/include/periodic_work.h
@@ -20,21 +20,20 @@
 
 #include "timskmod.h"
 
-
-
-/* PERIODIC_WORK an opaque structure to users.
+/* periodic_work an opaque structure to users.
  * Fields are declared only in the implementation .c files.
  */
-typedef struct PERIODIC_WORK_Tag PERIODIC_WORK;
+struct periodic_work;
 
-PERIODIC_WORK *visor_periodic_work_create(ulong jiffy_interval,
-					  struct workqueue_struct *workqueue,
-					  void (*workfunc)(void *),
-					  void *workfuncarg,
-					  const char *devnam);
-void            visor_periodic_work_destroy(PERIODIC_WORK *periodic_work);
-BOOL            visor_periodic_work_nextperiod(PERIODIC_WORK *periodic_work);
-BOOL            visor_periodic_work_start(PERIODIC_WORK *periodic_work);
-BOOL            visor_periodic_work_stop(PERIODIC_WORK *periodic_work);
+struct periodic_work *
+	visor_periodic_work_create(ulong jiffy_interval,
+				   struct workqueue_struct *workqueue,
+				   void (*workfunc)(void *),
+				   void *workfuncarg,
+				   const char *devnam);
+void visor_periodic_work_destroy(struct periodic_work *periodic_work);
+BOOL visor_periodic_work_nextperiod(struct periodic_work *periodic_work);
+BOOL visor_periodic_work_start(struct periodic_work *periodic_work);
+BOOL visor_periodic_work_stop(struct periodic_work *periodic_work);
 
 #endif
diff --git a/drivers/staging/unisys/visorutil/periodic_work.c b/drivers/staging/unisys/visorutil/periodic_work.c
index 38a60ce..22aedd0 100644
--- a/drivers/staging/unisys/visorutil/periodic_work.c
+++ b/drivers/staging/unisys/visorutil/periodic_work.c
@@ -25,9 +25,7 @@
 
 #define MYDRVNAME "periodic_work"
 
-
-
-struct PERIODIC_WORK_Tag {
+struct periodic_work {
 	rwlock_t lock;
 	struct delayed_work work;
 	void (*workfunc)(void *);
@@ -39,123 +37,111 @@ struct PERIODIC_WORK_Tag {
 	const char *devnam;
 };
 
-
-
 static void periodic_work_func(struct work_struct *work)
 {
-	PERIODIC_WORK *periodic_work =
-		container_of(work, struct PERIODIC_WORK_Tag, work.work);
-	(*periodic_work->workfunc)(periodic_work->workfuncarg);
-}
-
+	struct periodic_work *pw =
+		container_of(work, struct periodic_work, work.work);
 
+	(*pw->workfunc)(pw->workfuncarg);
+}
 
-PERIODIC_WORK *visor_periodic_work_create(ulong jiffy_interval,
-					  struct workqueue_struct *workqueue,
-					  void (*workfunc)(void *),
-					  void *workfuncarg,
-					  const char *devnam)
+struct periodic_work *
+	visor_periodic_work_create(ulong jiffy_interval,
+				   struct workqueue_struct *workqueue,
+				   void (*workfunc)(void *),
+				   void *workfuncarg,
+				   const char *devnam)
 {
-	PERIODIC_WORK *periodic_work = kzalloc(sizeof(PERIODIC_WORK),
-					       GFP_KERNEL | __GFP_NORETRY);
-	if (periodic_work == NULL) {
+	struct periodic_work *pw = kzalloc(sizeof(struct periodic_work),
+					   GFP_KERNEL | __GFP_NORETRY);
+
+	if (pw == NULL) {
 		ERRDRV("periodic_work allocation failed ");
 		return NULL;
 	}
-	rwlock_init(&periodic_work->lock);
-	periodic_work->jiffy_interval = jiffy_interval;
-	periodic_work->workqueue = workqueue;
-	periodic_work->workfunc = workfunc;
-	periodic_work->workfuncarg = workfuncarg;
-	periodic_work->devnam = devnam;
-	return periodic_work;
+	rwlock_init(&pw->lock);
+	pw->jiffy_interval = jiffy_interval;
+	pw->workqueue = workqueue;
+	pw->workfunc = workfunc;
+	pw->workfuncarg = workfuncarg;
+	pw->devnam = devnam;
+	return pw;
 }
 EXPORT_SYMBOL_GPL(visor_periodic_work_create);
 
-
-
-void visor_periodic_work_destroy(PERIODIC_WORK *periodic_work)
+void visor_periodic_work_destroy(struct periodic_work *pw)
 {
-	if (periodic_work == NULL)
+	if (pw == NULL)
 		return;
-	kfree(periodic_work);
+	kfree(pw);
 }
 EXPORT_SYMBOL_GPL(visor_periodic_work_destroy);
 
-
-
 /** Call this from your periodic work worker function to schedule the next
  *  call.
  *  If this function returns FALSE, there was a failure and the
  *  periodic work is no longer scheduled
  */
-BOOL visor_periodic_work_nextperiod(PERIODIC_WORK *periodic_work)
+BOOL visor_periodic_work_nextperiod(struct periodic_work *pw)
 {
 	BOOL rc = FALSE;
 
-	write_lock(&periodic_work->lock);
-	if (periodic_work->want_to_stop) {
-		periodic_work->is_scheduled = FALSE;
-		periodic_work->want_to_stop = FALSE;
+	write_lock(&pw->lock);
+	if (pw->want_to_stop) {
+		pw->is_scheduled = FALSE;
+		pw->want_to_stop = FALSE;
 		rc = TRUE;  /* yes, TRUE; see visor_periodic_work_stop() */
-		goto Away;
-	} else if (queue_delayed_work(periodic_work->workqueue,
-				      &periodic_work->work,
-				      periodic_work->jiffy_interval) < 0) {
-		ERRDEV(periodic_work->devnam, "queue_delayed_work failed!");
-		periodic_work->is_scheduled = FALSE;
+		goto away;
+	} else if (queue_delayed_work(pw->workqueue, &pw->work,
+				pw->jiffy_interval) < 0) {
+		ERRDEV(pw->devnam, "queue_delayed_work failed!");
+		pw->is_scheduled = FALSE;
 		rc = FALSE;
-		goto Away;
+		goto away;
 	}
 	rc = TRUE;
-Away:
-	write_unlock(&periodic_work->lock);
+away:
+	write_unlock(&pw->lock);
 	return rc;
 }
 EXPORT_SYMBOL_GPL(visor_periodic_work_nextperiod);
 
-
-
 /** This function returns TRUE iff new periodic work was actually started.
  *  If this function returns FALSE, then no work was started
  *  (either because it was already started, or because of a failure).
  */
-BOOL visor_periodic_work_start(PERIODIC_WORK *periodic_work)
+BOOL visor_periodic_work_start(struct periodic_work *pw)
 {
 	BOOL rc = FALSE;
 
-	write_lock(&periodic_work->lock);
-	if (periodic_work->is_scheduled) {
+	write_lock(&pw->lock);
+	if (pw->is_scheduled) {
 		rc = FALSE;
-		goto Away;
+		goto away;
 	}
-	if (periodic_work->want_to_stop) {
-		ERRDEV(periodic_work->devnam,
+	if (pw->want_to_stop) {
+		ERRDEV(pw->devnam,
 		       "dev_start_periodic_work failed!");
 		rc = FALSE;
-		goto Away;
+		goto away;
 	}
-	INIT_DELAYED_WORK(&periodic_work->work, &periodic_work_func);
-	if (queue_delayed_work(periodic_work->workqueue,
-			       &periodic_work->work,
-			       periodic_work->jiffy_interval) < 0) {
-		ERRDEV(periodic_work->devnam,
+	INIT_DELAYED_WORK(&pw->work, &periodic_work_func);
+	if (queue_delayed_work(pw->workqueue,
+			       &pw->work,
+			       pw->jiffy_interval) < 0) {
+		ERRDEV(pw->devnam,
 		       "%s queue_delayed_work failed!", __func__);
 		rc = FALSE;
-		goto Away;
+		goto away;
 	}
-	periodic_work->is_scheduled = TRUE;
+	pw->is_scheduled = TRUE;
 	rc = TRUE;
-Away:
-	write_unlock(&periodic_work->lock);
+away:
+	write_unlock(&pw->lock);
 	return rc;
-
 }
 EXPORT_SYMBOL_GPL(visor_periodic_work_start);
 
-
-
-
 /** This function returns TRUE iff your call actually stopped the periodic
  *  work.
  *
@@ -190,21 +176,21 @@ EXPORT_SYMBOL_GPL(visor_periodic_work_start);
  *     this deadlock, you will get hung up in an infinite loop saying
  *     "waiting for delayed work...".
  */
-BOOL visor_periodic_work_stop(PERIODIC_WORK *periodic_work)
+BOOL visor_periodic_work_stop(struct periodic_work *pw)
 {
 	BOOL stopped_something = FALSE;
 
-	write_lock(&periodic_work->lock);
-	stopped_something = periodic_work->is_scheduled &&
-		(!periodic_work->want_to_stop);
-	while (periodic_work->is_scheduled) {
-		periodic_work->want_to_stop = TRUE;
-		if (cancel_delayed_work(&periodic_work->work)) {
+	write_lock(&pw->lock);
+	stopped_something = pw->is_scheduled &&
+		(!pw->want_to_stop);
+	while (pw->is_scheduled) {
+		pw->want_to_stop = TRUE;
+		if (cancel_delayed_work(&pw->work)) {
 			/* We get here if the delayed work was pending as
 			 * delayed work, but was NOT run.
 			 */
-			ASSERT(periodic_work->is_scheduled);
-			periodic_work->is_scheduled = FALSE;
+			ASSERT(pw->is_scheduled);
+			pw->is_scheduled = FALSE;
 		} else {
 			/* If we get here, either the delayed work:
 			 * - was run, OR,
@@ -216,9 +202,9 @@ BOOL visor_periodic_work_stop(PERIODIC_WORK *periodic_work)
 			 * explains the loop...
 			 */
 		}
-		if (periodic_work->is_scheduled) {
-			write_unlock(&periodic_work->lock);
-			WARNDEV(periodic_work->devnam,
+		if (pw->is_scheduled) {
+			write_unlock(&pw->lock);
+			WARNDEV(pw->devnam,
 				"waiting for delayed work...");
 			/* We rely on the delayed work function running here,
 			 * and eventually calling
@@ -227,11 +213,12 @@ BOOL visor_periodic_work_stop(PERIODIC_WORK *periodic_work)
 			 * subsequently clear is_scheduled.
 			 */
 			SLEEPJIFFIES(10);
-			write_lock(&periodic_work->lock);
-		} else
-			periodic_work->want_to_stop = FALSE;
+			write_lock(&pw->lock);
+		} else {
+			pw->want_to_stop = FALSE;
+		}
 	}
-	write_unlock(&periodic_work->lock);
+	write_unlock(&pw->lock);
 	return stopped_something;
 }
 EXPORT_SYMBOL_GPL(visor_periodic_work_stop);
-- 
1.9.1

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

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

* [PATCH 2/9] staging: unisys: clean up timskmod.h
  2014-09-24 15:56 [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include Benjamin Romer
  2014-09-24 15:56 ` [PATCH 1/9] staging: unisys: clean up periodic_work.c and periodic_work.h Benjamin Romer
@ 2014-09-24 15:56 ` Benjamin Romer
  2014-09-24 15:56 ` [PATCH 3/9] staging: unisys: remove timskmodutils.h Benjamin Romer
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-09-24 15:56 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Eliminate all checkpatch.pl strict warnings and checks from timskmod.h. Some of
these warnings were generated by a block of unused locking macros, so the
entire set of macros were removed.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/include/timskmod.h | 91 +------------------------------
 1 file changed, 1 insertion(+), 90 deletions(-)

diff --git a/drivers/staging/unisys/include/timskmod.h b/drivers/staging/unisys/include/timskmod.h
index e5e4ecd..9e78311 100644
--- a/drivers/staging/unisys/include/timskmod.h
+++ b/drivers/staging/unisys/include/timskmod.h
@@ -114,7 +114,6 @@
 #define INFODEVX(devno, fmt, args...)     LOGINFDEVX(devno, fmt, ## args)
 #define DEBUGDEV(devname, fmt, args...)   DBGINFDEV(devname, fmt, ## args)
 
-
 /* @} */
 
 /** Verifies the consistency of your PRIVATEDEVICEDATA structure using
@@ -139,94 +138,6 @@
 	 ((fd)->sig1 == sizeof(PRIVATEFILEDATA)) &&    \
 	 ((fd)->sig2 == fd))
 
-/** Locks dd->lockDev if you havn't already locked it */
-#define LOCKDEV(dd)                                                    \
-	{                                                              \
-		if (!lockedDev) {				       \
-			spin_lock(&dd->lockDev);		       \
-			lockedDev = TRUE;			       \
-		}						       \
-	}
-
-/** Unlocks dd->lockDev if you previously locked it */
-#define UNLOCKDEV(dd)                                                  \
-	{                                                              \
-		if (lockedDev) {				       \
-			spin_unlock(&dd->lockDev);		       \
-			lockedDev = FALSE;			       \
-		}						       \
-	}
-
-/** Locks dd->lockDevISR if you havn't already locked it */
-#define LOCKDEVISR(dd)                                                 \
-	{                                                              \
-		if (!lockedDevISR) {				       \
-			spin_lock_irqsave(&dd->lockDevISR, flags);     \
-			lockedDevISR = TRUE;			       \
-		}						       \
-	}
-
-/** Unlocks dd->lockDevISR if you previously locked it */
-#define UNLOCKDEVISR(dd)						\
-	{								\
-		if (lockedDevISR) {					\
-			spin_unlock_irqrestore(&dd->lockDevISR, flags); \
-			lockedDevISR = FALSE;				\
-		}							\
-	}
-
-/** Locks LockGlobalISR if you havn't already locked it */
-#define LOCKGLOBALISR                                                  \
-	{                                                              \
-		if (!lockedGlobalISR) {				       \
-			spin_lock_irqsave(&LockGlobalISR, flags);      \
-			lockedGlobalISR = TRUE;			       \
-		}						       \
-	}
-
-/** Unlocks LockGlobalISR if you previously locked it */
-#define UNLOCKGLOBALISR                                                \
-	{                                                              \
-		if (lockedGlobalISR) {				       \
-			spin_unlock_irqrestore(&LockGlobalISR, flags); \
-			lockedGlobalISR = FALSE;		       \
-		}						       \
-	}
-
-/** Locks LockGlobal if you havn't already locked it */
-#define LOCKGLOBAL                                                     \
-	{                                                              \
-		if (!lockedGlobal) {				       \
-			spin_lock(&LockGlobal);			       \
-			lockedGlobal = TRUE;			       \
-		}						       \
-	}
-
-/** Unlocks LockGlobal if you previously locked it */
-#define UNLOCKGLOBAL                                                   \
-	{                                                              \
-		if (lockedGlobal) {				       \
-			spin_unlock(&LockGlobal);		       \
-			lockedGlobal = FALSE;			       \
-		}						       \
-	}
-
-/** Use this at the beginning of functions where you intend to
- *  use #LOCKDEV/#UNLOCKDEV, #LOCKDEVISR/#UNLOCKDEVISR,
- *  #LOCKGLOBAL/#UNLOCKGLOBAL, #LOCKGLOBALISR/#UNLOCKGLOBALISR.
- *
- *  Note that __attribute__((unused)) is how you tell GNU C to suppress
- *  any warning messages about the variable being unused.
- */
-#define LOCKPREAMBLE							\
-	ulong flags __attribute__((unused)) = 0;			\
-	BOOL lockedDev __attribute__((unused)) = FALSE;			\
-	BOOL lockedDevISR __attribute__((unused)) = FALSE;		\
-	BOOL lockedGlobal __attribute__((unused)) = FALSE;		\
-	BOOL lockedGlobalISR __attribute__((unused)) = FALSE
-
-
-
 /** Sleep for an indicated number of seconds (for use in kernel mode).
  *  @param x the number of seconds to sleep.
  */
@@ -244,7 +155,7 @@
 	} while (0)
 
 #ifndef max
-#define max(a, b) (((a) > (b)) ? (a):(b))
+#define max(a, b) (((a) > (b)) ? (a) : (b))
 #endif
 
 static inline struct cdev *cdev_alloc_init(struct module *owner,
-- 
1.9.1

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

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

* [PATCH 3/9] staging: unisys: remove timskmodutils.h
  2014-09-24 15:56 [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include Benjamin Romer
  2014-09-24 15:56 ` [PATCH 1/9] staging: unisys: clean up periodic_work.c and periodic_work.h Benjamin Romer
  2014-09-24 15:56 ` [PATCH 2/9] staging: unisys: clean up timskmod.h Benjamin Romer
@ 2014-09-24 15:56 ` Benjamin Romer
  2014-09-24 15:56 ` [PATCH 4/9] staging: unisys: clean up uisqueue.h Benjamin Romer
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-09-24 15:56 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Remove the entire timskmodutils.h file as it had a lot of checkpatch.pl
strict warnings and checks, and nearly all of the functions were not used
anywhere.

The unisys_spar_platform variable was moved to timskmod.h. References to the
removed timskmodutils.h were switched to timskmod.h instead. The unused
visor_seq_file_new_buffer() and visor_seq_file_done_buffer() functions defined
in timskmodutils.h were implemented in visorkmodutils.c, so these were removed
as well.

This patch will generate a warning about updating MAINTAINERS, but there does
not seem to be any need for that.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/channels/chanstub.c        |  2 +-
 drivers/staging/unisys/include/timskmod.h         |  2 +-
 drivers/staging/unisys/include/timskmodutils.h    | 77 -----------------------
 drivers/staging/unisys/virtpci/virtpci.c          |  2 +-
 drivers/staging/unisys/visorutil/visorkmodutils.c | 40 ------------
 5 files changed, 3 insertions(+), 120 deletions(-)
 delete mode 100644 drivers/staging/unisys/include/timskmodutils.h

diff --git a/drivers/staging/unisys/channels/chanstub.c b/drivers/staging/unisys/channels/chanstub.c
index 20521ce..d54c5d6 100644
--- a/drivers/staging/unisys/channels/chanstub.c
+++ b/drivers/staging/unisys/channels/chanstub.c
@@ -25,7 +25,7 @@
 
 #include "channel.h"
 #include "chanstub.h"
-#include "timskmodutils.h"
+#include "timskmod.h"
 #include "version.h"
 
 static __init int
diff --git a/drivers/staging/unisys/include/timskmod.h b/drivers/staging/unisys/include/timskmod.h
index 9e78311..b14494f 100644
--- a/drivers/staging/unisys/include/timskmod.h
+++ b/drivers/staging/unisys/include/timskmod.h
@@ -178,6 +178,6 @@ static inline struct cdev *cdev_alloc_init(struct module *owner,
 	return cdev;
 }
 
-#include "timskmodutils.h"
+extern int unisys_spar_platform;
 
 #endif
diff --git a/drivers/staging/unisys/include/timskmodutils.h b/drivers/staging/unisys/include/timskmodutils.h
deleted file mode 100644
index c316c94..0000000
--- a/drivers/staging/unisys/include/timskmodutils.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* timskmodutils.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.
- */
-
-#ifndef __TIMSKMODUTILS_H__
-#define __TIMSKMODUTILS_H__
-
-#include "timskmod.h"
-
-void *kmalloc_kernel(size_t siz);
-void  myprintk(const char *myDrvName, const char *devname,
-		const char *template, ...);
-
-/*--------------------------------*
- *---  GENERAL MESSAGEQ STUFF  ---*
- *--------------------------------*/
-
-struct MessageQEntry;
-
-/** the data structure used to hold an arbitrary data item that you want
- *  to place on a #MESSAGEQ.  Declare and initialize as follows:
- *
- *  This structure should be considered opaque; the client using it should
- *  never access the fields directly.
- *  Refer to these functions for more info:
- *
- *  @ingroup messageq
- */
-typedef struct MessageQEntry {
-	void *data;
-	struct MessageQEntry *qNext;
-	struct MessageQEntry *qPrev;
-} MESSAGEQENTRY;
-
-/** the data structure used to hold a FIFO queue of #MESSAGEQENTRY<b></b>s.
- *  Declare and initialize as follows:
- *  @code
- *      MESSAGEQ myQueue;
- *  @endcode
- *  This structure should be considered opaque; the client using it should
- *  never access the fields directly.
- *  Refer to these functions for more info:
- *
- *  @ingroup messageq
- */
-typedef struct MessageQ {
-	MESSAGEQENTRY *qHead;
-	MESSAGEQENTRY *qTail;
-	struct semaphore nQEntries;
-	spinlock_t       queueLock;
-} MESSAGEQ;
-
-char *cyclesToSeconds(u64 cycles, u64 cyclesPerSecond,
-		      char *buf, size_t bufsize);
-char *cyclesToIterationSeconds(u64 cycles, u64 cyclesPerSecond,
-			       u64 iterations, char *buf, size_t bufsize);
-char *cyclesToSomethingsPerSecond(u64 cycles, u64 cyclesPerSecond,
-				  u64 somethings, char *buf, size_t bufsize);
-struct seq_file *visor_seq_file_new_buffer(void *buf, size_t buf_size);
-void visor_seq_file_done_buffer(struct seq_file *m);
-
-extern int unisys_spar_platform;
-
-#endif
diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c
index 261a52f..5c56ae9 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -41,7 +41,7 @@
 #include <linux/debugfs.h>
 #include "version.h"
 #include "guestlinuxdebug.h"
-#include "timskmodutils.h"
+#include "timskmod.h"
 
 struct driver_private {
 	struct kobject kobj;
diff --git a/drivers/staging/unisys/visorutil/visorkmodutils.c b/drivers/staging/unisys/visorutil/visorkmodutils.c
index 10d77cb..d6815f9 100644
--- a/drivers/staging/unisys/visorutil/visorkmodutils.c
+++ b/drivers/staging/unisys/visorutil/visorkmodutils.c
@@ -46,46 +46,6 @@ void *kmalloc_kernel(size_t siz)
 	return kmalloc(siz, GFP_KERNEL | __GFP_NORETRY);
 }
 
-/*  Use these handy-dandy seq_file_xxx functions if you want to call some
- *  functions that write stuff into a seq_file, but you actually just want
- *  to dump that output into a buffer.  Use them as follows:
- *  - call visor_seq_file_new_buffer to create the seq_file (you supply the buf)
- *  - call whatever functions you want that take a seq_file as an argument
- *    (the buf you supplied will get the output data)
- *  - call visor_seq_file_done_buffer to dispose of your seq_file
- */
-struct seq_file *visor_seq_file_new_buffer(void *buf, size_t buf_size)
-{
-	struct seq_file *rc = NULL;
-	struct seq_file *m = kmalloc_kernel(sizeof(struct seq_file));
-
-	if (m == NULL) {
-		rc = NULL;
-		goto Away;
-	}
-	memset(m, 0, sizeof(struct seq_file));
-	m->buf = buf;
-	m->size = buf_size;
-	rc = m;
-Away:
-	if (rc == NULL) {
-		visor_seq_file_done_buffer(m);
-		m = NULL;
-	}
-	return rc;
-}
-EXPORT_SYMBOL_GPL(visor_seq_file_new_buffer);
-
-
-
-void visor_seq_file_done_buffer(struct seq_file *m)
-{
-	if (!m)
-		return;
-	kfree(m);
-}
-EXPORT_SYMBOL_GPL(visor_seq_file_done_buffer);
-
 static __init uint32_t
 visorutil_spar_detect(void)
 {
-- 
1.9.1

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

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

* [PATCH 4/9] staging: unisys: clean up uisqueue.h
  2014-09-24 15:56 [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include Benjamin Romer
                   ` (2 preceding siblings ...)
  2014-09-24 15:56 ` [PATCH 3/9] staging: unisys: remove timskmodutils.h Benjamin Romer
@ 2014-09-24 15:56 ` Benjamin Romer
  2014-09-24 15:56 ` [PATCH 5/9] staging: unisys: remove blank lines from uisthread.h Benjamin Romer
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-09-24 15:56 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix many of the checkpatch.pl strict warnings and checks generated. The
remaining strict checks require large-scale refactoring of structures, so
these will be fixed in subequent patches.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/include/uisqueue.h | 54 ++++++++++++++-----------------
 drivers/staging/unisys/uislib/uisqueue.c  |  8 ++---
 drivers/staging/unisys/virthba/virthba.c  | 16 ++++-----
 3 files changed, 37 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/unisys/include/uisqueue.h b/drivers/staging/unisys/include/uisqueue.h
index 8983407..b649b35 100644
--- a/drivers/staging/unisys/include/uisqueue.h
+++ b/drivers/staging/unisys/include/uisqueue.h
@@ -34,7 +34,6 @@
 #include "controlvmcompletionstatus.h"
 
 struct uisqueue_info {
-
 	CHANNEL_HEADER __iomem *chan;
 	/* channel containing queues in which scsi commands &
 	 * responses are queued
@@ -48,13 +47,13 @@ struct uisqueue_info {
 	u64 non_empty_wakeup_cnt;
 
 	struct {
-		SIGNAL_QUEUE_HEADER Reserved1;	/*  */
-		SIGNAL_QUEUE_HEADER Reserved2;	/*  */
+		SIGNAL_QUEUE_HEADER reserved1;	/*  */
+		SIGNAL_QUEUE_HEADER reserved2;	/*  */
 	} safe_uis_queue;
 	unsigned int (*send_int_if_needed)(struct uisqueue_info *info,
 					   unsigned int whichcqueue,
-					   unsigned char issueInterruptIfEmpty,
-					   u64 interruptHandle,
+					   unsigned char interrupt_if_empty,
+					   u64 interrupt_handle,
 					   unsigned char io_termination);
 };
 
@@ -76,25 +75,25 @@ struct uisqueue_info {
 		".previous\n"                   \
 		"661:\n\tlock; "
 
-unsigned long long uisqueue_InterlockedOr(unsigned long long __iomem *Target,
-					  unsigned long long Set);
-unsigned long long uisqueue_InterlockedAnd(unsigned long long __iomem *Target,
-					   unsigned long long Set);
+unsigned long long uisqueue_interlocked_or(unsigned long long __iomem *target,
+					   unsigned long long set);
+unsigned long long uisqueue_interlocked_and(unsigned long long __iomem *target,
+					    unsigned long long set);
 
 unsigned int uisqueue_send_int_if_needed(struct uisqueue_info *pqueueinfo,
 					 unsigned int whichqueue,
-					 unsigned char issueInterruptIfEmpty,
-					 u64 interruptHandle,
+					 unsigned char interrupt_if_empty,
+					 u64 interrupt_handle,
 					 unsigned char io_termination);
 
 int uisqueue_put_cmdrsp_with_lock_client(struct uisqueue_info *queueinfo,
 					 struct uiscmdrsp *cmdrsp,
 					 unsigned int queue,
 					 void *insertlock,
-					 unsigned char issueInterruptIfEmpty,
-					 u64 interruptHandle,
+					 unsigned char interrupt_if_empty,
+					 u64 interrupt_handle,
 					 char oktowait,
-					 u8 *channelId);
+					 u8 *channel_id);
 
 /* uisqueue_get_cmdrsp gets the cmdrsp entry at the head of the queue
  * and copies it to the area pointed by cmdrsp param.
@@ -155,10 +154,10 @@ struct device_info {
 	unsigned long long last_on_list_cnt;
 };
 
-typedef enum {
+enum switch_type {
 	RECOVERY_LAN = 1,
 	IB_LAN = 2
-} SWITCH_TYPE;
+};
 
 struct bus_info {
 	u32 busNo, deviceCount;
@@ -176,8 +175,8 @@ struct bus_info {
 				 * by IOVM; 0 otherwise... */
 };
 
-#define DEDICATED_SWITCH(pSwitch) ((pSwitch->extPortCount == 1) &&	\
-				   (pSwitch->intPortCount == 1))
+#define DEDICATED_SWITCH(switch) ((switch->extPortCount == 1) &&	\
+				   (switch->intPortCount == 1))
 
 struct sn_list_entry {
 	struct uisscsi_dest pdest;	/* scsi bus, target, lun for
@@ -189,7 +188,7 @@ struct sn_list_entry {
 	struct sn_list_entry *next;
 };
 
-struct networkPolicy {
+struct network_policy {
 	u32 promiscuous:1;
 	u32 macassign:1;
 	u32 peerforwarding:1;
@@ -204,8 +203,7 @@ struct networkPolicy {
  * code that processes the ControlVm channel messages.
  */
 
-
-typedef enum {
+enum iopart_msg_type {
 	IOPART_ADD_VNIC,
 	IOPART_DEL_VNIC,
 	IOPART_DEL_ALL_VNICS,
@@ -225,7 +223,7 @@ typedef enum {
 	IOPART_RESUME_VDISK,
 	IOPART_ADD_DEVICE,	/* add generic device */
 	IOPART_DEL_DEVICE,	/* del generic device */
-} IOPART_MSG_TYPE;
+};
 
 struct add_virt_iopart {
 	void *chanptr;		/* pointer to data channel */
@@ -249,7 +247,7 @@ struct add_virt_iopart {
 
 	u8 useG2GCopy;		/* Used to determine if a virtual HBA
 				 * needs to use G2G copy. */
-	u8 Filler[7];
+	u8 filler[7];
 
 	u32 busNo;
 	u32 devNo;
@@ -303,8 +301,7 @@ struct del_switch_iopart {	     /* destroy switch */
 };
 
 struct io_msgs {
-
-	IOPART_MSG_TYPE msgtype;
+	enum iopart_msg_type msgtype;
 
 	/* additional params needed by some messages */
 	union {
@@ -335,7 +332,7 @@ struct io_msgs {
 * the ControlVm channel messages.
 */
 
-typedef enum {
+enum guestpart_msg_type {
 	GUEST_ADD_VBUS,
 	GUEST_ADD_VHBA,
 	GUEST_ADD_VNIC,
@@ -350,7 +347,7 @@ typedef enum {
 	GUEST_PAUSE_VNIC,
 	GUEST_RESUME_VHBA,
 	GUEST_RESUME_VNIC
-} GUESTPART_MSG_TYPE;
+};
 
 struct add_vbus_guestpart {
 	void __iomem *chanptr;		/* pointer to data channel for bus -
@@ -400,8 +397,7 @@ struct init_chipset_guestpart {
 };
 
 struct guest_msgs {
-
-	GUESTPART_MSG_TYPE msgtype;
+	enum guestpart_msg_type msgtype;
 
 	/* additional params needed by messages */
 	union {
diff --git a/drivers/staging/unisys/uislib/uisqueue.c b/drivers/staging/unisys/uislib/uisqueue.c
index 83f8761..cde6cd3 100644
--- a/drivers/staging/unisys/uislib/uisqueue.c
+++ b/drivers/staging/unisys/uislib/uisqueue.c
@@ -34,7 +34,7 @@
 /* Exported functions                                */
 /*****************************************************/
 unsigned long long
-uisqueue_InterlockedOr(unsigned long long __iomem *Target,
+uisqueue_interlocked_or(unsigned long long __iomem *Target,
 		       unsigned long long Set)
 {
 	unsigned long long i;
@@ -49,10 +49,10 @@ uisqueue_InterlockedOr(unsigned long long __iomem *Target,
 
 	return j;
 }
-EXPORT_SYMBOL_GPL(uisqueue_InterlockedOr);
+EXPORT_SYMBOL_GPL(uisqueue_interlocked_or);
 
 unsigned long long
-uisqueue_InterlockedAnd(unsigned long long __iomem *Target,
+uisqueue_interlocked_and(unsigned long long __iomem *Target,
 			unsigned long long Set)
 {
 	unsigned long long i;
@@ -67,7 +67,7 @@ uisqueue_InterlockedAnd(unsigned long long __iomem *Target,
 
 	return j;
 }
-EXPORT_SYMBOL_GPL(uisqueue_InterlockedAnd);
+EXPORT_SYMBOL_GPL(uisqueue_interlocked_and);
 
 static u8
 do_locked_client_insert(struct uisqueue_info *queueinfo,
diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c
index ce672c5..938e2c8 100644
--- a/drivers/staging/unisys/virthba/virthba.c
+++ b/drivers/staging/unisys/virthba/virthba.c
@@ -436,7 +436,7 @@ virthba_ISR(int irq, void *dev_id)
 		0)) {
 		virthbainfo->interrupts_disabled++;
 		mask = ~ULTRA_CHANNEL_ENABLE_INTS;
-		rc1 = uisqueue_InterlockedAnd(virthbainfo->flags_addr, mask);
+		rc1 = uisqueue_interlocked_and(virthbainfo->flags_addr, mask);
 	}
 	if (visor_signalqueue_empty(pChannelHeader, IOCHAN_FROM_IOPART)) {
 		virthbainfo->interrupts_notme++;
@@ -627,9 +627,9 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id)
 		       virthbainfo->interrupt_vector);
 		mask = ~(ULTRA_IO_CHANNEL_IS_POLLING |
 			 ULTRA_IO_DRIVER_DISABLES_INTS);
-		uisqueue_InterlockedAnd(Features_addr, mask);
+		uisqueue_interlocked_and(Features_addr, mask);
 		mask = ULTRA_IO_DRIVER_ENABLES_INTS;
-		uisqueue_InterlockedOr(Features_addr, mask);
+		uisqueue_interlocked_or(Features_addr, mask);
 		rsltq_wait_usecs = 4000000;
 	}
 
@@ -1353,7 +1353,7 @@ process_incoming_rsps(void *v)
 		atomic_set(&virthbainfo->interrupt_rcvd, 0);
 		/* drain queue */
 		drain_queue(virthbainfo, dc, cmdrsp);
-		rc1 = uisqueue_InterlockedOr(virthbainfo->flags_addr, mask);
+		rc1 = uisqueue_interlocked_or(virthbainfo->flags_addr, mask);
 		if (dc->threadinfo.should_stop)
 			break;
 	}
@@ -1457,16 +1457,16 @@ static ssize_t enable_ints_write(struct file *file,
 			if (new_value == 1) {
 				mask = ~(ULTRA_IO_CHANNEL_IS_POLLING |
 					 ULTRA_IO_DRIVER_DISABLES_INTS);
-				uisqueue_InterlockedAnd(Features_addr, mask);
+				uisqueue_interlocked_and(Features_addr, mask);
 				mask = ULTRA_IO_DRIVER_ENABLES_INTS;
-				uisqueue_InterlockedOr(Features_addr, mask);
+				uisqueue_interlocked_or(Features_addr, mask);
 				rsltq_wait_usecs = 4000000;
 			} else {
 				mask = ~(ULTRA_IO_DRIVER_ENABLES_INTS |
 					 ULTRA_IO_DRIVER_DISABLES_INTS);
-				uisqueue_InterlockedAnd(Features_addr, mask);
+				uisqueue_interlocked_and(Features_addr, mask);
 				mask = ULTRA_IO_CHANNEL_IS_POLLING;
-				uisqueue_InterlockedOr(Features_addr, mask);
+				uisqueue_interlocked_or(Features_addr, mask);
 				rsltq_wait_usecs = 4000;
 			}
 		}
-- 
1.9.1

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

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

* [PATCH 5/9] staging: unisys: remove blank lines from uisthread.h
  2014-09-24 15:56 [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include Benjamin Romer
                   ` (3 preceding siblings ...)
  2014-09-24 15:56 ` [PATCH 4/9] staging: unisys: clean up uisqueue.h Benjamin Romer
@ 2014-09-24 15:56 ` Benjamin Romer
  2014-09-24 15:56 ` [PATCH 6/9] staging: unisys: clean up uisutils.h Benjamin Romer
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-09-24 15:56 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Remove a few double blank lines from uisthread.h to clean up all of the
checkpatch.pl output from this file.

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

diff --git a/drivers/staging/unisys/include/uisthread.h b/drivers/staging/unisys/include/uisthread.h
index 2683777..aa86ade 100644
--- a/drivers/staging/unisys/include/uisthread.h
+++ b/drivers/staging/unisys/include/uisthread.h
@@ -19,11 +19,9 @@
 /* Unisys thread utilities header                                            */
 /*****************************************************************************/
 
-
 #ifndef __UISTHREAD_H__
 #define __UISTHREAD_H__
 
-
 #include "linux/completion.h"
 
 struct uisthread_info {
@@ -33,7 +31,6 @@ struct uisthread_info {
 	struct completion has_stopped;
 };
 
-
 /* returns 0 for failure, 1 for success */
 int uisthread_start(
 	struct uisthread_info *thrinfo,
-- 
1.9.1

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

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

* [PATCH 6/9] staging: unisys: clean up uisutils.h
  2014-09-24 15:56 [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include Benjamin Romer
                   ` (4 preceding siblings ...)
  2014-09-24 15:56 ` [PATCH 5/9] staging: unisys: remove blank lines from uisthread.h Benjamin Romer
@ 2014-09-24 15:56 ` Benjamin Romer
  2014-09-24 15:56 ` [PATCH 7/9] staging: unisys: clean up uniklog.h Benjamin Romer
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-09-24 15:56 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix as many checkpatch.pl strict warnings and checks as possible in uisutils.h,
as well as correcting references to renamed variables, structures, and
functions.

The remaining warnings are because of camel-cased members in structures defined
by other files. These will be corrected in subsequent patches when those
structures are corrected.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/include/uisqueue.h          |   4 +-
 drivers/staging/unisys/include/uisutils.h          | 147 +++++++++++----------
 drivers/staging/unisys/uislib/uislib.c             |  38 +++---
 drivers/staging/unisys/uislib/uisutils.c           | 114 ++++++++--------
 drivers/staging/unisys/visorchipset/file.c         |   4 +-
 .../unisys/visorchipset/visorchipset_main.c        |   2 +-
 6 files changed, 159 insertions(+), 150 deletions(-)

diff --git a/drivers/staging/unisys/include/uisqueue.h b/drivers/staging/unisys/include/uisqueue.h
index b649b35..2da419d 100644
--- a/drivers/staging/unisys/include/uisqueue.h
+++ b/drivers/staging/unisys/include/uisqueue.h
@@ -199,7 +199,7 @@ struct network_policy {
 };
 
 /*
- * IO messages sent to UisnicControlChanFunc & UissdControlChanFunc by
+ * IO messages sent to uisnic_control_chan_func & uissd_control_chan_func by
  * code that processes the ControlVm channel messages.
  */
 
@@ -328,7 +328,7 @@ struct io_msgs {
 };
 
 /*
-* Guest messages sent to VirtControlChanFunc by code that processes
+* Guest messages sent to virt_control_chan_func by code that processes
 * the ControlVm channel messages.
 */
 
diff --git a/drivers/staging/unisys/include/uisutils.h b/drivers/staging/unisys/include/uisutils.h
index f1a1b0d..e0143e9 100644
--- a/drivers/staging/unisys/include/uisutils.h
+++ b/drivers/staging/unisys/include/uisutils.h
@@ -43,39 +43,40 @@
 /* global function pointers that act as callback functions into
  * uisnicmod, uissdmod, and virtpcimod
  */
-extern int (*UisnicControlChanFunc)(struct io_msgs *);
-extern int (*UissdControlChanFunc)(struct io_msgs *);
-extern int (*VirtControlChanFunc)(struct guest_msgs *);
+extern int (*uisnic_control_chan_func)(struct io_msgs *);
+extern int (*uissd_control_chan_func)(struct io_msgs *);
+extern int (*virt_control_chan_func)(struct guest_msgs *);
 
 /* Return values of above callback functions: */
 #define CCF_ERROR        0	/* completed and failed */
 #define CCF_OK           1	/* completed successfully */
 #define CCF_PENDING      2	/* operation still pending */
-extern atomic_t UisUtils_Registered_Services;
+extern atomic_t uisutils_registered_services;
 
-typedef unsigned int MACARRAY[MAX_MACADDR_LEN];
-typedef struct ReqHandlerInfo_struct {
-	uuid_le switchTypeGuid;
+struct req_handler_info {
+	uuid_le switch_type_guid;
 	int (*controlfunc)(struct io_msgs *);
 	unsigned long min_channel_bytes;
-	int (*Server_Channel_Ok)(unsigned long channelBytes);
-	int (*Server_Channel_Init)
-	 (void *x, unsigned char *clientStr, u32 clientStrLen, u64 bytes);
+	int (*server_channel_ok)(unsigned long channel_bytes);
+	int (*server_channel_init)(void *x, unsigned char *client_str,
+				   u32 client_str_len, u64 bytes);
 	char switch_type_name[99];
 	struct list_head list_link;	/* links into ReqHandlerInfo_list */
-} ReqHandlerInfo_t;
-
-ReqHandlerInfo_t *ReqHandlerAdd(uuid_le switchTypeGuid,
-				const char *switch_type_name,
-				int (*controlfunc)(struct io_msgs *),
-				unsigned long min_channel_bytes,
-				int (*Server_Channel_Ok)(unsigned long
-							 channelBytes),
-				int (*Server_Channel_Init)
-				 (void *x, unsigned char *clientStr,
-				  u32 clientStrLen, u64 bytes));
-ReqHandlerInfo_t *ReqHandlerFind(uuid_le switchTypeGuid);
-int ReqHandlerDel(uuid_le switchTypeGuid);
+};
+
+struct req_handler_info *req_handler_add(uuid_le switch_type_guid,
+					 const char *switch_type_name,
+					 int (*controlfunc)(struct io_msgs *),
+					 unsigned long min_channel_bytes,
+					 int (*server_channel_ok)
+						(unsigned long channel_bytes),
+					 int (*server_channel_init)
+						(void *x,
+						 unsigned char *client_str,
+						 u32 client_str_len,
+						 u64 bytes));
+struct req_handler_info *req_handler_find(uuid_le switch_type_guid);
+int req_handler_del(uuid_le switch_type_guid);
 
 #define uislib_ioremap_cache(addr, size) \
 	dbg_ioremap_cache(addr, size, __FILE__, __LINE__)
@@ -114,46 +115,47 @@ int uisutil_add_proc_line_ex(int *total, char **buffer, int *buffer_remaining,
 			     char *format, ...);
 
 int uisctrl_register_req_handler(int type, void *fptr,
-				 ULTRA_VBUS_DEVICEINFO *chipset_DriverInfo);
-int uisctrl_register_req_handler_ex(uuid_le switchTypeGuid,
+				 ULTRA_VBUS_DEVICEINFO *chipset_driver_info);
+int uisctrl_register_req_handler_ex(uuid_le switch_type_guid,
 				    const char *switch_type_name,
 				    int (*fptr)(struct io_msgs *),
 				    unsigned long min_channel_bytes,
-				    int (*Server_Channel_Ok)(unsigned long
-							     channelBytes),
-				    int (*Server_Channel_Init)
-				    (void *x, unsigned char *clientStr,
-				     u32 clientStrLen, u64 bytes),
-				    ULTRA_VBUS_DEVICEINFO *chipset_DriverInfo);
-
-int uisctrl_unregister_req_handler_ex(uuid_le switchTypeGuid);
+				    int (*server_channel_ok)(unsigned long
+							     channel_bytes),
+				    int (*server_channel_init)
+				    (void *x, unsigned char *client_str,
+				     u32 client_str_len, u64 bytes),
+				    ULTRA_VBUS_DEVICEINFO *chipset_driver_info);
+
+int uisctrl_unregister_req_handler_ex(uuid_le switch_type_guid);
 unsigned char *util_map_virt(struct phys_info *sg);
 void util_unmap_virt(struct phys_info *sg);
 unsigned char *util_map_virt_atomic(struct phys_info *sg);
 void util_unmap_virt_atomic(void *buf);
-int uislib_server_inject_add_vnic(u32 switchNo, u32 BusNo, u32 numIntPorts,
-				  u32 numExtPorts, MACARRAY pmac[],
+int uislib_server_inject_add_vnic(u32 switch_no, u32 bus_no, u32 num_int_ports,
+				  u32 num_ext_ports,
+				  unsigned int **pmac,
 				  pCHANNEL_HEADER **chan);
-void uislib_server_inject_del_vnic(u32 switchNo, u32 busNo, u32 numIntPorts,
-				   u32 numExtPorts);
-int uislib_client_inject_add_bus(u32 busNo, uuid_le instGuid,
-				 u64 channelAddr, ulong nChannelBytes);
-int  uislib_client_inject_del_bus(u32 busNo);
+void uislib_server_inject_del_vnic(u32 switch_no, u32 bus_no, u32 num_int_ports,
+				   u32 num_ext_ports);
+int uislib_client_inject_add_bus(u32 bus_no, uuid_le inst_guid,
+				 u64 channel_addr, ulong n_channel_bytes);
+int  uislib_client_inject_del_bus(u32 bus_no);
 
-int uislib_client_inject_add_vhba(u32 busNo, u32 devNo,
+int uislib_client_inject_add_vhba(u32 bus_no, u32 dev_no,
 				  u64 phys_chan_addr, u32 chan_bytes,
-				  int is_test_addr, uuid_le instGuid,
+				  int is_test_addr, uuid_le inst_guid,
 				  struct InterruptInfo *intr);
-int  uislib_client_inject_pause_vhba(u32 busNo, u32 devNo);
-int  uislib_client_inject_resume_vhba(u32 busNo, u32 devNo);
-int uislib_client_inject_del_vhba(u32 busNo, u32 devNo);
-int uislib_client_inject_add_vnic(u32 busNo, u32 devNo,
+int  uislib_client_inject_pause_vhba(u32 bus_no, u32 dev_no);
+int  uislib_client_inject_resume_vhba(u32 bus_no, u32 dev_no);
+int uislib_client_inject_del_vhba(u32 bus_no, u32 dev_no);
+int uislib_client_inject_add_vnic(u32 bus_no, u32 dev_no,
 				  u64 phys_chan_addr, u32 chan_bytes,
-				  int is_test_addr, uuid_le instGuid,
+				  int is_test_addr, uuid_le inst_guid,
 				  struct InterruptInfo *intr);
-int uislib_client_inject_pause_vnic(u32 busNo, u32 devNo);
-int uislib_client_inject_resume_vnic(u32 busNo, u32 devNo);
-int uislib_client_inject_del_vnic(u32 busNo, u32 devNo);
+int uislib_client_inject_pause_vnic(u32 bus_no, u32 dev_no);
+int uislib_client_inject_resume_vnic(u32 bus_no, u32 dev_no);
+int uislib_client_inject_del_vnic(u32 bus_no, u32 dev_no);
 #ifdef STORAGE_CHANNEL
 u64 uislib_storage_channel(int client_id);
 #endif
@@ -182,11 +184,14 @@ struct chaninfo {
 	set_current_state(TASK_INTERRUPTIBLE); \
 	schedule_timeout(msecs_to_jiffies(x)); \
 }
+
 #define UIS_THREAD_WAIT_USEC(x) { \
 	set_current_state(TASK_INTERRUPTIBLE); \
 	schedule_timeout(usecs_to_jiffies(x)); \
 }
+
 #define UIS_THREAD_WAIT UIS_THREAD_WAIT_MSEC(5)
+
 #define UIS_THREAD_WAIT_SEC(x) { \
 	set_current_state(TASK_INTERRUPTIBLE); \
 	schedule_timeout((x)*HZ); \
@@ -222,7 +227,7 @@ unsigned int uisutil_copy_fragsinfo_from_skb(unsigned char *calling_ctx,
 					     struct phys_info frags[]);
 
 static inline unsigned int
-Issue_VMCALL_IO_CONTROLVM_ADDR(u64 *ControlAddress, u32 *ControlBytes)
+issue_vmcall_io_controlvm_addr(u64 *control_address, u32 *control_bytes)
 {
 	VMCALL_IO_CONTROLVM_ADDR_PARAMS params;
 	int result = VMCALL_SUCCESS;
@@ -231,13 +236,13 @@ Issue_VMCALL_IO_CONTROLVM_ADDR(u64 *ControlAddress, u32 *ControlBytes)
 	physaddr = virt_to_phys(&params);
 	ISSUE_IO_VMCALL(VMCALL_IO_CONTROLVM_ADDR, physaddr, result);
 	if (VMCALL_SUCCESSFUL(result)) {
-		*ControlAddress = params.ChannelAddress;
-		*ControlBytes = params.ChannelBytes;
+		*control_address = params.ChannelAddress;
+		*control_bytes = params.ChannelBytes;
 	}
 	return result;
 }
 
-static inline unsigned int Issue_VMCALL_IO_DIAG_ADDR(u64 *DiagChannelAddress)
+static inline unsigned int issue_vmcall_io_diag_addr(u64 *channel_address)
 {
 	VMCALL_IO_DIAG_ADDR_PARAMS params;
 	int result = VMCALL_SUCCESS;
@@ -246,12 +251,12 @@ static inline unsigned int Issue_VMCALL_IO_DIAG_ADDR(u64 *DiagChannelAddress)
 	physaddr = virt_to_phys(&params);
 	ISSUE_IO_VMCALL(VMCALL_IO_DIAG_ADDR, physaddr, result);
 	if (VMCALL_SUCCESSFUL(result))
-		*DiagChannelAddress = params.ChannelAddress;
+		*channel_address = params.ChannelAddress;
 	return result;
 }
 
 static inline unsigned int
-Issue_VMCALL_IO_VISORSERIAL_ADDR(u64 *DiagChannelAddress)
+issue_vmcall_io_visorserial_addr(u64 *channel_address)
 {
 	VMCALL_IO_VISORSERIAL_ADDR_PARAMS params;
 	int result = VMCALL_SUCCESS;
@@ -260,11 +265,11 @@ Issue_VMCALL_IO_VISORSERIAL_ADDR(u64 *DiagChannelAddress)
 	physaddr = virt_to_phys(&params);
 	ISSUE_IO_VMCALL(VMCALL_IO_VISORSERIAL_ADDR, physaddr, result);
 	if (VMCALL_SUCCESSFUL(result))
-		*DiagChannelAddress = params.ChannelAddress;
+		*channel_address = params.ChannelAddress;
 	return result;
 }
 
-static inline s64 Issue_VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET(void)
+static inline s64 issue_vmcall_query_guest_virtual_time_offset(void)
 {
 	u64 result = VMCALL_SUCCESS;
 	u64 physaddr = 0;
@@ -274,7 +279,7 @@ static inline s64 Issue_VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET(void)
 	return result;
 }
 
-static inline s64 Issue_VMCALL_MEASUREMENT_DO_NOTHING(void)
+static inline s64 issue_vmcall_measurement_do_nothing(void)
 {
 	u64 result = VMCALL_SUCCESS;
 	u64 physaddr = 0;
@@ -284,14 +289,14 @@ static inline s64 Issue_VMCALL_MEASUREMENT_DO_NOTHING(void)
 }
 
 struct log_info_t {
-	volatile unsigned long long last_cycles;
+	unsigned long long last_cycles;
 	unsigned long long delta_sum[64];
 	unsigned long long delta_cnt[64];
 	unsigned long long max_delta[64];
 	unsigned long long min_delta[64];
 };
 
-static inline int Issue_VMCALL_UPDATE_PHYSICAL_TIME(u64 adjustment)
+static inline int issue_vmcall_update_physical_time(u64 adjustment)
 {
 	int result = VMCALL_SUCCESS;
 
@@ -300,20 +305,20 @@ static inline int Issue_VMCALL_UPDATE_PHYSICAL_TIME(u64 adjustment)
 }
 
 static inline unsigned int
-Issue_VMCALL_CHANNEL_MISMATCH(const char *ChannelName,
-			      const char *ItemName,
-			      u32 SourceLineNumber, const char *path_n_fn)
+issue_vmcall_channel_mismatch(const char *channel_name,
+			      const char *item_name,
+			      u32 line_no, const char *path_n_fn)
 {
 	VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS params;
 	int result = VMCALL_SUCCESS;
 	u64 physaddr;
 	char *last_slash = NULL;
 
-	strlcpy(params.ChannelName, ChannelName,
+	strlcpy(params.ChannelName, channel_name,
 		lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS, ChannelName));
-	strlcpy(params.ItemName, ItemName,
+	strlcpy(params.ItemName, item_name,
 		lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS, ItemName));
-	params.SourceLineNumber = SourceLineNumber;
+	params.SourceLineNumber = line_no;
 
 	last_slash = strrchr(path_n_fn, '/');
 	if (last_slash != NULL) {
@@ -332,7 +337,7 @@ Issue_VMCALL_CHANNEL_MISMATCH(const char *ChannelName,
 	return result;
 }
 
-static inline unsigned int Issue_VMCALL_FATAL_BYE_BYE(void)
+static inline unsigned int issue_vmcall_fatal_bye_bye(void)
 {
 	int result = VMCALL_SUCCESS;
 	u64 physaddr = 0;
@@ -349,10 +354,10 @@ void uislib_cache_free(struct kmem_cache *cur_pool, void *p, char *fn, int ln);
 #define UISCACHEFREE(cur_pool, p) \
 	uislib_cache_free(cur_pool, p, __FILE__, __LINE__)
 
-void uislib_enable_channel_interrupts(u32 busNo, u32 devNo,
+void uislib_enable_channel_interrupts(u32 bus_no, u32 dev_no,
 				      int (*interrupt)(void *),
 				      void *interrupt_context);
-void uislib_disable_channel_interrupts(u32 busNo, u32 devNo);
-void uislib_force_channel_interrupt(u32 busNo, u32 devNo);
+void uislib_disable_channel_interrupts(u32 bus_no, u32 dev_no);
+void uislib_force_channel_interrupt(u32 bus_no, u32 dev_no);
 
 #endif /* __UISUTILS__H__ */
diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c
index 1823f6f..5803641 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -57,7 +57,7 @@
 #define __MYFILE__ "uislib.c"
 
 /* global function pointers that act as callback functions into virtpcimod */
-int (*VirtControlChanFunc)(struct guest_msgs *);
+int (*virt_control_chan_func)(struct guest_msgs *);
 
 static int ProcReadBufferValid;
 static char *ProcReadBuffer;	/* Note this MUST be global,
@@ -238,14 +238,14 @@ create_bus(CONTROLVM_MESSAGE *msg, char *buf)
 		cmd.add_vbus.deviceCount = deviceCount;
 		cmd.add_vbus.busTypeGuid = msg->cmd.createBus.busDataTypeGuid;
 		cmd.add_vbus.busInstGuid = msg->cmd.createBus.busInstGuid;
-		if (!VirtControlChanFunc) {
+		if (!virt_control_chan_func) {
 			LOGERR("CONTROLVM_BUS_CREATE Failed: virtpci callback not registered.");
 			POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, bus->busNo,
 					 POSTCODE_SEVERITY_ERR);
 			kfree(bus);
 			return CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_FAILURE;
 		}
-		if (!VirtControlChanFunc(&cmd)) {
+		if (!virt_control_chan_func(&cmd)) {
 			LOGERR("CONTROLVM_BUS_CREATE Failed: virtpci GUEST_ADD_VBUS returned error.");
 			POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, bus->busNo,
 					 POSTCODE_SEVERITY_ERR);
@@ -316,11 +316,11 @@ destroy_bus(CONTROLVM_MESSAGE *msg, char *buf)
 	   with this bus. */
 	cmd.msgtype = GUEST_DEL_VBUS;
 	cmd.del_vbus.busNo = busNo;
-	if (!VirtControlChanFunc) {
+	if (!virt_control_chan_func) {
 		LOGERR("CONTROLVM_BUS_DESTROY Failed: virtpci callback not registered.");
 		return CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_FAILURE;
 	}
-	if (!VirtControlChanFunc(&cmd)) {
+	if (!virt_control_chan_func(&cmd)) {
 		LOGERR("CONTROLVM_BUS_DESTROY Failed: virtpci GUEST_DEL_VBUS returned error.");
 		return CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_CALLBACK_ERROR;
 	}
@@ -352,7 +352,7 @@ create_device(CONTROLVM_MESSAGE *msg, char *buf)
 	u32 busNo, devNo;
 	int result = CONTROLVM_RESP_SUCCESS;
 	u64 minSize = MIN_IO_CHANNEL_SIZE;
-	ReqHandlerInfo_t *pReqHandler;
+	struct req_handler_info *pReqHandler;
 
 	busNo = msg->cmd.createDevice.busNo;
 	devNo = msg->cmd.createDevice.devNo;
@@ -379,7 +379,7 @@ create_device(CONTROLVM_MESSAGE *msg, char *buf)
 	if (msg->hdr.Flags.testMessage)
 		dev->chanptr = (void __iomem *)__va(dev->channelAddr);
 	else {
-		pReqHandler = ReqHandlerFind(dev->channelTypeGuid);
+		pReqHandler = req_handler_find(dev->channelTypeGuid);
 		if (pReqHandler)
 			/* generic service handler registered for this
 			 * channel
@@ -500,7 +500,7 @@ create_device(CONTROLVM_MESSAGE *msg, char *buf)
 					goto Away;
 				}
 
-				if (!VirtControlChanFunc) {
+				if (!virt_control_chan_func) {
 					LOGERR("CONTROLVM_DEVICE_CREATE Failed: virtpci callback not registered.");
 					POSTCODE_LINUX_4
 					    (DEVICE_CREATE_FAILURE_PC, devNo,
@@ -509,7 +509,7 @@ create_device(CONTROLVM_MESSAGE *msg, char *buf)
 					goto Away;
 				}
 
-				if (!VirtControlChanFunc(&cmd)) {
+				if (!virt_control_chan_func(&cmd)) {
 					LOGERR("CONTROLVM_DEVICE_CREATE Failed: virtpci GUEST_ADD_[VHBA||VNIC] returned error.");
 					POSTCODE_LINUX_4
 					    (DEVICE_CREATE_FAILURE_PC, devNo,
@@ -596,11 +596,11 @@ pause_device(CONTROLVM_MESSAGE *msg)
 			LOGERR("CONTROLVM_DEVICE_CHANGESTATE:pause Failed: unknown channelTypeGuid.\n");
 			return CONTROLVM_RESP_ERROR_CHANNEL_TYPE_UNKNOWN;
 		}
-		if (!VirtControlChanFunc) {
+		if (!virt_control_chan_func) {
 			LOGERR("CONTROLVM_DEVICE_CHANGESTATE Failed: virtpci callback not registered.");
 			return CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_FAILURE;
 		}
-		if (!VirtControlChanFunc(&cmd)) {
+		if (!virt_control_chan_func(&cmd)) {
 			LOGERR("CONTROLVM_DEVICE_CHANGESTATE:pause Failed: virtpci GUEST_PAUSE_[VHBA||VNIC] returned error.");
 			return
 			  CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_CALLBACK_ERROR;
@@ -665,11 +665,11 @@ resume_device(CONTROLVM_MESSAGE *msg)
 			LOGERR("CONTROLVM_DEVICE_CHANGESTATE:resume Failed: unknown channelTypeGuid.\n");
 			return CONTROLVM_RESP_ERROR_CHANNEL_TYPE_UNKNOWN;
 		}
-		if (!VirtControlChanFunc) {
+		if (!virt_control_chan_func) {
 			LOGERR("CONTROLVM_DEVICE_CHANGESTATE Failed: virtpci callback not registered.");
 			return CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_FAILURE;
 		}
-		if (!VirtControlChanFunc(&cmd)) {
+		if (!virt_control_chan_func(&cmd)) {
 			LOGERR("CONTROLVM_DEVICE_CHANGESTATE:resume Failed: virtpci GUEST_RESUME_[VHBA||VNIC] returned error.");
 			return
 			  CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_CALLBACK_ERROR;
@@ -736,12 +736,12 @@ destroy_device(CONTROLVM_MESSAGE *msg, char *buf)
 			return
 			    CONTROLVM_RESP_ERROR_CHANNEL_TYPE_UNKNOWN;
 		}
-		if (!VirtControlChanFunc) {
+		if (!virt_control_chan_func) {
 			LOGERR("CONTROLVM_DEVICE_DESTORY Failed: virtpci callback not registered.");
 			return
 			    CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_FAILURE;
 		}
-		if (!VirtControlChanFunc(&cmd)) {
+		if (!virt_control_chan_func(&cmd)) {
 			LOGERR("CONTROLVM_DEVICE_DESTROY Failed: virtpci GUEST_DEL_[VHBA||VNIC] returned error.");
 			return
 			    CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_CALLBACK_ERROR;
@@ -783,7 +783,7 @@ init_chipset(CONTROLVM_MESSAGE *msg, char *buf)
 	* functions.
 	*/
 	if (!msg->hdr.Flags.testMessage)
-		WAIT_ON_CALLBACK(VirtControlChanFunc);
+		WAIT_ON_CALLBACK(virt_control_chan_func);
 
 	chipset_inited = 1;
 	POSTCODE_LINUX_2(CHIPSET_INIT_EXIT_PC, POSTCODE_SEVERITY_INFO);
@@ -1231,8 +1231,8 @@ info_debugfs_read_helper(char **buff, int *buff_len)
 	}
 	read_unlock(&BusListLock);
 
-	if (PLINE("UisUtils_Registered_Services: %d\n",
-		  atomic_read(&UisUtils_Registered_Services)) < 0)
+	if (PLINE("uisutils_registered_services: %d\n",
+		  atomic_read(&uisutils_registered_services)) < 0)
 		goto err_done;
 	if (PLINE("cycles_before_wait %llu wait_cycles:%llu\n",
 		  cycles_before_wait, wait_cycles) < 0)
@@ -1574,7 +1574,7 @@ uislib_mod_init(void)
 	BusListHead = NULL;
 	BusListCount = MaxBusCount = 0;
 	rwlock_init(&BusListLock);
-	VirtControlChanFunc = NULL;
+	virt_control_chan_func = NULL;
 
 	/* Issue VMCALL_GET_CONTROLVM_ADDR to get CtrlChanPhysAddr and
 	 * then map this physical address to a virtual address. */
diff --git a/drivers/staging/unisys/uislib/uisutils.c b/drivers/staging/unisys/uislib/uisutils.c
index d175d03..bf97ae9 100644
--- a/drivers/staging/unisys/uislib/uisutils.c
+++ b/drivers/staging/unisys/uislib/uisutils.c
@@ -39,7 +39,7 @@
 #define __MYFILE__ "uisutils.c"
 
 /* exports */
-atomic_t UisUtils_Registered_Services = ATOMIC_INIT(0);
+atomic_t uisutils_registered_services = ATOMIC_INIT(0);
 					/* num registrations via
 					 * uisctrl_register_req_handler() or
 					 * uisctrl_register_req_handler_ex() */
@@ -75,20 +75,20 @@ EXPORT_SYMBOL_GPL(uisutil_add_proc_line_ex);
 
 int
 uisctrl_register_req_handler(int type, void *fptr,
-			     ULTRA_VBUS_DEVICEINFO *chipset_DriverInfo)
+			     ULTRA_VBUS_DEVICEINFO *chipset_driver_info)
 {
 	LOGINF("type = %d, fptr = 0x%p.\n", type, fptr);
 
 	switch (type) {
 	case 2:
 		if (fptr) {
-			if (!VirtControlChanFunc)
-				atomic_inc(&UisUtils_Registered_Services);
-			VirtControlChanFunc = fptr;
+			if (!virt_control_chan_func)
+				atomic_inc(&uisutils_registered_services);
+			virt_control_chan_func = fptr;
 		} else {
-			if (VirtControlChanFunc)
-				atomic_dec(&UisUtils_Registered_Services);
-			VirtControlChanFunc = NULL;
+			if (virt_control_chan_func)
+				atomic_dec(&uisutils_registered_services);
+			virt_control_chan_func = NULL;
 		}
 		break;
 
@@ -96,8 +96,8 @@ uisctrl_register_req_handler(int type, void *fptr,
 		LOGERR("invalid type %d.\n", type);
 		return 0;
 	}
-	if (chipset_DriverInfo)
-		BusDeviceInfo_Init(chipset_DriverInfo, "chipset", "uislib",
+	if (chipset_driver_info)
+		BusDeviceInfo_Init(chipset_driver_info, "chipset", "uislib",
 				   VERSION, NULL);
 
 	return 1;
@@ -105,76 +105,78 @@ uisctrl_register_req_handler(int type, void *fptr,
 EXPORT_SYMBOL_GPL(uisctrl_register_req_handler);
 
 int
-uisctrl_register_req_handler_ex(uuid_le switchTypeGuid,
+uisctrl_register_req_handler_ex(uuid_le switch_type_guid,
 				const char *switch_type_name,
 				int (*controlfunc)(struct io_msgs *),
 				unsigned long min_channel_bytes,
-				int (*Server_Channel_Ok)(unsigned long
+				int (*server_channel_ok)(unsigned long
 							  channelBytes),
-				int (*Server_Channel_Init)
-				 (void *x, unsigned char *clientStr,
-				  u32 clientStrLen, u64 bytes),
-				ULTRA_VBUS_DEVICEINFO *chipset_DriverInfo)
+				int (*server_channel_init)
+				 (void *x, unsigned char *client_str,
+				  u32 client_str_len, u64 bytes),
+				ULTRA_VBUS_DEVICEINFO *chipset_driver_info)
 {
-	ReqHandlerInfo_t *pReqHandlerInfo;
+	struct req_handler_info *pReqHandlerInfo;
 	int rc = 0;		/* assume failure */
 
 	LOGINF("type=%pUL, controlfunc=0x%p.\n",
-	       &switchTypeGuid, controlfunc);
+	       &switch_type_guid, controlfunc);
 	if (!controlfunc) {
-		LOGERR("%pUL: controlfunc must be supplied\n", &switchTypeGuid);
+		LOGERR("%pUL: controlfunc must be supplied\n",
+		       &switch_type_guid);
 		goto Away;
 	}
-	if (!Server_Channel_Ok) {
+	if (!server_channel_ok) {
 		LOGERR("%pUL: Server_Channel_Ok must be supplied\n",
-				&switchTypeGuid);
+				&switch_type_guid);
 		goto Away;
 	}
-	if (!Server_Channel_Init) {
+	if (!server_channel_init) {
 		LOGERR("%pUL: Server_Channel_Init must be supplied\n",
-				&switchTypeGuid);
+				&switch_type_guid);
 		goto Away;
 	}
-	pReqHandlerInfo = ReqHandlerAdd(switchTypeGuid,
+	pReqHandlerInfo = req_handler_add(switch_type_guid,
 					switch_type_name,
 					controlfunc,
 					min_channel_bytes,
-					Server_Channel_Ok, Server_Channel_Init);
+					server_channel_ok, server_channel_init);
 	if (!pReqHandlerInfo) {
-		LOGERR("failed to add %pUL to server list\n", &switchTypeGuid);
+		LOGERR("failed to add %pUL to server list\n",
+		       &switch_type_guid);
 		goto Away;
 	}
 
-	atomic_inc(&UisUtils_Registered_Services);
+	atomic_inc(&uisutils_registered_services);
 	rc = 1;			/* success */
 Away:
 	if (rc) {
-		if (chipset_DriverInfo)
-			BusDeviceInfo_Init(chipset_DriverInfo, "chipset",
+		if (chipset_driver_info)
+			BusDeviceInfo_Init(chipset_driver_info, "chipset",
 					   "uislib", VERSION, NULL);
 	} else
-		LOGERR("failed to register type %pUL.\n", &switchTypeGuid);
+		LOGERR("failed to register type %pUL.\n", &switch_type_guid);
 
 	return rc;
 }
 EXPORT_SYMBOL_GPL(uisctrl_register_req_handler_ex);
 
 int
-uisctrl_unregister_req_handler_ex(uuid_le switchTypeGuid)
+uisctrl_unregister_req_handler_ex(uuid_le switch_type_guid)
 {
 	int rc = 0;		/* assume failure */
 
-	LOGINF("type=%pUL.\n", &switchTypeGuid);
-	if (ReqHandlerDel(switchTypeGuid) < 0) {
+	LOGINF("type=%pUL.\n", &switch_type_guid);
+	if (req_handler_del(switch_type_guid) < 0) {
 		LOGERR("failed to remove %pUL from server list\n",
-				&switchTypeGuid);
+				&switch_type_guid);
 		goto Away;
 	}
-	atomic_dec(&UisUtils_Registered_Services);
+	atomic_dec(&uisutils_registered_services);
 	rc = 1;			/* success */
 Away:
 	if (!rc)
-		LOGERR("failed to unregister type %pUL.\n", &switchTypeGuid);
+		LOGERR("failed to unregister type %pUL.\n", &switch_type_guid);
 	return rc;
 }
 EXPORT_SYMBOL_GPL(uisctrl_unregister_req_handler_ex);
@@ -275,28 +277,28 @@ dolist: if (skb_shinfo(skb)->frag_list) {
 }
 EXPORT_SYMBOL_GPL(uisutil_copy_fragsinfo_from_skb);
 
-static LIST_HEAD(ReqHandlerInfo_list);	/* list of ReqHandlerInfo_t */
+static LIST_HEAD(ReqHandlerInfo_list);	/* list of struct req_handler_info */
 static DEFINE_SPINLOCK(ReqHandlerInfo_list_lock);
 
-ReqHandlerInfo_t *
-ReqHandlerAdd(uuid_le switchTypeGuid,
+struct req_handler_info *
+req_handler_add(uuid_le switch_type_guid,
 	      const char *switch_type_name,
 	      int (*controlfunc)(struct io_msgs *),
 	      unsigned long min_channel_bytes,
-	      int (*Server_Channel_Ok)(unsigned long channelBytes),
-	      int (*Server_Channel_Init)
-	       (void *x, unsigned char *clientStr, u32 clientStrLen, u64 bytes))
+	      int (*server_channel_ok)(unsigned long channel_bytes),
+	      int (*server_channel_init)(void *x, unsigned char *client_str,
+					 u32 client_str_len, u64 bytes))
 {
-	ReqHandlerInfo_t *rc = NULL;
+	struct req_handler_info *rc = NULL;
 
 	rc = kzalloc(sizeof(*rc), GFP_ATOMIC);
 	if (!rc)
 		return NULL;
-	rc->switchTypeGuid = switchTypeGuid;
+	rc->switch_type_guid = switch_type_guid;
 	rc->controlfunc = controlfunc;
 	rc->min_channel_bytes = min_channel_bytes;
-	rc->Server_Channel_Ok = Server_Channel_Ok;
-	rc->Server_Channel_Init = Server_Channel_Init;
+	rc->server_channel_ok = server_channel_ok;
+	rc->server_channel_init = server_channel_init;
 	if (switch_type_name)
 		strncpy(rc->switch_type_name, switch_type_name,
 			sizeof(rc->switch_type_name) - 1);
@@ -307,16 +309,17 @@ ReqHandlerAdd(uuid_le switchTypeGuid,
 	return rc;
 }
 
-ReqHandlerInfo_t *
-ReqHandlerFind(uuid_le switchTypeGuid)
+struct req_handler_info *
+req_handler_find(uuid_le switch_type_guid)
 {
 	struct list_head *lelt, *tmp;
-	ReqHandlerInfo_t *entry = NULL;
+	struct req_handler_info *entry = NULL;
 
 	spin_lock(&ReqHandlerInfo_list_lock);
 	list_for_each_safe(lelt, tmp, &ReqHandlerInfo_list) {
-		entry = list_entry(lelt, ReqHandlerInfo_t, list_link);
-		if (uuid_le_cmp(entry->switchTypeGuid, switchTypeGuid) == 0) {
+		entry = list_entry(lelt, struct req_handler_info, list_link);
+		if (uuid_le_cmp(entry->switch_type_guid,
+				switch_type_guid) == 0) {
 			spin_unlock(&ReqHandlerInfo_list_lock);
 			return entry;
 		}
@@ -326,16 +329,17 @@ ReqHandlerFind(uuid_le switchTypeGuid)
 }
 
 int
-ReqHandlerDel(uuid_le switchTypeGuid)
+req_handler_del(uuid_le switch_type_guid)
 {
 	struct list_head *lelt, *tmp;
-	ReqHandlerInfo_t *entry = NULL;
+	struct req_handler_info *entry = NULL;
 	int rc = -1;
 
 	spin_lock(&ReqHandlerInfo_list_lock);
 	list_for_each_safe(lelt, tmp, &ReqHandlerInfo_list) {
-		entry = list_entry(lelt, ReqHandlerInfo_t, list_link);
-		if (uuid_le_cmp(entry->switchTypeGuid, switchTypeGuid) == 0) {
+		entry = list_entry(lelt, struct req_handler_info, list_link);
+		if (uuid_le_cmp(entry->switch_type_guid,
+				switch_type_guid) == 0) {
 			list_del(lelt);
 			kfree(entry);
 			rc++;
diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c
index 34c35dc..3321764 100644
--- a/drivers/staging/unisys/visorchipset/file.c
+++ b/drivers/staging/unisys/visorchipset/file.c
@@ -197,7 +197,7 @@ visorchipset_ioctl(struct inode *inode, struct file *file,
 	switch (cmd) {
 	case VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET:
 		/* get the physical rtc offset */
-		vrtc_offset = Issue_VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET();
+		vrtc_offset = issue_vmcall_query_guest_virtual_time_offset();
 		if (copy_to_user
 		    ((void __user *)arg, &vrtc_offset, sizeof(vrtc_offset))) {
 			rc = -EFAULT;
@@ -214,7 +214,7 @@ visorchipset_ioctl(struct inode *inode, struct file *file,
 		}
 		DBGINF("insde visorchipset_ioctl, cmd=%d, adjustment=%lld", cmd,
 		       adjustment);
-		rc = Issue_VMCALL_UPDATE_PHYSICAL_TIME(adjustment);
+		rc = issue_vmcall_update_physical_time(adjustment);
 		break;
 	default:
 		LOGERR("visorchipset_ioctl received invalid command");
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 1eeeef8..1c3a8cd 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1911,7 +1911,7 @@ static HOSTADDRESS controlvm_get_channel_address(void)
 	u64 addr = 0;
 	u32 size = 0;
 
-	if (!VMCALL_SUCCESSFUL(Issue_VMCALL_IO_CONTROLVM_ADDR(&addr, &size))) {
+	if (!VMCALL_SUCCESSFUL(issue_vmcall_io_controlvm_addr(&addr, &size))) {
 		ERRDRV("%s - vmcall to determine controlvm channel addr failed",
 		       __func__);
 		return 0;
-- 
1.9.1

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

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

* [PATCH 7/9] staging: unisys: clean up uniklog.h
  2014-09-24 15:56 [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include Benjamin Romer
                   ` (5 preceding siblings ...)
  2014-09-24 15:56 ` [PATCH 6/9] staging: unisys: clean up uisutils.h Benjamin Romer
@ 2014-09-24 15:56 ` Benjamin Romer
  2014-09-24 15:56 ` [PATCH 8/9] staging: unisys: cleanup vbushelper.h Benjamin Romer
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-09-24 15:56 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix all checkpatch.pl strict errors and checks. It was only a couple of
doubled blank lines.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/include/uniklog.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/unisys/include/uniklog.h b/drivers/staging/unisys/include/uniklog.h
index 6178cc4..ecd1bdb 100644
--- a/drivers/staging/unisys/include/uniklog.h
+++ b/drivers/staging/unisys/include/uniklog.h
@@ -23,7 +23,6 @@
 #ifndef __UNIKLOG_H__
 #define __UNIKLOG_H__
 
-
 #include <linux/printk.h>
 
 /*
@@ -122,7 +121,6 @@
 		}							\
 	} while (0)
 
-
 /*
  * # LOGERR
  *
-- 
1.9.1

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

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

* [PATCH 8/9] staging: unisys: cleanup vbushelper.h
  2014-09-24 15:56 [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include Benjamin Romer
                   ` (6 preceding siblings ...)
  2014-09-24 15:56 ` [PATCH 7/9] staging: unisys: clean up uniklog.h Benjamin Romer
@ 2014-09-24 15:56 ` Benjamin Romer
  2014-09-24 15:56 ` [PATCH 9/9] staging: unisys: clean up guestlinuxdebug.h Benjamin Romer
  2014-09-24 16:12 ` [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include Dan Carpenter
  9 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-09-24 15:56 UTC (permalink / raw)
  To: gregkh; +Cc: jkc, driverdev-devel, sparmaintainer, Benjamin Romer

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 5653 bytes --]

Fix as many checkpatch.pl strict checks and warnings as possible, and fix
references to the renamed bus_device_info_init() function. The remaining
checks in this file are due to the names of members of structures defined in
another file. These will be corrected by subsequent patches.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/include/vbushelper.h        | 24 +++++++++++-----------
 drivers/staging/unisys/uislib/uisutils.c           |  8 ++++----
 drivers/staging/unisys/virtpci/virtpci.c           | 12 +++++------
 .../unisys/visorchipset/visorchipset_main.c        |  8 ++++----
 4 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/unisys/include/vbushelper.h b/drivers/staging/unisys/include/vbushelper.h
index ed94375..9f80c22 100644
--- a/drivers/staging/unisys/include/vbushelper.h
+++ b/drivers/staging/unisys/include/vbushelper.h
@@ -1,6 +1,6 @@
 /* vbushelper.h
  *
- * Copyright © 2011 - 2013 UNISYS CORPORATION
+ * Copyright (C) 2011 - 2013 UNISYS CORPORATION
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -26,19 +26,19 @@
 #define TARGET_HOSTNAME "linuxguest"
 
 static inline void
-BusDeviceInfo_Init(ULTRA_VBUS_DEVICEINFO *pBusDeviceInfo,
-		   const char *deviceType, const char *driverName,
-		   const char *ver, const char *verTag)
+bus_device_info_init(ULTRA_VBUS_DEVICEINFO *bus_device_info,
+		     const char *device_type, const char *driver_name,
+		     const char *ver, const char *ver_tag)
 {
-	memset(pBusDeviceInfo, 0, sizeof(ULTRA_VBUS_DEVICEINFO));
-	snprintf(pBusDeviceInfo->devType, sizeof(pBusDeviceInfo->devType),
-		 "%s", (deviceType) ? deviceType : "unknownType");
-	snprintf(pBusDeviceInfo->drvName, sizeof(pBusDeviceInfo->drvName),
-		 "%s", (driverName) ? driverName : "unknownDriver");
-	snprintf(pBusDeviceInfo->infoStrings,
-		 sizeof(pBusDeviceInfo->infoStrings), "%s\t%s\t%s",
+	memset(bus_device_info, 0, sizeof(ULTRA_VBUS_DEVICEINFO));
+	snprintf(bus_device_info->devType, sizeof(bus_device_info->devType),
+		 "%s", (device_type) ? device_type : "unknownType");
+	snprintf(bus_device_info->drvName, sizeof(bus_device_info->drvName),
+		 "%s", (driver_name) ? driver_name : "unknownDriver");
+	snprintf(bus_device_info->infoStrings,
+		 sizeof(bus_device_info->infoStrings), "%s\t%s\t%s",
 		 (ver) ? ver : "unknownVer",
-		 (verTag) ? verTag : "unknownVerTag",
+		 (ver_tag) ? ver_tag : "unknownVerTag",
 		 TARGET_HOSTNAME);
 }
 
diff --git a/drivers/staging/unisys/uislib/uisutils.c b/drivers/staging/unisys/uislib/uisutils.c
index bf97ae9..25b6234 100644
--- a/drivers/staging/unisys/uislib/uisutils.c
+++ b/drivers/staging/unisys/uislib/uisutils.c
@@ -97,8 +97,8 @@ uisctrl_register_req_handler(int type, void *fptr,
 		return 0;
 	}
 	if (chipset_driver_info)
-		BusDeviceInfo_Init(chipset_driver_info, "chipset", "uislib",
-				   VERSION, NULL);
+		bus_device_info_init(chipset_driver_info, "chipset", "uislib",
+				     VERSION, NULL);
 
 	return 1;
 }
@@ -152,8 +152,8 @@ uisctrl_register_req_handler_ex(uuid_le switch_type_guid,
 Away:
 	if (rc) {
 		if (chipset_driver_info)
-			BusDeviceInfo_Init(chipset_driver_info, "chipset",
-					   "uislib", VERSION, NULL);
+			bus_device_info_init(chipset_driver_info, "chipset",
+					     "uislib", VERSION, NULL);
 	} else
 		LOGERR("failed to register type %pUL.\n", &switch_type_guid);
 
diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c
index 5c56ae9..6c86cc4 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -787,10 +787,10 @@ static void fix_vbus_devInfo(struct device *dev, int devNo, int devType,
 		stype = "unknown";
 		break;
 	}
-	BusDeviceInfo_Init(&devInfo, stype,
-			   virtpcidrv->name,
-			   virtpcidrv->version,
-			   virtpcidrv->vertag);
+	bus_device_info_init(&devInfo, stype,
+			     virtpcidrv->name,
+			     virtpcidrv->version,
+			     virtpcidrv->vertag);
 	write_vbus_devInfo(pChan, &devInfo, devNo);
 
 	/* Re-write bus+chipset info, because it is possible that this
@@ -1506,8 +1506,8 @@ static int __init virtpci_mod_init(void)
 		return ret;
 	}
 	DBGINF("bus_register successful\n");
-	BusDeviceInfo_Init(&Bus_DriverInfo, "clientbus", "virtpci",
-			   VERSION, NULL);
+	bus_device_info_init(&Bus_DriverInfo, "clientbus", "virtpci",
+			     VERSION, NULL);
 
 	/* create a root bus used to parent all the virtpci buses. */
 	ret = device_register(&virtpci_rootbus_device);
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 1c3a8cd..eb99137 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -601,8 +601,8 @@ visorchipset_register_busdev_server(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
 	if (responders)
 		*responders = BusDev_Responders;
 	if (driverInfo)
-		BusDeviceInfo_Init(driverInfo, "chipset", "visorchipset",
-				   VERSION, NULL);
+		bus_device_info_init(driverInfo, "chipset", "visorchipset",
+				     VERSION, NULL);
 
 	up(&NotifierLock);
 }
@@ -625,8 +625,8 @@ visorchipset_register_busdev_client(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
 	if (responders)
 		*responders = BusDev_Responders;
 	if (driverInfo)
-		BusDeviceInfo_Init(driverInfo, "chipset(bolts)", "visorchipset",
-				   VERSION, NULL);
+		bus_device_info_init(driverInfo, "chipset(bolts)",
+				     "visorchipset", VERSION, NULL);
 	up(&NotifierLock);
 }
 EXPORT_SYMBOL_GPL(visorchipset_register_busdev_client);
-- 
1.9.1

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

* [PATCH 9/9] staging: unisys: clean up guestlinuxdebug.h
  2014-09-24 15:56 [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include Benjamin Romer
                   ` (7 preceding siblings ...)
  2014-09-24 15:56 ` [PATCH 8/9] staging: unisys: cleanup vbushelper.h Benjamin Romer
@ 2014-09-24 15:56 ` Benjamin Romer
  2014-09-24 16:12 ` [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include Dan Carpenter
  9 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-09-24 15:56 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Fix all checkpatch.pl strict checks and warnings. The two typedefs were
removed and the doubled blank lines were corrected.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/include/guestlinuxdebug.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/include/guestlinuxdebug.h b/drivers/staging/unisys/include/guestlinuxdebug.h
index 8728e4c..957a627 100644
--- a/drivers/staging/unisys/include/guestlinuxdebug.h
+++ b/drivers/staging/unisys/include/guestlinuxdebug.h
@@ -21,10 +21,9 @@
 * regarding adding additional structure and functionality to linux
 * ISSUE_IO_VMCALL_POSTCODE_SEVERITY */
 
-
 /******* INFO ON ISSUE_POSTCODE_LINUX() BELOW *******/
 #include "vmcallinterface.h"
-typedef enum {		/* POSTCODE driver identifier tuples */
+enum driver_pc {		/* POSTCODE driver identifier tuples */
 	/* visorchipset driver files */
 	VISOR_CHIPSET_PC = 0xA0,
 	VISOR_CHIPSET_PC_controlvm_c = 0xA1,
@@ -59,9 +58,9 @@ typedef enum {		/* POSTCODE driver identifier tuples */
 	UISLIB_PC_uisqueue_c = 0xD2,
 	UISLIB_PC_uisthread_c = 0xD3,
 	UISLIB_PC_uisutils_c = 0xD4,
-} DRIVER_PC;
+};
 
-typedef enum {			/* POSTCODE event identifier tuples */
+enum event_pc {			/* POSTCODE event identifier tuples */
 	ATTACH_PORT_ENTRY_PC = 0x001,
 	ATTACH_PORT_FAILURE_PC = 0x002,
 	ATTACH_PORT_SUCCESS_PC = 0x003,
@@ -129,7 +128,7 @@ typedef enum {			/* POSTCODE event identifier tuples */
 	SAVE_MSG_BUS_FAILURE_PC = 0x0D9,
 	SAVE_MSG_DEV_FAILURE_PC = 0x0DA,
 	CALLHOME_INIT_FAILURE_PC = 0x0DB
-} EVENT_PC;
+};
 
 #ifdef __GNUC__
 
@@ -173,7 +172,6 @@ do {									\
 #define POSTCODE_LINUX_3(EVENT_PC, pc32bit, severity)			\
 	POSTCODE_LINUX_A(CURRENT_FILE_PC, EVENT_PC, pc32bit, severity)
 
-
 #define POSTCODE_LINUX_4(EVENT_PC, pc16bit1, pc16bit2, severity)	\
 	POSTCODE_LINUX_B(CURRENT_FILE_PC, EVENT_PC, pc16bit1,		\
 			 pc16bit2, severity)
-- 
1.9.1

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

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

* Re: [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include
  2014-09-24 15:56 [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include Benjamin Romer
                   ` (8 preceding siblings ...)
  2014-09-24 15:56 ` [PATCH 9/9] staging: unisys: clean up guestlinuxdebug.h Benjamin Romer
@ 2014-09-24 16:12 ` Dan Carpenter
  2014-09-24 22:02   ` Greg KH
  2014-09-25  8:03   ` Dan Carpenter
  9 siblings, 2 replies; 19+ messages in thread
From: Dan Carpenter @ 2014-09-24 16:12 UTC (permalink / raw)
  To: Benjamin Romer; +Cc: gregkh, sparmaintainer, driverdev-devel

Gar.  I hate to make you redo a lot of work but these need to be broken
up into "one thing per patch".  That rules is kind of vague so we
normally tell people to fix one type of checkpatch.pl warning at a time
as a simple way of explaining it.

But definitely "fixing every checkpatch.pl warning in a file" is not
one thing unless there are like 2 lines of change only.

regards,
dan carpenter


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

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

* Re: [PATCH 1/9] staging: unisys: clean up periodic_work.c and periodic_work.h
  2014-09-24 15:56 ` [PATCH 1/9] staging: unisys: clean up periodic_work.c and periodic_work.h Benjamin Romer
@ 2014-09-24 16:34   ` Dan Carpenter
  2014-09-25 16:53     ` Romer, Benjamin M
  0 siblings, 1 reply; 19+ messages in thread
From: Dan Carpenter @ 2014-09-24 16:34 UTC (permalink / raw)
  To: Benjamin Romer; +Cc: gregkh, driverdev-devel, sparmaintainer

On Wed, Sep 24, 2014 at 11:56:19AM -0400, Benjamin Romer wrote:
> +struct periodic_work *
> +	visor_periodic_work_create(ulong jiffy_interval,
> +				   struct workqueue_struct *workqueue,
> +				   void (*workfunc)(void *),
> +				   void *workfuncarg,
> +				   const char *devnam);

No.  This isn't the right way to do it.  The way the lines were broken
up originally was fine.  It's ok to pull the parameter declarations back
to make it under the 80 character limit.

I wonder if we could do something like this in checkpatch.pl?

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 74bba23..79a7f82 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2503,7 +2503,8 @@ sub process {
 				my $goodspaceindent = $oldindent . " "  x $pos;
 
 				if ($newindent ne $goodtabindent &&
-				    $newindent ne $goodspaceindent) {
+				    $newindent ne $goodspaceindent &&
+				    length($goodspaceindent) < 40) {
 
 					if (CHK("PARENTHESIS_ALIGNMENT",
 						"Alignment should match open parenthesis\n" . $hereprev) &&

>  static void periodic_work_func(struct work_struct *work)
>  {
> -	PERIODIC_WORK *periodic_work =
> -		container_of(work, struct PERIODIC_WORK_Tag, work.work);
> -	(*periodic_work->workfunc)(periodic_work->workfuncarg);
> -}
> -
> +	struct periodic_work *pw =
> +		container_of(work, struct periodic_work, work.work);
>  
> +	(*pw->workfunc)(pw->workfuncarg);
> +}

Just do:

{
	struct periodic_work *pw;

	pw = container_of(work, struct periodic_work, work.work);
	(*pw->workfunc)(pw->workfuncarg);
}

> +	struct periodic_work *pw = kzalloc(sizeof(struct periodic_work),
> +					   GFP_KERNEL | __GFP_NORETRY);
> +
> +	if (pw == NULL) {

Don't put a blank line between the call and the check.
Just say "if (!pw)" because it's more concise.

>  		ERRDRV("periodic_work allocation failed ");

Don't print an error here.  kmalloc() has its own better printks.

> -void visor_periodic_work_destroy(PERIODIC_WORK *periodic_work)
> +void visor_periodic_work_destroy(struct periodic_work *pw)
>  {
> -	if (periodic_work == NULL)
> +	if (pw == NULL)
>  		return;
> -	kfree(periodic_work);
> +	kfree(pw);

Don't check for NULL here.  kfree() accepts NULLs.

> -Away:
> -	write_unlock(&periodic_work->lock);
> +away:
> +	write_unlock(&pw->lock);

unlock: is a better label than "away".

regards,
dan carpenter

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

* Re: [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include
  2014-09-24 16:12 ` [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include Dan Carpenter
@ 2014-09-24 22:02   ` Greg KH
  2014-09-25 13:22     ` Romer, Benjamin M
  2014-09-25  8:03   ` Dan Carpenter
  1 sibling, 1 reply; 19+ messages in thread
From: Greg KH @ 2014-09-24 22:02 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: driverdev-devel, Benjamin Romer, sparmaintainer

On Wed, Sep 24, 2014 at 07:12:03PM +0300, Dan Carpenter wrote:
> Gar.  I hate to make you redo a lot of work but these need to be broken
> up into "one thing per patch".  That rules is kind of vague so we
> normally tell people to fix one type of checkpatch.pl warning at a time
> as a simple way of explaining it.
> 
> But definitely "fixing every checkpatch.pl warning in a file" is not
> one thing unless there are like 2 lines of change only.

I agree, please fix this up into "one logical change per patch".

thanks,

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

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

* Re: [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include
  2014-09-24 16:12 ` [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include Dan Carpenter
  2014-09-24 22:02   ` Greg KH
@ 2014-09-25  8:03   ` Dan Carpenter
  1 sibling, 0 replies; 19+ messages in thread
From: Dan Carpenter @ 2014-09-25  8:03 UTC (permalink / raw)
  To: Benjamin Romer; +Cc: gregkh, sparmaintainer, driverdev-devel

I only had read the first patch when I wrote this email.  Some of these
patches are ok as-is but it's complicated to cherry pick patches from
the middle of a series.

regards,
dan carpenter

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

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

* Re: [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include
  2014-09-24 22:02   ` Greg KH
@ 2014-09-25 13:22     ` Romer, Benjamin M
  2014-09-25 13:30       ` Dan Carpenter
  0 siblings, 1 reply; 19+ messages in thread
From: Romer, Benjamin M @ 2014-09-25 13:22 UTC (permalink / raw)
  To: Greg KH; +Cc: driverdev-devel, *S-Par-Maintainer, Dan Carpenter

On Thu, 2014-09-25 at 00:02 +0200, Greg KH wrote:
> On Wed, Sep 24, 2014 at 07:12:03PM +0300, Dan Carpenter wrote:
> > Gar.  I hate to make you redo a lot of work but these need to be broken
> > up into "one thing per patch".  That rules is kind of vague so we
> > normally tell people to fix one type of checkpatch.pl warning at a time
> > as a simple way of explaining it.
> > 
> > But definitely "fixing every checkpatch.pl warning in a file" is not
> > one thing unless there are like 2 lines of change only.
> 
> I agree, please fix this up into "one logical change per patch".
> 
> thanks,
> 
> greg k-h

That's no problem, the same amount of work needs to get done regardless
of how it's split up. :)

When you say type of warning, do you mean individual warnings, or can I
group them into sets, i.e. fixing spacing and doubled blank lines
together as a single whitespace formatting patch?

When fixing the camel-case warnings do I need to do a separate patch for
each function or variable or struct, or can I group all of the
camel-case fixes for a single file together?

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

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

* Re: [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include
  2014-09-25 13:22     ` Romer, Benjamin M
@ 2014-09-25 13:30       ` Dan Carpenter
  2014-09-25 13:39         ` Romer, Benjamin M
  0 siblings, 1 reply; 19+ messages in thread
From: Dan Carpenter @ 2014-09-25 13:30 UTC (permalink / raw)
  To: Romer, Benjamin M; +Cc: Greg KH, *S-Par-Maintainer, driverdev-devel

On Thu, Sep 25, 2014 at 08:22:15AM -0500, Romer, Benjamin M wrote:
> On Thu, 2014-09-25 at 00:02 +0200, Greg KH wrote:
> > On Wed, Sep 24, 2014 at 07:12:03PM +0300, Dan Carpenter wrote:
> > > Gar.  I hate to make you redo a lot of work but these need to be broken
> > > up into "one thing per patch".  That rules is kind of vague so we
> > > normally tell people to fix one type of checkpatch.pl warning at a time
> > > as a simple way of explaining it.
> > > 
> > > But definitely "fixing every checkpatch.pl warning in a file" is not
> > > one thing unless there are like 2 lines of change only.
> > 
> > I agree, please fix this up into "one logical change per patch".
> > 
> > thanks,
> > 
> > greg k-h
> 
> That's no problem, the same amount of work needs to get done regardless
> of how it's split up. :)
> 
> When you say type of warning, do you mean individual warnings, or can I
> group them into sets, i.e. fixing spacing and doubled blank lines
> together as a single whitespace formatting patch?

Probably that's fine, but normally we suggest:

patch 1: clean up long lines
patch 2: delete extra blank lines
patch 3: comments

or whatever...

> 
> When fixing the camel-case warnings do I need to do a separate patch for
> each function or variable or struct, or can I group all of the
> camel-case fixes for a single file together?

These things are kind of vague.  The "clean everything in a file"
approach is definitely banned.

What really helps me is if you list the exact variables that were
changed in the changelog like this:

Cleanup CamelCase names:
FooBar => foo_bar
OneTwo => one_two

I use a script to sed these renames out so I can just cut and paste the
renames and verify that nothing else changed.

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include
  2014-09-25 13:30       ` Dan Carpenter
@ 2014-09-25 13:39         ` Romer, Benjamin M
  0 siblings, 0 replies; 19+ messages in thread
From: Romer, Benjamin M @ 2014-09-25 13:39 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: *S-Par-Maintainer, Greg KH, driverdev-devel

On Thu, 2014-09-25 at 16:30 +0300, Dan Carpenter wrote:
> Probably that's fine, but normally we suggest:
> 
> patch 1: clean up long lines
> patch 2: delete extra blank lines
> patch 3: comments
> 
> or whatever...
> 

OK, thanks. I suppose if I'm not sure, I'll make individual patches and
I can just squash them together if someone complains that they're too
small.

> What really helps me is if you list the exact variables that were
> changed in the changelog like this:
> 
> Cleanup CamelCase names:
> FooBar => foo_bar
> OneTwo => one_two
> 
> I use a script to sed these renames out so I can just cut and paste the
> renames and verify that nothing else changed.

I'll do that! Thanks for the help! :)

-- Ben

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

* Re: [PATCH 1/9] staging: unisys: clean up periodic_work.c and periodic_work.h
  2014-09-24 16:34   ` Dan Carpenter
@ 2014-09-25 16:53     ` Romer, Benjamin M
  2014-09-25 17:08       ` Dan Carpenter
  0 siblings, 1 reply; 19+ messages in thread
From: Romer, Benjamin M @ 2014-09-25 16:53 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: *S-Par-Maintainer, gregkh, driverdev-devel

On Wed, 2014-09-24 at 19:34 +0300, Dan Carpenter wrote:
> On Wed, Sep 24, 2014 at 11:56:19AM -0400, Benjamin Romer wrote:
> > +struct periodic_work *
> > +	visor_periodic_work_create(ulong jiffy_interval,
> > +				   struct workqueue_struct *workqueue,
> > +				   void (*workfunc)(void *),
> > +				   void *workfuncarg,
> > +				   const char *devnam);
> 
> No.  This isn't the right way to do it.  The way the lines were broken
> up originally was fine.  It's ok to pull the parameter declarations back
> to make it under the 80 character limit.

Sorry, it was kind of an act of desperation to try and pass the strict
check for parenthesis alignment. I originally wanted to do it like this:

struct periodic_work *visor_periodic_work_create(ulong jiffy_interval,
			struct workqueue_struct *workqueue,
			void (*workfunc)(void*), void *workfuncarg,
			const char *devnam);

But that generates the same parenthesis check message with --strict
turned on. Trying to align everything with the parenthesis was very
ugly, so I tried to save space by splitting the line at the return type.

So should I just ignore the parenthesis warning for this one function?
I'm kind of confused about this particular check to be honest. In
Documentation/CodingStyle it says to never use spaces for indentation,
but there's no way to pass this check without using spaces, or getting
lucky and having things line up exactly on a tab.

-- Ben

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

* Re: [PATCH 1/9] staging: unisys: clean up periodic_work.c and periodic_work.h
  2014-09-25 16:53     ` Romer, Benjamin M
@ 2014-09-25 17:08       ` Dan Carpenter
  0 siblings, 0 replies; 19+ messages in thread
From: Dan Carpenter @ 2014-09-25 17:08 UTC (permalink / raw)
  To: Romer, Benjamin M; +Cc: gregkh, *S-Par-Maintainer, driverdev-devel

On Thu, Sep 25, 2014 at 11:53:53AM -0500, Romer, Benjamin M wrote:
> On Wed, 2014-09-24 at 19:34 +0300, Dan Carpenter wrote:
> > On Wed, Sep 24, 2014 at 11:56:19AM -0400, Benjamin Romer wrote:
> > > +struct periodic_work *
> > > +	visor_periodic_work_create(ulong jiffy_interval,
> > > +				   struct workqueue_struct *workqueue,
> > > +				   void (*workfunc)(void *),
> > > +				   void *workfuncarg,
> > > +				   const char *devnam);
> > 
> > No.  This isn't the right way to do it.  The way the lines were broken
> > up originally was fine.  It's ok to pull the parameter declarations back
> > to make it under the 80 character limit.
> 
> Sorry, it was kind of an act of desperation to try and pass the strict
> check for parenthesis alignment. I originally wanted to do it like this:
> 
> struct periodic_work *visor_periodic_work_create(ulong jiffy_interval,
> 			struct workqueue_struct *workqueue,
> 			void (*workfunc)(void*), void *workfuncarg,
> 			const char *devnam);

That looks like an inpenetrable wall of text.  I feel like it looks
better to push the parameters in further.

struct periodic_work *visor_periodic_work_create(ulong jiffy_interval,
 					struct workqueue_struct *workqueue,
 					void (*workfunc)(void*),
					void *workfuncarg,
 					const char *devnam);

But it doesn't really matter.  Sometimes none of the options look
wonderful.  But the other format was just sort of unique and weird.

> 
> But that generates the same parenthesis check message with --strict
> turned on. Trying to align everything with the parenthesis was very
> ugly, so I tried to save space by splitting the line at the return type.
> 
> So should I just ignore the parenthesis warning for this one function?

Yes.  Ignore anything if you think it looks better that way.

> I'm kind of confused about this particular check to be honest. In
> Documentation/CodingStyle it says to never use spaces for indentation,
> but there's no way to pass this check without using spaces, or getting
> lucky and having things line up exactly on a tab.

You can use spaces at the end to make things line up.  This has become
the standard in the past few years.

regards,
dan carpenter

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

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

end of thread, other threads:[~2014-09-25 17:08 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-24 15:56 [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include Benjamin Romer
2014-09-24 15:56 ` [PATCH 1/9] staging: unisys: clean up periodic_work.c and periodic_work.h Benjamin Romer
2014-09-24 16:34   ` Dan Carpenter
2014-09-25 16:53     ` Romer, Benjamin M
2014-09-25 17:08       ` Dan Carpenter
2014-09-24 15:56 ` [PATCH 2/9] staging: unisys: clean up timskmod.h Benjamin Romer
2014-09-24 15:56 ` [PATCH 3/9] staging: unisys: remove timskmodutils.h Benjamin Romer
2014-09-24 15:56 ` [PATCH 4/9] staging: unisys: clean up uisqueue.h Benjamin Romer
2014-09-24 15:56 ` [PATCH 5/9] staging: unisys: remove blank lines from uisthread.h Benjamin Romer
2014-09-24 15:56 ` [PATCH 6/9] staging: unisys: clean up uisutils.h Benjamin Romer
2014-09-24 15:56 ` [PATCH 7/9] staging: unisys: clean up uniklog.h Benjamin Romer
2014-09-24 15:56 ` [PATCH 8/9] staging: unisys: cleanup vbushelper.h Benjamin Romer
2014-09-24 15:56 ` [PATCH 9/9] staging: unisys: clean up guestlinuxdebug.h Benjamin Romer
2014-09-24 16:12 ` [PATCH 0/9] staging: unisys: checkpatch strict cleanup in include Dan Carpenter
2014-09-24 22:02   ` Greg KH
2014-09-25 13:22     ` Romer, Benjamin M
2014-09-25 13:30       ` Dan Carpenter
2014-09-25 13:39         ` Romer, Benjamin M
2014-09-25  8:03   ` Dan Carpenter

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.