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: Re: [PATCH] hv: pass u32 to process_chn_event()
Date: Tue, 22 Mar 2011 22:06:28 +0100 [thread overview]
Message-ID: <20110322210627.GB17724@aepfle.de> (raw)
In-Reply-To: <20110322210207.GA17724@aepfle.de>
Change types in vmbus_on_event() to u32 since the input is u32 as well.
Pass u32 to process_chn_event() instead of casting arg to void* and back.
Update printk to reflect type change.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
compile tested only.
drivers/staging/hv/connection.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 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
@@ -255,10 +255,9 @@ struct vmbus_channel *relid2channel(u32
/*
* process_chn_event - Process a channel event notification
*/
-static void process_chn_event(void *context)
+static void process_chn_event(u32 relid)
{
struct vmbus_channel *channel;
- u32 relid = (u32)(unsigned long)context;
/* ASSERT(relId > 0); */
@@ -276,7 +275,7 @@ static void process_chn_event(void *cont
* (void*)channel);
*/
} else {
- DPRINT_ERR(VMBUS, "channel not found for relid - %d.", relid);
+ DPRINT_ERR(VMBUS, "channel not found for relid - %u.", relid);
}
}
@@ -285,10 +284,10 @@ static void process_chn_event(void *cont
*/
void vmbus_on_event(unsigned long data)
{
- int dword;
- int maxdword = MAX_NUM_CHANNELS_SUPPORTED >> 5;
+ u32 dword;
+ u32 maxdword = MAX_NUM_CHANNELS_SUPPORTED >> 5;
int bit;
- int relid;
+ u32 relid;
u32 *recv_int_page = vmbus_connection.recv_int_page;
/* Check events */
@@ -300,14 +299,14 @@ void vmbus_on_event(unsigned long data)
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);
+ DPRINT_DBG(VMBUS, "event detected for relid - %u", relid);
if (relid == 0) {
/* special case - vmbus channel protocol msg */
- DPRINT_DBG(VMBUS, "invalid relid - %d", relid);
+ DPRINT_DBG(VMBUS, "invalid relid - %u", relid);
continue;
}
- process_chn_event((void *) (unsigned long)relid);
+ process_chn_event(relid);
}
}
}
next prev parent reply other threads:[~2011-03-22 21:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-22 21:02 [PATCH] hv: Reduce indention in vmbus_on_event Olaf Hering
2011-03-22 21:06 ` Olaf Hering [this message]
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
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=20110322210627.GB17724@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