public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hv: Reduce indention in vmbus_on_event
@ 2011-03-22 21:02 Olaf Hering
  2011-03-22 21:06 ` [PATCH] hv: pass u32 to process_chn_event() Olaf Hering
  2011-04-05  5:08 ` [PATCH] hv: Reduce indention in vmbus_on_event Greg KH
  0 siblings, 2 replies; 7+ messages in thread
From: Olaf Hering @ 2011-03-22 21:02 UTC (permalink / raw)
  To: Hank Janssen, Haiyang Zhang, Greg Kroah-Hartman; +Cc: linux-kernel

Reduce indention in vmbus_on_event() by converting two
if (var) to if (!var)

Signed-off-by: Olaf Hering <olaf@aepfle.de>

---
 drivers/staging/hv/connection.c |   37 +++++++++++++++----------------------
 1 file changed, 15 insertions(+), 22 deletions(-)

Index: linux-2.6/drivers/staging/hv/connection.c
===================================================================
--- linux-2.6.orig/drivers/staging/hv/connection.c
+++ linux-2.6/drivers/staging/hv/connection.c
@@ -292,32 +292,25 @@ void vmbus_on_event(unsigned long data)
 	u32 *recv_int_page = vmbus_connection.recv_int_page;
 
 	/* Check events */
-	if (recv_int_page) {
-		for (dword = 0; dword < maxdword; dword++) {
-			if (recv_int_page[dword]) {
-				for (bit = 0; bit < 32; bit++) {
-					if (sync_test_and_clear_bit(bit,
-						(unsigned long *)
-						&recv_int_page[dword])) {
-						relid = (dword << 5) + bit;
-						DPRINT_DBG(VMBUS, "event detected for relid - %d", relid);
+	if (!recv_int_page)
+		return;
+	for (dword = 0; dword < maxdword; dword++) {
+		if (!recv_int_page[dword])
+			continue;
+		for (bit = 0; bit < 32; bit++) {
+			if (sync_test_and_clear_bit(bit, (unsigned long *)&recv_int_page[dword])) {
+				relid = (dword << 5) + bit;
+				DPRINT_DBG(VMBUS, "event detected for relid - %d", relid);
 
-						if (relid == 0) {
-							/* special case - vmbus channel protocol msg */
-							DPRINT_DBG(VMBUS, "invalid relid - %d", relid);
-							continue;
-						} else {
-							/* QueueWorkItem(VmbusProcessEvent, (void*)relid); */
-							/* ret = WorkQueueQueueWorkItem(gVmbusConnection.workQueue, VmbusProcessChannelEvent, (void*)relid); */
-						process_chn_event((void *)
-						(unsigned long)relid);
-						}
-					}
+				if (relid == 0) {
+					/* special case - vmbus channel protocol msg */
+					DPRINT_DBG(VMBUS, "invalid relid - %d", relid);
+					continue;
 				}
+				process_chn_event((void *) (unsigned long)relid);
 			}
-		 }
+		}
 	}
-	return;
 }
 
 /*

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

end of thread, other threads:[~2011-04-12 13:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-22 21:02 [PATCH] hv: Reduce indention in vmbus_on_event Olaf Hering
2011-03-22 21:06 ` [PATCH] hv: pass u32 to process_chn_event() Olaf Hering
2011-03-22 21:08   ` [PATCH] hv: pass integer to tasklet_init() Olaf Hering
2011-03-23 13:08     ` [PATCH] hv: make vmbus_loglevel writeable Olaf Hering
2011-03-23 13:11       ` [PATCH] hv: remove double newline in DPRINT functions Olaf Hering
2011-04-05  5:08 ` [PATCH] hv: Reduce indention in vmbus_on_event Greg KH
2011-04-12 13:26   ` Olaf Hering

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox