From: Olaf Hering <olaf@aepfle.de>
To: Hank Janssen <hjanssen@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Greg Kroah-Hartman <gregkh@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: [patch 1/5] hv: Reduce indention in vmbus_on_event
Date: Sat, 16 Apr 2011 18:50:39 +0200 [thread overview]
Message-ID: <20110416165042.416376417@aepfle.de> (raw)
In-Reply-To: 20110416165038.986214764@aepfle.de
[-- Attachment #1: bug679942-vmbus_on_event.patch --]
[-- Type: text/plain, Size: 1741 bytes --]
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;
}
/*
next prev parent reply other threads:[~2011-04-16 16:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-16 16:50 [patch 0/5] hv cleanups Olaf Hering
2011-04-16 16:50 ` Olaf Hering [this message]
2011-04-16 16:50 ` [patch 2/5] hv: pass u32 to process_chn_event() Olaf Hering
2011-04-16 16:50 ` [patch 3/5] hv: pass integer to tasklet_init() Olaf Hering
2011-04-16 16:50 ` [patch 4/5] hv: make vmbus_loglevel writeable Olaf Hering
2011-04-16 16:50 ` [patch 5/5] hv: remove double newline in DPRINT functions Olaf Hering
2011-04-20 20:40 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110416165042.416376417@aepfle.de \
--to=olaf@aepfle.de \
--cc=gregkh@suse.de \
--cc=haiyangz@microsoft.com \
--cc=hjanssen@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox