lkml.org 
[lkml]   [2011]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 1/5] hv: Reduce indention in vmbus_on_event
Reduce indention in vmbus_on_event() by converting two
if (var) to if (!var)

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

---
compile tested.

drivers/staging/hv/connection.c | 33 +++++++++++++--------------------
1 file changed, 13 insertions(+), 20 deletions(-)

Index: linux-next/drivers/staging/hv/connection.c
===================================================================
--- linux-next.orig/drivers/staging/hv/connection.c
+++ linux-next/drivers/staging/hv/connection.c
@@ -287,30 +287,23 @@ 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;
+ 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;

- if (relid == 0) {
- /* special case - vmbus channel protocol msg */
- 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 */
+ continue;
}
+ process_chn_event((void *) (unsigned long)relid);
}
- }
+ }
}
- return;
}

/*


\
 
 \ /
  Last update: 2011-04-16 18:53    [W:0.060 / U:1.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site