2011-03-29 21:24:49

by Hank Janssen

[permalink] [raw]
Subject: [PATCH 00/07] Remove and replace all un-needed DPRINT and printk

This patch set removes all un-needed DPRINT and printk calls and replaces
the remaining ones with the correct pr_, dev_ and netdev_ calls
from hv_vmbus, hv_netvsc, hv_timesource and hv_utils.

Several DPRINTS are remaining that will be cleaned up in my next
set of patches. They deal with printing out certain debugging that will be
implemented slightly differently.

The remaining hv_storvsc and hv_blkvsc will get the same treatment in
a different set of patches.

Regards,

Hank Janssen <[email protected]>


2011-03-29 20:48:16

by Hank Janssen

[permalink] [raw]
Subject: [PATCH 02/07] Remove all unneeded DPRINT from hv_netvsc

Remove all un-needed DPRINT calls from hv_netvsc.

This patch deals with hv_netvsc only.

Signed-off-by: Hank Janssen <[email protected]>
Signed-off-by: Haiyang Zhang <[email protected]>
Signed-off-by: K. Y. Srinivasan <[email protected]>

---
drivers/staging/hv/netvsc.c | 102 ++-----------------------------------
drivers/staging/hv/netvsc_drv.c | 10 ----
drivers/staging/hv/rndis_filter.c | 13 -----
3 files changed, 4 insertions(+), 121 deletions(-)

diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 20b1597..be572b4 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -178,13 +178,6 @@ int netvsc_initialize(struct hv_driver *drv)
{
struct netvsc_driver *driver = (struct netvsc_driver *)drv;

- DPRINT_DBG(NETVSC, "sizeof(struct hv_netvsc_packet)=%zd, "
- "sizeof(struct nvsp_message)=%zd, "
- "sizeof(struct vmtransfer_page_packet_header)=%zd",
- sizeof(struct hv_netvsc_packet),
- sizeof(struct nvsp_message),
- sizeof(struct vmtransfer_page_packet_header));
-
drv->name = driver_name;
memcpy(&drv->dev_type, &netvsc_device_type, sizeof(struct hv_guid));

@@ -223,8 +216,6 @@ static int netvsc_init_recv_buf(struct hv_device *device)
goto cleanup;
}

- DPRINT_INFO(NETVSC, "Establishing receive buffer's GPADL...");
-
/*
* Establish the gpadl handle for this buffer on this
* channel. Note: This call uses the vmbus connection rather
@@ -241,8 +232,6 @@ static int netvsc_init_recv_buf(struct hv_device *device)


/* Notify the NetVsp of the gpadl handle */
- DPRINT_INFO(NETVSC, "Sending NvspMessage1TypeSendReceiveBuffer...");
-
init_packet = &net_device->channel_init_pkt;

memset(init_packet, 0, sizeof(struct nvsp_message));
@@ -301,14 +290,6 @@ static int netvsc_init_recv_buf(struct hv_device *device)
net_device->recv_section_cnt *
sizeof(struct nvsp_1_receive_buffer_section));

- DPRINT_INFO(NETVSC, "Receive sections info (count %d, offset %d, "
- "endoffset %d, suballoc size %d, num suballocs %d)",
- net_device->recv_section_cnt,
- net_device->recv_section[0].offset,
- net_device->recv_section[0].end_offset,
- net_device->recv_section[0].sub_alloc_size,
- net_device->recv_section[0].num_sub_allocs);
-
/*
* For 1st release, there should only be 1 section that represents the
* entire receive buffer
@@ -356,8 +337,6 @@ static int netvsc_init_send_buf(struct hv_device *device)
goto cleanup;
}

- DPRINT_INFO(NETVSC, "Establishing send buffer's GPADL...");
-
/*
* Establish the gpadl handle for this buffer on this
* channel. Note: This call uses the vmbus connection rather
@@ -372,8 +351,6 @@ static int netvsc_init_send_buf(struct hv_device *device)
}

/* Notify the NetVsp of the gpadl handle */
- DPRINT_INFO(NETVSC, "Sending NvspMessage1TypeSendSendBuffer...");
-
init_packet = &net_device->channel_init_pkt;

memset(init_packet, 0, sizeof(struct nvsp_message));
@@ -438,9 +415,6 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
* to send a revoke msg here
*/
if (net_device->recv_section_cnt) {
- DPRINT_INFO(NETVSC,
- "Sending NvspMessage1TypeRevokeReceiveBuffer...");
-
/* Send the revoke receive buffer */
revoke_packet = &net_device->revoke_packet;
memset(revoke_packet, 0, sizeof(struct nvsp_message));
@@ -468,8 +442,6 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)

/* Teardown the gpadl on the vsp end */
if (net_device->recv_buf_gpadl_handle) {
- DPRINT_INFO(NETVSC, "Tearing down receive buffer's GPADL...");
-
ret = vmbus_teardown_gpadl(net_device->dev->channel,
net_device->recv_buf_gpadl_handle);

@@ -483,8 +455,6 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
}

if (net_device->recv_buf) {
- DPRINT_INFO(NETVSC, "Freeing up receive buffer...");
-
/* Free up the receive buffer */
free_pages((unsigned long)net_device->recv_buf,
get_order(net_device->recv_buf_size));
@@ -512,9 +482,6 @@ static int netvsc_destroy_send_buf(struct netvsc_device *net_device)
* to send a revoke msg here
*/
if (net_device->send_section_size) {
- DPRINT_INFO(NETVSC,
- "Sending NvspMessage1TypeRevokeSendBuffer...");
-
/* Send the revoke send buffer */
revoke_packet = &net_device->revoke_packet;
memset(revoke_packet, 0, sizeof(struct nvsp_message));
@@ -542,7 +509,6 @@ static int netvsc_destroy_send_buf(struct netvsc_device *net_device)

/* Teardown the gpadl on the vsp end */
if (net_device->send_buf_gpadl_handle) {
- DPRINT_INFO(NETVSC, "Tearing down send buffer's GPADL...");
ret = vmbus_teardown_gpadl(net_device->dev->channel,
net_device->send_buf_gpadl_handle);

@@ -559,8 +525,6 @@ static int netvsc_destroy_send_buf(struct netvsc_device *net_device)
}

if (net_device->send_buf) {
- DPRINT_INFO(NETVSC, "Freeing up send buffer...");
-
/* Free up the receive buffer */
free_pages((unsigned long)net_device->send_buf,
get_order(net_device->send_buf_size));
@@ -594,8 +558,6 @@ static int netvsc_connect_vsp(struct hv_device *device)
init_packet->msg.init_msg.init.max_protocol_ver =
NVSP_MAX_PROTOCOL_VERSION;

- DPRINT_INFO(NETVSC, "Sending NvspMessageTypeInit...");
-
/* Send the init request */
net_device->wait_condition = 0;
ret = vmbus_sendpacket(device->channel, init_packet,
@@ -604,10 +566,8 @@ static int netvsc_connect_vsp(struct hv_device *device)
VM_PKT_DATA_INBAND,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);

- if (ret != 0) {
- DPRINT_ERR(NETVSC, "unable to send NvspMessageTypeInit");
+ if (ret != 0)
goto cleanup;
- }

wait_event_timeout(net_device->channel_init_wait,
net_device->wait_condition,
@@ -617,31 +577,17 @@ static int netvsc_connect_vsp(struct hv_device *device)
goto cleanup;
}

- DPRINT_INFO(NETVSC, "NvspMessageTypeInit status(%d) max mdl chain (%d)",
- init_packet->msg.init_msg.init_complete.status,
- init_packet->msg.init_msg.
- init_complete.max_mdl_chain_len);
-
- if (init_packet->msg.init_msg.init_complete.status !=
+ if (init_packet->msg.init_msg.init_complete.status !=
NVSP_STAT_SUCCESS) {
- DPRINT_ERR(NETVSC,
- "unable to initialize with netvsp (status 0x%x)",
- init_packet->msg.init_msg.init_complete.status);
ret = -1;
goto cleanup;
}

if (init_packet->msg.init_msg.init_complete.
negotiated_protocol_ver != NVSP_PROTOCOL_VERSION_1) {
- DPRINT_ERR(NETVSC, "unable to initialize with netvsp "
- "(version expected 1 got %d)",
- init_packet->msg.init_msg.
- init_complete.negotiated_protocol_ver);
ret = -1;
goto cleanup;
}
- DPRINT_INFO(NETVSC, "Sending NvspMessage1TypeSendNdisVersion...");
-
/* Send the ndis version */
memset(init_packet, 0, sizeof(struct nvsp_message));

@@ -661,8 +607,6 @@ static int netvsc_connect_vsp(struct hv_device *device)
(unsigned long)init_packet,
VM_PKT_DATA_INBAND, 0);
if (ret != 0) {
- DPRINT_ERR(NETVSC,
- "unable to send NvspMessage1TypeSendNdisVersion");
ret = -1;
goto cleanup;
}
@@ -702,8 +646,6 @@ static int netvsc_device_add(struct hv_device *device, void *additional_info)
goto cleanup;
}

- DPRINT_DBG(NETVSC, "netvsc channel object allocated - %p", net_device);
-
/* Initialize the NetVSC channel extension */
net_device->recv_buf_size = NETVSC_RECEIVE_BUFFER_SIZE;
spin_lock_init(&net_device->recv_pkt_list_lock);
@@ -716,12 +658,9 @@ static int netvsc_device_add(struct hv_device *device, void *additional_info)
packet = kzalloc(sizeof(struct hv_netvsc_packet) +
(NETVSC_RECEIVE_SG_COUNT *
sizeof(struct hv_page_buffer)), GFP_KERNEL);
- if (!packet) {
- DPRINT_DBG(NETVSC, "unable to allocate netvsc pkts "
- "for receive pool (wanted %d got %d)",
- NETVSC_RECEIVE_PACKETLIST_COUNT, i);
+ if (!packet)
break;
- }
+
list_add_tail(&packet->list_ent,
&net_device->recv_pkt_list);
}
@@ -749,9 +688,6 @@ static int netvsc_device_add(struct hv_device *device, void *additional_info)
goto close;
}

- DPRINT_INFO(NETVSC, "*** NetVSC channel handshake result - %d ***",
- ret);
-
return ret;

close:
@@ -785,9 +721,6 @@ static int netvsc_device_remove(struct hv_device *device)
struct netvsc_device *net_device;
struct hv_netvsc_packet *netvsc_packet, *pos;

- DPRINT_INFO(NETVSC, "Disabling outbound traffic on net device (%p)...",
- device->ext);
-
/* Stop outbound traffic ie sends and receives completions */
net_device = release_outbound_net_device(device);
if (!net_device) {
@@ -802,13 +735,8 @@ static int netvsc_device_remove(struct hv_device *device)
udelay(100);
}

- DPRINT_INFO(NETVSC, "Disconnecting from netvsp...");
-
NetVscDisconnectFromVsp(net_device);

- DPRINT_INFO(NETVSC, "Disabling inbound traffic on net device (%p)...",
- device->ext);
-
/* Stop inbound traffic ie receives and sends completions */
net_device = release_inbound_net_device(device);

@@ -853,9 +781,6 @@ static void netvsc_send_completion(struct hv_device *device,
nvsp_packet = (struct nvsp_message *)((unsigned long)packet +
(packet->offset8 << 3));

- DPRINT_DBG(NETVSC, "send completion packet - type %d",
- nvsp_packet->hdr.msg_type);
-
if ((nvsp_packet->hdr.msg_type == NVSP_MSG_TYPE_INIT_COMPLETE) ||
(nvsp_packet->hdr.msg_type ==
NVSP_MSG1_TYPE_SEND_RECV_BUF_COMPLETE) ||
@@ -985,9 +910,6 @@ static void netvsc_receive(struct hv_device *device,
return;
}

- DPRINT_DBG(NETVSC, "NVSP packet received - type %d",
- nvsp_packet->hdr.msg_type);
-
vmxferpage_packet = (struct vmtransfer_page_packet_header *)packet;

if (vmxferpage_packet->xfer_pageset_id != NETVSC_RECEIVE_BUFFER_ID) {
@@ -998,9 +920,6 @@ static void netvsc_receive(struct hv_device *device,
return;
}

- DPRINT_DBG(NETVSC, "xfer page - range count %d",
- vmxferpage_packet->range_cnt);
-
/*
* Grab free packets (range count + 1) to represent this xfer
* page packet. +1 to represent the xfer page packet itself.
@@ -1117,13 +1036,6 @@ static void netvsc_receive(struct hv_device *device,
break;
}
}
- DPRINT_DBG(NETVSC, "[%d] - (abs offset %u len %u) => "
- "(pfn %llx, offset %u, len %u)", i,
- vmxferpage_packet->ranges[i].byte_offset,
- vmxferpage_packet->ranges[i].byte_count,
- netvsc_packet->page_buf[0].pfn,
- netvsc_packet->page_buf[0].offset,
- netvsc_packet->page_buf[0].len);

/* Pass it to the upper layer */
((struct netvsc_driver *)device->drv)->
@@ -1143,9 +1055,6 @@ static void netvsc_send_recv_completion(struct hv_device *device,
int retries = 0;
int ret;

- DPRINT_DBG(NETVSC, "Sending receive completion pkt - %llx",
- transaction_id);
-
recvcompMessage.hdr.msg_type =
NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE;

@@ -1261,9 +1170,6 @@ static void netvsc_channel_cb(void *context)
&bytes_recvd, &request_id);
if (ret == 0) {
if (bytes_recvd > 0) {
- DPRINT_DBG(NETVSC, "receive %d bytes, tid %llx",
- bytes_recvd, request_id);
-
desc = (struct vmpacket_descriptor *)buffer;
switch (desc->type) {
case VM_PKT_COMP:
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 2d40f5f..1772a19 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -136,9 +136,6 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
int ret;
unsigned int i, num_pages;

- DPRINT_DBG(NETVSC_DRV, "xmit packet - len %d data_len %d",
- skb->len, skb->data_len);
-
/* Add 1 for skb->data and additional one for RNDIS */
num_pages = skb_shinfo(skb)->nr_frags + 1 + 1;
if (num_pages > net_device_ctx->avail)
@@ -196,10 +193,6 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
net->stats.tx_bytes += skb->len;
net->stats.tx_packets++;

- DPRINT_DBG(NETVSC_DRV, "# of xmits %lu total size %lu",
- net->stats.tx_packets,
- net->stats.tx_bytes);
-
net_device_ctx->avail -= num_pages;
if (net_device_ctx->avail < PACKET_PAGES_LOWATER)
netif_stop_queue(net);
@@ -297,9 +290,6 @@ static int netvsc_recv_callback(struct hv_device *device_obj,
*/
netif_rx(skb);

- DPRINT_DBG(NETVSC_DRV, "# of recvs %lu total size %lu",
- net->stats.rx_packets, net->stats.rx_bytes);
-
return 0;
}

diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index e7189cd..d1b13dc 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -283,14 +283,6 @@ static void rndis_filter_receive_response(struct rndis_device *dev,
*/
if (request->request_msg.msg.init_req.req_id
== resp->msg.init_complete.req_id) {
- DPRINT_DBG(NETVSC, "found rndis request for "
- "this response (id 0x%x req type 0x%x res "
- "type 0x%x)",
- request->request_msg.msg.
- init_req.req_id,
- request->request_msg.ndis_msg_type,
- resp->ndis_msg_type);
-
found = true;
break;
}
@@ -605,9 +597,6 @@ Exit:

int rndis_filter_init(struct netvsc_driver *drv)
{
- DPRINT_DBG(NETVSC, "sizeof(struct rndis_filter_packet) == %zd",
- sizeof(struct rndis_filter_packet));
-
drv->req_ext_size = sizeof(struct rndis_filter_packet);

/* Driver->Context = rndisDriver; */
@@ -765,8 +754,6 @@ static int rndis_filte_device_add(struct hv_device *dev,
if (!rndisDevice)
return -1;

- DPRINT_DBG(NETVSC, "rndis device object allocated - %p", rndisDevice);
-
/*
* Let the inner driver handle this first to create the netvsc channel
* NOTE! Once the channel is created, we may get a receive callback
--
1.6.0.2

2011-03-29 20:48:15

by Hank Janssen

[permalink] [raw]
Subject: [PATCH 04/07] Replace DPRINT with natives in hv_vmbus

Replace all remaining DPRINT calls (excluding the ringbuffer debug
which is going to be done in a next set of patches) with their
native pr_ calls. And also changed some of the printouts to be more
useful.

Signed-off-by: Hank Janssen <[email protected]>
Signed-off-by: Haiyang Zhang <[email protected]>
Signed-off-by: K. Y. Srinivasan <[email protected]>

---
drivers/staging/hv/channel.c | 9 +++++--
drivers/staging/hv/channel_mgmt.c | 25 ++++++++++-----------
drivers/staging/hv/connection.c | 12 ++++++----
drivers/staging/hv/hv.c | 10 ++++----
drivers/staging/hv/ring_buffer.c | 1 +
drivers/staging/hv/vmbus_drv.c | 43 +++++++++++++++---------------------
6 files changed, 49 insertions(+), 51 deletions(-)

diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
index c90dbaf..ddadd6e 100644
--- a/drivers/staging/hv/channel.c
+++ b/drivers/staging/hv/channel.c
@@ -18,6 +18,8 @@
* Haiyang Zhang <[email protected]>
* Hank Janssen <[email protected]>
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/wait.h>
@@ -898,7 +900,7 @@ int vmbus_recvpacket(struct vmbus_channel *channel, void *buffer,
if (userlen > bufferlen) {
spin_unlock_irqrestore(&channel->inbound_lock, flags);

- DPRINT_ERR(VMBUS, "buffer too small - got %d needs %d",
+ pr_err("Buffer too small - got %d needs %d\n",
bufferlen, userlen);
return -1;
}
@@ -950,8 +952,9 @@ int vmbus_recvpacket_raw(struct vmbus_channel *channel, void *buffer,
if (packetlen > bufferlen) {
spin_unlock_irqrestore(&channel->inbound_lock, flags);

- DPRINT_ERR(VMBUS, "buffer too small - needed %d bytes but "
- "got space for only %d bytes", packetlen, bufferlen);
+ pr_err("Buffer too small - needed %d bytes but "
+ "got space for only %d bytes\n",
+ packetlen, bufferlen);
return -2;
}

diff --git a/drivers/staging/hv/channel_mgmt.c b/drivers/staging/hv/channel_mgmt.c
index ebdd9d8..a75a1ae 100644
--- a/drivers/staging/hv/channel_mgmt.c
+++ b/drivers/staging/hv/channel_mgmt.c
@@ -18,6 +18,8 @@
* Haiyang Zhang <[email protected]>
* Hank Janssen <[email protected]>
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/wait.h>
@@ -403,8 +405,7 @@ static void vmbus_process_offer(struct work_struct *work)
*/
ret = vmbus_child_device_register(newchannel->device_obj);
if (ret != 0) {
- DPRINT_ERR(VMBUS,
- "unable to add child device object (relid %d)",
+ pr_err("unable to add child device object (relid %d)\n",
newchannel->offermsg.child_relid);

spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
@@ -430,8 +431,9 @@ static void vmbus_process_offer(struct work_struct *work)
hv_cb_utils[cnt].callback,
newchannel) == 0) {
hv_cb_utils[cnt].channel = newchannel;
- DPRINT_INFO(VMBUS, "%s",
- hv_cb_utils[cnt].log_msg);
+
+ pr_info("%s\n", hv_cb_utils[cnt].log_msg);
+
count_hv_channel();
}
}
@@ -472,7 +474,7 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr)
/* Allocate the channel object and save this offer. */
newchannel = alloc_channel();
if (!newchannel) {
- DPRINT_ERR(VMBUS, "unable to allocate channel object");
+ pr_err("Unable to allocate channel object\n");
return;
}

@@ -730,8 +732,7 @@ void vmbus_onmessage(void *context)
size = msg->header.payload_size;

if (hdr->msgtype >= CHANNELMSG_COUNT) {
- DPRINT_ERR(VMBUS,
- "Received invalid channel message type %d size %d",
+ pr_err("Received invalid channel message type %d size %d\n",
hdr->msgtype, size);
print_hex_dump_bytes("", DUMP_PREFIX_NONE,
(unsigned char *)msg->u.payload, size);
@@ -741,8 +742,7 @@ void vmbus_onmessage(void *context)
if (gChannelMessageTable[hdr->msgtype].messageHandler)
gChannelMessageTable[hdr->msgtype].messageHandler(hdr);
else
- DPRINT_ERR(VMBUS, "Unhandled channel message type %d",
- hdr->msgtype);
+ pr_err("Unhandled channel message type %d\n", hdr->msgtype);
}

/*
@@ -770,7 +770,7 @@ int vmbus_request_offers(void)
ret = vmbus_post_msg(msg,
sizeof(struct vmbus_channel_message_header));
if (ret != 0) {
- DPRINT_ERR(VMBUS, "Unable to request offers - %d", ret);
+ pr_err("Unable to request offers - %d\n", ret);

goto cleanup;
}
@@ -810,9 +810,8 @@ void vmbus_release_unattached_channels(void)

if (!channel->device_obj->drv) {
list_del(&channel->listentry);
- DPRINT_INFO(VMBUS,
- "Releasing unattached device object %p",
- channel->device_obj);
+
+ pr_err("Releasing unattached device object\n");

vmbus_child_device_unregister(channel->device_obj);
free_channel(channel);
diff --git a/drivers/staging/hv/connection.c b/drivers/staging/hv/connection.c
index ed2a7a8..7de0780 100644
--- a/drivers/staging/hv/connection.c
+++ b/drivers/staging/hv/connection.c
@@ -20,6 +20,8 @@
* Hank Janssen <[email protected]>
*
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/wait.h>
@@ -153,9 +155,9 @@ int vmbus_connect(void)
if (msginfo->response.version_response.version_supported) {
vmbus_connection.conn_state = CONNECTED;
} else {
- DPRINT_ERR(VMBUS, "Vmbus connection failed!!..."
- "current version (%d) not supported",
- VMBUS_REVISION_NUMBER);
+ pr_err("Unable to connect, "
+ "Version %d not supported by Hyper-V\n",
+ VMBUS_REVISION_NUMBER);
ret = -1;
goto Cleanup;
}
@@ -216,7 +218,7 @@ int vmbus_disconnect(void)

vmbus_connection.conn_state = DISCONNECTED;

- DPRINT_INFO(VMBUS, "Vmbus disconnected!!");
+ pr_info("hv_vmbus disconnected\n");

Cleanup:
kfree(msg);
@@ -269,7 +271,7 @@ static void process_chn_event(void *context)
* (void*)channel);
*/
} else {
- DPRINT_ERR(VMBUS, "channel not found for relid - %d.", relid);
+ pr_err("channel not found for relid - %d\n", relid);
}
}

diff --git a/drivers/staging/hv/hv.c b/drivers/staging/hv/hv.c
index d627a83..8898d7f 100644
--- a/drivers/staging/hv/hv.c
+++ b/drivers/staging/hv/hv.c
@@ -19,6 +19,8 @@
* Hank Janssen <[email protected]>
*
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/slab.h>
@@ -116,7 +118,7 @@ static int query_hypervisor_info(void)
edx = 0;
op = HVCPUID_VERSION;
cpuid(op, &eax, &ebx, &ecx, &edx);
- DPRINT_INFO(VMBUS, "OS Build:%d-%d.%d-%d-%d.%d",\
+ pr_info("Hyper-V Host OS Build:%d-%d.%d-%d-%d.%d\n",
eax,
ebx >> 16,
ebx & 0xFFFF,
@@ -369,8 +371,7 @@ void hv_synic_init(void *irqarg)
(void *)get_zeroed_page(GFP_ATOMIC);

if (hv_context.synic_message_page[cpu] == NULL) {
- DPRINT_ERR(VMBUS,
- "unable to allocate SYNIC message page!!");
+ pr_err("Unable to allocate SYNIC message page\n");
goto Cleanup;
}

@@ -378,8 +379,7 @@ void hv_synic_init(void *irqarg)
(void *)get_zeroed_page(GFP_ATOMIC);

if (hv_context.synic_event_page[cpu] == NULL) {
- DPRINT_ERR(VMBUS,
- "unable to allocate SYNIC event page!!");
+ pr_err("Unable to allocate SYNIC event page\n");
goto Cleanup;
}

diff --git a/drivers/staging/hv/ring_buffer.c b/drivers/staging/hv/ring_buffer.c
index 9bd5218..66e1b3f 100644
--- a/drivers/staging/hv/ring_buffer.c
+++ b/drivers/staging/hv/ring_buffer.c
@@ -20,6 +20,7 @@
* Hank Janssen <[email protected]>
*
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
#include <linux/mm.h>
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index b320f71..cb6dbc0 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -20,6 +20,8 @@
*
* 3/9/2011: K. Y. Srinivasan - Significant restructuring and cleanup
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/init.h>
#include <linux/module.h>
#include <linux/device.h>
@@ -350,18 +352,16 @@ static int vmbus_probe(struct device *child_device)
ret = dev->probe_error =
drv->driver.probe(child_device);
if (ret != 0) {
- DPRINT_ERR(VMBUS_DRV, "probe() failed for device %s "
- "(%p) on driver %s (%d)...",
- dev_name(child_device), child_device,
- child_device->driver->name, ret);
+ pr_err("probe failed for device %s (%d)\n",
+ dev_name(child_device), ret);

INIT_WORK(&dev->probe_failed_work_item,
vmbus_probe_failed_cb);
schedule_work(&dev->probe_failed_work_item);
}
} else {
- DPRINT_ERR(VMBUS_DRV, "probe() method not set for driver - %s",
- child_device->driver->name);
+ pr_err("probe not set for driver %s\n",
+ dev_name(child_device));
ret = -1;
}
return ret;
@@ -386,9 +386,8 @@ static int vmbus_remove(struct device *child_device)
if (drv->driver.remove) {
ret = drv->driver.remove(child_device);
} else {
- DPRINT_ERR(VMBUS_DRV,
- "remove() method not set for driver - %s",
- child_device->driver->name);
+ pr_err("remove not set for driver %s\n",
+ dev_name(child_device));
ret = -1;
}
}
@@ -572,12 +571,10 @@ static int vmbus_bus_init(struct pci_dev *pdev)
/* Hypervisor initialization...setup hypercall page..etc */
ret = hv_init();
if (ret != 0) {
- DPRINT_ERR(VMBUS, "Unable to initialize the hypervisor - 0x%x",
- ret);
+ pr_err("Unable to initialize the hypervisor - 0x%x\n", ret);
goto cleanup;
}

-
hv_bus.bus.name = driver_name;

/* Initialize the bus context */
@@ -599,7 +596,7 @@ static int vmbus_bus_init(struct pci_dev *pdev)
driver_name, pdev);

if (ret != 0) {
- DPRINT_ERR(VMBUS_DRV, "ERROR - Unable to request IRQ %d",
+ pr_err("Unable to request IRQ %d\n",
pdev->irq);

bus_unregister(&hv_bus.bus);
@@ -669,8 +666,7 @@ int vmbus_child_driver_register(struct device_driver *drv)
{
int ret;

- DPRINT_INFO(VMBUS_DRV, "child driver (%p) registering - name %s",
- drv, drv->name);
+ pr_info("child driver registering - name %s\n", drv->name);

/* The child driver on this vmbus */
drv->bus = &hv_bus.bus;
@@ -695,8 +691,7 @@ EXPORT_SYMBOL(vmbus_child_driver_register);
*/
void vmbus_child_driver_unregister(struct device_driver *drv)
{
- DPRINT_INFO(VMBUS_DRV, "child driver (%p) unregistering - name %s",
- drv, drv->name);
+ pr_info("child driver unregistering - name %s\n", drv->name);

driver_unregister(drv);

@@ -717,8 +712,7 @@ struct hv_device *vmbus_child_device_create(struct hv_guid *type,
/* Allocate the new child device */
child_device_obj = kzalloc(sizeof(struct hv_device), GFP_KERNEL);
if (!child_device_obj) {
- DPRINT_ERR(VMBUS_DRV,
- "unable to allocate device_context for child device");
+ pr_err("Unable to allocate device object for child device\n");
return NULL;
}

@@ -759,11 +753,10 @@ int vmbus_child_device_register(struct hv_device *child_device_obj)
ret = child_device_obj->probe_error;

if (ret)
- DPRINT_ERR(VMBUS_DRV, "unable to register child device (%p)",
- &child_device_obj->device);
+ pr_err("Unable to register child device\n");
else
- DPRINT_INFO(VMBUS_DRV, "child device (%p) registered",
- &child_device_obj->device);
+ pr_info("child device %s registered\n",
+ dev_name(&child_device_obj->device));

return ret;
}
@@ -780,8 +773,8 @@ void vmbus_child_device_unregister(struct hv_device *device_obj)
*/
device_unregister(&device_obj->device);

- DPRINT_INFO(VMBUS_DRV, "child device (%p) unregistered",
- &device_obj->device);
+ pr_info("child device %s unregistered\n",
+ dev_name(&device_obj->device));
}


--
1.6.0.2

2011-03-29 20:48:12

by Hank Janssen

[permalink] [raw]
Subject: [PATCH 01/07] Remove all unneeded DPRINT from hv_vmbus

Remove all un-needed DPRINT calls from hv_vmbus. Several
are remaining that will be cleaned up in my next set of patches.
They deal with printing out the ringbuffer debugging which is
going to be implemented slightly differently.

This patch deals with hv_vmbus only.

Signed-off-by: Hank Janssen <[email protected]>
Signed-off-by: Haiyang Zhang <[email protected]>
Signed-off-by: K. Y. Srinivasan <[email protected]>

---
drivers/staging/hv/channel.c | 70 ++++---------------------------------
drivers/staging/hv/channel_mgmt.c | 51 ++-------------------------
drivers/staging/hv/connection.c | 9 -----
drivers/staging/hv/hv.c | 54 ++++------------------------
drivers/staging/hv/ring_buffer.c | 20 ----------
drivers/staging/hv/vmbus_drv.c | 69 +-----------------------------------
6 files changed, 21 insertions(+), 252 deletions(-)

diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
index 775a52a..c90dbaf 100644
--- a/drivers/staging/hv/channel.c
+++ b/drivers/staging/hv/channel.c
@@ -213,9 +213,6 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,


/* Establish the gpadl for the ring buffer */
- DPRINT_DBG(VMBUS, "Establishing ring buffer's gpadl for channel %p...",
- newchannel);
-
newchannel->ringbuffer_gpadlhandle = 0;

ret = vmbus_establish_gpadl(newchannel,
@@ -229,16 +226,6 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
goto errorout;
}

- DPRINT_DBG(VMBUS, "channel %p <relid %d gpadl 0x%x send ring %p "
- "size %d recv ring %p size %d, downstreamoffset %d>",
- newchannel, newchannel->offermsg.child_relid,
- newchannel->ringbuffer_gpadlhandle,
- newchannel->outbound.ring_buffer,
- newchannel->outbound.ring_size,
- newchannel->inbound.ring_buffer,
- newchannel->inbound.ring_size,
- send_ringbuffer_size);
-
/* Create and init the channel open message */
openInfo = kmalloc(sizeof(*openInfo) +
sizeof(struct vmbus_channel_open_channel),
@@ -272,14 +259,11 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
&vmbus_connection.chn_msg_list);
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);

- DPRINT_DBG(VMBUS, "Sending channel open msg...");
-
ret = vmbus_post_msg(openMsg,
sizeof(struct vmbus_channel_open_channel));
- if (ret != 0) {
- DPRINT_ERR(VMBUS, "unable to open channel - %d", ret);
+
+ if (ret != 0)
goto Cleanup;
- }

openInfo->wait_condition = 0;
wait_event_timeout(openInfo->waitevent,
@@ -291,11 +275,8 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
}


- if (openInfo->response.open_result.status == 0)
- DPRINT_INFO(VMBUS, "channel <%p> open success!!", newchannel);
- else
- DPRINT_INFO(VMBUS, "channel <%p> open failed - %d!!",
- newchannel, openInfo->response.open_result.status);
+ if (openInfo->response.open_result.status)
+ err = openInfo->response.open_result.status;

Cleanup:
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
@@ -303,7 +284,7 @@ Cleanup:
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);

kfree(openInfo);
- return 0;
+ return err;

errorout:
ringbuffer_cleanup(&newchannel->outbound);
@@ -326,6 +307,7 @@ static void dump_gpadl_body(struct vmbus_channel_gpadl_body *gpadl, u32 len)

pfncount = (len - sizeof(struct vmbus_channel_gpadl_body)) /
sizeof(u64);
+
DPRINT_DBG(VMBUS, "gpadl body - len %d pfn count %d", len, pfncount);

for (i = 0; i < pfncount; i++)
@@ -530,19 +512,12 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
&vmbus_connection.chn_msg_list);

spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
- DPRINT_DBG(VMBUS, "buffer %p, size %d msg cnt %d",
- kbuffer, size, msgcount);
-
- DPRINT_DBG(VMBUS, "Sending GPADL Header - len %zd",
- msginfo->msgsize - sizeof(*msginfo));

msginfo->wait_condition = 0;
ret = vmbus_post_msg(gpadlmsg, msginfo->msgsize -
sizeof(*msginfo));
- if (ret != 0) {
- DPRINT_ERR(VMBUS, "Unable to open channel - %d", ret);
+ if (ret != 0)
goto Cleanup;
- }

if (msgcount > 1) {
list_for_each(curr, &msginfo->submsglist) {
@@ -556,10 +531,6 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
CHANNELMSG_GPADL_BODY;
gpadl_body->gpadl = next_gpadl_handle;

- DPRINT_DBG(VMBUS, "Sending GPADL Body - len %zd",
- submsginfo->msgsize -
- sizeof(*submsginfo));
-
dump_gpadl_body(gpadl_body, submsginfo->msgsize -
sizeof(*submsginfo));
ret = vmbus_post_msg(gpadl_body,
@@ -577,12 +548,6 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,


/* At this point, we received the gpadl created msg */
- DPRINT_DBG(VMBUS, "Received GPADL created "
- "(relid %d, status %d handle %x)",
- channel->offermsg.child_relid,
- msginfo->response.gpadl_created.creation_status,
- gpadlmsg->gpadl);
-
*gpadl_handle = gpadlmsg->gpadl;

Cleanup:
@@ -730,9 +695,6 @@ int vmbus_sendpacket(struct vmbus_channel *channel, const void *buffer,
u64 aligned_data = 0;
int ret;

- DPRINT_DBG(VMBUS, "channel %p buffer %p len %d",
- channel, buffer, bufferlen);
-
dump_vmbus_channel(channel);

/* ASSERT((packetLenAligned - packetLen) < sizeof(u64)); */
@@ -846,10 +808,6 @@ int vmbus_sendpacket_multipagebuffer(struct vmbus_channel *channel,

dump_vmbus_channel(channel);

- DPRINT_DBG(VMBUS, "data buffer - offset %u len %u pfn count %u",
- multi_pagebuffer->offset,
- multi_pagebuffer->len, pfncount);
-
if ((pfncount < 0) || (pfncount > MAX_MULTIPAGE_BUFFER_COUNT))
return -EINVAL;

@@ -926,8 +884,6 @@ int vmbus_recvpacket(struct vmbus_channel *channel, void *buffer,
sizeof(struct vmpacket_descriptor));
if (ret != 0) {
spin_unlock_irqrestore(&channel->inbound_lock, flags);
-
- /* DPRINT_DBG(VMBUS, "nothing to read!!"); */
return 0;
}

@@ -937,11 +893,6 @@ int vmbus_recvpacket(struct vmbus_channel *channel, void *buffer,
userlen = packetlen - (desc.offset8 << 3);
/* ASSERT(userLen > 0); */

- DPRINT_DBG(VMBUS, "packet received on channel %p relid %d <type %d "
- "flag %d tid %llx pktlen %d datalen %d> ",
- channel, channel->offermsg.child_relid, desc.type,
- desc.flags, desc.trans_id, packetlen, userlen);
-
*buffer_actual_len = userlen;

if (userlen > bufferlen) {
@@ -986,8 +937,6 @@ int vmbus_recvpacket_raw(struct vmbus_channel *channel, void *buffer,
sizeof(struct vmpacket_descriptor));
if (ret != 0) {
spin_unlock_irqrestore(&channel->inbound_lock, flags);
-
- /* DPRINT_DBG(VMBUS, "nothing to read!!"); */
return 0;
}

@@ -996,11 +945,6 @@ int vmbus_recvpacket_raw(struct vmbus_channel *channel, void *buffer,
packetlen = desc.len8 << 3;
userlen = packetlen - (desc.offset8 << 3);

- DPRINT_DBG(VMBUS, "packet received on channel %p relid %d <type %d "
- "flag %d tid %llx pktlen %d datalen %d> ",
- channel, channel->offermsg.child_relid, desc.type,
- desc.flags, desc.trans_id, packetlen, userlen);
-
*buffer_actual_len = packetlen;

if (packetlen > bufferlen) {
diff --git a/drivers/staging/hv/channel_mgmt.c b/drivers/staging/hv/channel_mgmt.c
index bc0393a..ebdd9d8 100644
--- a/drivers/staging/hv/channel_mgmt.c
+++ b/drivers/staging/hv/channel_mgmt.c
@@ -290,9 +290,7 @@ static void release_channel(struct work_struct *work)
struct vmbus_channel,
work);

- DPRINT_DBG(VMBUS, "releasing channel (%p)", channel);
destroy_workqueue(channel->controlwq);
- DPRINT_DBG(VMBUS, "channel released (%p)", channel);

kfree(channel);
}
@@ -384,8 +382,6 @@ static void vmbus_process_offer(struct work_struct *work)
spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);

if (!fnew) {
- DPRINT_DBG(VMBUS, "Ignoring duplicate offer for relid (%d)",
- newchannel->offermsg.child_relid);
free_channel(newchannel);
return;
}
@@ -400,9 +396,6 @@ static void vmbus_process_offer(struct work_struct *work)
&newchannel->offermsg.offer.if_instance,
newchannel);

- DPRINT_DBG(VMBUS, "child device object allocated - %p",
- newchannel->device_obj);
-
/*
* Add the new device to the bus. This will kick off device-driver
* binding which eventually invokes the device driver's AddDevice()
@@ -470,40 +463,12 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr)
}
}

- if (!fsupported) {
- DPRINT_DBG(VMBUS, "Ignoring channel offer notification for "
- "child relid %d", offer->child_relid);
+ if (!fsupported)
return;
- }

guidtype = &offer->offer.if_type;
guidinstance = &offer->offer.if_instance;

- DPRINT_INFO(VMBUS, "Channel offer notification - "
- "child relid %d monitor id %d allocated %d, "
- "type {%02x%02x%02x%02x-%02x%02x-%02x%02x-"
- "%02x%02x%02x%02x%02x%02x%02x%02x} "
- "instance {%02x%02x%02x%02x-%02x%02x-%02x%02x-"
- "%02x%02x%02x%02x%02x%02x%02x%02x}",
- offer->child_relid, offer->monitorid,
- offer->monitor_allocated,
- guidtype->data[3], guidtype->data[2],
- guidtype->data[1], guidtype->data[0],
- guidtype->data[5], guidtype->data[4],
- guidtype->data[7], guidtype->data[6],
- guidtype->data[8], guidtype->data[9],
- guidtype->data[10], guidtype->data[11],
- guidtype->data[12], guidtype->data[13],
- guidtype->data[14], guidtype->data[15],
- guidinstance->data[3], guidinstance->data[2],
- guidinstance->data[1], guidinstance->data[0],
- guidinstance->data[5], guidinstance->data[4],
- guidinstance->data[7], guidinstance->data[6],
- guidinstance->data[8], guidinstance->data[9],
- guidinstance->data[10], guidinstance->data[11],
- guidinstance->data[12], guidinstance->data[13],
- guidinstance->data[14], guidinstance->data[15]);
-
/* Allocate the channel object and save this offer. */
newchannel = alloc_channel();
if (!newchannel) {
@@ -511,8 +476,6 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr)
return;
}

- DPRINT_DBG(VMBUS, "channel object allocated - %p", newchannel);
-
memcpy(&newchannel->offermsg, offer,
sizeof(struct vmbus_channel_offer_channel));
newchannel->monitor_grp = (u8)offer->monitorid / 32;
@@ -535,11 +498,10 @@ static void vmbus_onoffer_rescind(struct vmbus_channel_message_header *hdr)

rescind = (struct vmbus_channel_rescind_offer *)hdr;
channel = relid2channel(rescind->child_relid);
- if (channel == NULL) {
- DPRINT_DBG(VMBUS, "channel not found for relId %d",
- rescind->child_relid);
+
+ if (channel == NULL)
+ /* Just return here, no channel found */
return;
- }

/* work is initialized for vmbus_process_rescind_offer() from
* vmbus_process_offer() where the channel got created */
@@ -573,7 +535,6 @@ static void vmbus_onopen_result(struct vmbus_channel_message_header *hdr)
unsigned long flags;

result = (struct vmbus_channel_open_result *)hdr;
- DPRINT_DBG(VMBUS, "vmbus open result - %d", result->status);

/*
* Find the open msg, copy the result and signal/unblock the wait event
@@ -618,8 +579,6 @@ static void vmbus_ongpadl_created(struct vmbus_channel_message_header *hdr)
unsigned long flags;

gpadlcreated = (struct vmbus_channel_gpadl_created *)hdr;
- DPRINT_DBG(VMBUS, "vmbus gpadl created result - %d",
- gpadlcreated->creation_status);

/*
* Find the establish msg, copy the result and signal/unblock the wait
@@ -770,8 +729,6 @@ void vmbus_onmessage(void *context)
hdr = (struct vmbus_channel_message_header *)msg->u.payload;
size = msg->header.payload_size;

- DPRINT_DBG(VMBUS, "message type %d size %d", hdr->msgtype, size);
-
if (hdr->msgtype >= CHANNELMSG_COUNT) {
DPRINT_ERR(VMBUS,
"Received invalid channel message type %d size %d",
diff --git a/drivers/staging/hv/connection.c b/drivers/staging/hv/connection.c
index 44b203b..ed2a7a8 100644
--- a/drivers/staging/hv/connection.c
+++ b/drivers/staging/hv/connection.c
@@ -121,11 +121,6 @@ int vmbus_connect(void)

spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);

- DPRINT_DBG(VMBUS, "Vmbus connection - interrupt pfn %llx, "
- "monitor1 pfn %llx,, monitor2 pfn %llx",
- msg->interrupt_page, msg->monitor_page1, msg->monitor_page2);
-
- DPRINT_DBG(VMBUS, "Sending channel initiate msg...");
ret = vmbus_post_msg(msg,
sizeof(struct vmbus_channel_initiate_contact));
if (ret != 0) {
@@ -156,9 +151,7 @@ int vmbus_connect(void)

/* Check if successful */
if (msginfo->response.version_response.version_supported) {
- DPRINT_INFO(VMBUS, "Vmbus connected!!");
vmbus_connection.conn_state = CONNECTED;
-
} else {
DPRINT_ERR(VMBUS, "Vmbus connection failed!!..."
"current version (%d) not supported",
@@ -300,11 +293,9 @@ void vmbus_on_event(unsigned long data)
(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); */
diff --git a/drivers/staging/hv/hv.c b/drivers/staging/hv/hv.c
index 2d492ad..d627a83 100644
--- a/drivers/staging/hv/hv.c
+++ b/drivers/staging/hv/hv.c
@@ -80,7 +80,7 @@ static int query_hypervisor_info(void)
op = HVCPUID_VENDOR_MAXFUNCTION;
cpuid(op, &eax, &ebx, &ecx, &edx);

- DPRINT_INFO(VMBUS, "Vendor ID: %c%c%c%c%c%c%c%c%c%c%c%c",
+/* DPRINT_INFO(VMBUS, "Vendor ID: %c%c%c%c%c%c%c%c%c%c%c%c",
(ebx & 0xFF),
((ebx >> 8) & 0xFF),
((ebx >> 16) & 0xFF),
@@ -93,9 +93,9 @@ static int query_hypervisor_info(void)
((edx >> 8) & 0xFF),
((edx >> 16) & 0xFF),
((edx >> 24) & 0xFF));
-
+*/
max_leaf = eax;
- eax = 0;
+/* eax = 0;
ebx = 0;
ecx = 0;
edx = 0;
@@ -107,6 +107,7 @@ static int query_hypervisor_info(void)
((eax >> 8) & 0xFF),
((eax >> 16) & 0xFF),
((eax >> 24) & 0xFF));
+*/

if (max_leaf >= HVCPUID_VERSION) {
eax = 0;
@@ -137,18 +138,11 @@ static u64 do_hypercall(u64 control, void *input, void *output)
u64 output_address = (output) ? virt_to_phys(output) : 0;
volatile void *hypercall_page = hv_context.hypercall_page;

- DPRINT_DBG(VMBUS, "Hypercall <control %llx input phys %llx virt %p "
- "output phys %llx virt %p hypercall %p>",
- control, input_address, input,
- output_address, output, hypercall_page);
-
__asm__ __volatile__("mov %0, %%r8" : : "r" (output_address) : "r8");
__asm__ __volatile__("call *%3" : "=a" (hv_status) :
"c" (control), "d" (input_address),
"m" (hypercall_page));

- DPRINT_DBG(VMBUS, "Hypercall <return %llx>", hv_status);
-
return hv_status;

#else
@@ -165,18 +159,12 @@ static u64 do_hypercall(u64 control, void *input, void *output)
u32 output_address_lo = output_address & 0xFFFFFFFF;
volatile void *hypercall_page = hv_context.hypercall_page;

- DPRINT_DBG(VMBUS, "Hypercall <control %llx input %p output %p>",
- control, input, output);
-
__asm__ __volatile__ ("call *%8" : "=d"(hv_status_hi),
"=a"(hv_status_lo) : "d" (control_hi),
"a" (control_lo), "b" (input_address_hi),
"c" (input_address_lo), "D"(output_address_hi),
"S"(output_address_lo), "m" (hypercall_page));

- DPRINT_DBG(VMBUS, "Hypercall <return %llx>",
- hv_status_lo | ((u64)hv_status_hi << 32));
-
return hv_status_lo | ((u64)hv_status_hi << 32);
#endif /* !x86_64 */
}
@@ -197,13 +185,8 @@ int hv_init(void)
memset(hv_context.synic_message_page, 0,
sizeof(void *) * MAX_NUM_CPUS);

- if (!query_hypervisor_presence()) {
- DPRINT_ERR(VMBUS, "No Windows hypervisor detected!!");
+ if (!query_hypervisor_presence())
goto Cleanup;
- }
-
- DPRINT_INFO(VMBUS,
- "Windows hypervisor detected! Retrieving more info...");

max_leaf = query_hypervisor_info();
/* HvQueryHypervisorFeatures(maxLeaf); */
@@ -213,11 +196,8 @@ int hv_init(void)
*/
rdmsrl(HV_X64_MSR_GUEST_OS_ID, hv_context.guestid);

- if (hv_context.guestid != 0) {
- DPRINT_ERR(VMBUS, "Unknown guest id (0x%llx)!!",
- hv_context.guestid);
+ if (hv_context.guestid != 0)
goto Cleanup;
- }

/* Write our OS info */
wrmsrl(HV_X64_MSR_GUEST_OS_ID, HV_LINUX_GUEST_ID);
@@ -232,11 +212,8 @@ int hv_init(void)
*/
virtaddr = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_EXEC);

- if (!virtaddr) {
- DPRINT_ERR(VMBUS,
- "unable to allocate hypercall page!!");
+ if (!virtaddr)
goto Cleanup;
- }

hypercall_msr.enable = 1;

@@ -247,17 +224,11 @@ int hv_init(void)
hypercall_msr.as_uint64 = 0;
rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);

- if (!hypercall_msr.enable) {
- DPRINT_ERR(VMBUS, "unable to set hypercall page!!");
+ if (!hypercall_msr.enable)
goto Cleanup;
- }

hv_context.hypercall_page = virtaddr;

- DPRINT_INFO(VMBUS, "Hypercall page VA=%p, PA=0x%0llx",
- hv_context.hypercall_page,
- (u64)hypercall_msr.guest_physical_address << PAGE_SHIFT);
-
/* Setup the global signal event param for the signal event hypercall */
hv_context.signal_event_buffer =
kmalloc(sizeof(struct hv_input_signal_event_buffer),
@@ -394,8 +365,6 @@ void hv_synic_init(void *irqarg)
/* Check the version */
rdmsrl(HV_X64_MSR_SVERSION, version);

- DPRINT_INFO(VMBUS, "SynIC version: %llx", version);
-
hv_context.synic_message_page[cpu] =
(void *)get_zeroed_page(GFP_ATOMIC);

@@ -420,8 +389,6 @@ void hv_synic_init(void *irqarg)
simp.base_simp_gpa = virt_to_phys(hv_context.synic_message_page[cpu])
>> PAGE_SHIFT;

- DPRINT_DBG(VMBUS, "HV_X64_MSR_SIMP msr set to: %llx", simp.as_uint64);
-
wrmsrl(HV_X64_MSR_SIMP, simp.as_uint64);

/* Setup the Synic's event page */
@@ -430,8 +397,6 @@ void hv_synic_init(void *irqarg)
siefp.base_siefp_gpa = virt_to_phys(hv_context.synic_event_page[cpu])
>> PAGE_SHIFT;

- DPRINT_DBG(VMBUS, "HV_X64_MSR_SIEFP msr set to: %llx", siefp.as_uint64);
-
wrmsrl(HV_X64_MSR_SIEFP, siefp.as_uint64);

/* Setup the interception SINT. */
@@ -446,9 +411,6 @@ void hv_synic_init(void *irqarg)
shared_sint.masked = false;
shared_sint.auto_eoi = true;

- DPRINT_DBG(VMBUS, "HV_X64_MSR_SINT1 msr set to: %llx",
- shared_sint.as_uint64);
-
wrmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, shared_sint.as_uint64);

/* Enable the global synic bit */
diff --git a/drivers/staging/hv/ring_buffer.c b/drivers/staging/hv/ring_buffer.c
index 66688fb..9bd5218 100644
--- a/drivers/staging/hv/ring_buffer.c
+++ b/drivers/staging/hv/ring_buffer.c
@@ -372,20 +372,12 @@ int ringbuffer_write(struct hv_ring_buffer_info *outring_info,
&bytes_avail_toread,
&bytes_avail_towrite);

- DPRINT_DBG(VMBUS, "Writing %u bytes...", totalbytes_towrite);
-
/* Dumpring_info(Outring_info, "BEFORE "); */

/* If there is only room for the packet, assume it is full. */
/* Otherwise, the next time around, we think the ring buffer */
/* is empty since the read index == write index */
if (bytes_avail_towrite <= totalbytes_towrite) {
- DPRINT_DBG(VMBUS,
- "No more space left on outbound ring buffer "
- "(needed %u, avail %u)",
- totalbytes_towrite,
- bytes_avail_towrite);
-
spin_unlock_irqrestore(&outring_info->ring_lock, flags);
return -1;
}
@@ -499,18 +491,10 @@ int ringbuffer_read(struct hv_ring_buffer_info *inring_info, void *buffer,
&bytes_avail_toread,
&bytes_avail_towrite);

- DPRINT_DBG(VMBUS, "Reading %u bytes...", buflen);
-
/* Dumpring_info(Inring_info, "BEFORE "); */

/* Make sure there is something to read */
if (bytes_avail_toread < buflen) {
- DPRINT_DBG(VMBUS,
- "got callback but not enough to read "
- "<avail to read %d read size %d>!!",
- bytes_avail_toread,
- buflen);
-
spin_unlock_irqrestore(&inring_info->ring_lock, flags);

return -1;
@@ -568,8 +552,6 @@ copyto_ringbuffer(

/* wrap-around detected! */
if (srclen > ring_buffer_size - start_write_offset) {
- DPRINT_DBG(VMBUS, "wrap-around detected!");
-
frag_len = ring_buffer_size - start_write_offset;
memcpy(ring_buffer + start_write_offset, src, frag_len);
memcpy(ring_buffer, src + frag_len, srclen - frag_len);
@@ -607,8 +589,6 @@ copyfrom_ringbuffer(

/* wrap-around detected at the src */
if (destlen > ring_buffer_size - start_read_offset) {
- DPRINT_DBG(VMBUS, "src wrap-around detected!");
-
frag_len = ring_buffer_size - start_read_offset;

memcpy(dest, ring_buffer + start_read_offset, frag_len);
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index 3263fc8..b320f71 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -245,21 +245,6 @@ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
struct hv_device *dev = device_to_hv_device(device);
int ret;

- DPRINT_INFO(VMBUS_DRV, "generating uevent - VMBUS_DEVICE_CLASS_GUID={"
- "%02x%02x%02x%02x-%02x%02x-%02x%02x-"
- "%02x%02x%02x%02x%02x%02x%02x%02x}",
- dev->dev_type.data[3], dev->dev_type.data[2],
- dev->dev_type.data[1], dev->dev_type.data[0],
- dev->dev_type.data[5], dev->dev_type.data[4],
- dev->dev_type.data[7], dev->dev_type.data[6],
- dev->dev_type.data[8], dev->dev_type.data[9],
- dev->dev_type.data[10],
- dev->dev_type.data[11],
- dev->dev_type.data[12],
- dev->dev_type.data[13],
- dev->dev_type.data[14],
- dev->dev_type.data[15]);
-
ret = add_uevent_var(env, "VMBUS_DEVICE_CLASS_GUID={"
"%02x%02x%02x%02x-%02x%02x-%02x%02x-"
"%02x%02x%02x%02x%02x%02x%02x%02x}",
@@ -323,10 +308,6 @@ static int vmbus_match(struct device *device, struct device_driver *driver)
sizeof(struct hv_guid)) == 0) {

device_ctx->drv = drv->priv;
- DPRINT_INFO(VMBUS_DRV,
- "device object (%p) set to driver object (%p)",
- &device_ctx,
- device_ctx->drv);

match = 1;
}
@@ -539,22 +520,16 @@ static int vmbus_on_isr(void)
msg = (struct hv_message *)page_addr + VMBUS_MESSAGE_SINT;

/* Check if there are actual msgs to be process */
- if (msg->header.message_type != HVMSG_NONE) {
- DPRINT_DBG(VMBUS, "received msg type %d size %d",
- msg->header.message_type,
- msg->header.payload_size);
+ if (msg->header.message_type != HVMSG_NONE)
ret |= 0x1;
- }

/* TODO: Check if there are events to be process */
page_addr = hv_context.synic_event_page[cpu];
event = (union hv_synic_event_flags *)page_addr + VMBUS_MESSAGE_SINT;

/* Since we are a child, we only need to check bit 0 */
- if (test_and_clear_bit(0, (unsigned long *) &event->flags32[0])) {
- DPRINT_DBG(VMBUS, "received event %d", event->flags32[0]);
+ if (test_and_clear_bit(0, (unsigned long *) &event->flags32[0]))
ret |= 0x2;
- }

return ret;
}
@@ -594,18 +569,6 @@ static int vmbus_bus_init(struct pci_dev *pdev)
int ret;
unsigned int vector;

- DPRINT_INFO(VMBUS, "+++++++ HV Driver version = %s +++++++",
- HV_DRV_VERSION);
- DPRINT_INFO(VMBUS, "+++++++ Vmbus supported version = %d +++++++",
- VMBUS_REVISION_NUMBER);
- DPRINT_INFO(VMBUS, "+++++++ Vmbus using SINT %d +++++++",
- VMBUS_MESSAGE_SINT);
- DPRINT_DBG(VMBUS, "sizeof(vmbus_channel_packet_page_buffer)=%zd, "
- "sizeof(VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER)=%zd",
- sizeof(struct vmbus_channel_packet_page_buffer),
- sizeof(struct vmbus_channel_packet_multipage_buffer));
-
-
/* Hypervisor initialization...setup hypercall page..etc */
ret = hv_init();
if (ret != 0) {
@@ -646,8 +609,6 @@ static int vmbus_bus_init(struct pci_dev *pdev)
}

vector = IRQ0_VECTOR + pdev->irq;
- DPRINT_INFO(VMBUS_DRV, "irq 0x%x vector 0x%x", pdev->irq,
- vector);

/*
* Notify the hypervisor of our irq and
@@ -761,25 +722,6 @@ struct hv_device *vmbus_child_device_create(struct hv_guid *type,
return NULL;
}

- DPRINT_DBG(VMBUS_DRV, "child device (%p) allocated - "
- "type {%02x%02x%02x%02x-%02x%02x-%02x%02x-"
- "%02x%02x%02x%02x%02x%02x%02x%02x},"
- "id {%02x%02x%02x%02x-%02x%02x-%02x%02x-"
- "%02x%02x%02x%02x%02x%02x%02x%02x}",
- &child_device_obj->device,
- type->data[3], type->data[2], type->data[1], type->data[0],
- type->data[5], type->data[4], type->data[7], type->data[6],
- type->data[8], type->data[9], type->data[10], type->data[11],
- type->data[12], type->data[13], type->data[14], type->data[15],
- instance->data[3], instance->data[2],
- instance->data[1], instance->data[0],
- instance->data[5], instance->data[4],
- instance->data[7], instance->data[6],
- instance->data[8], instance->data[9],
- instance->data[10], instance->data[11],
- instance->data[12], instance->data[13],
- instance->data[14], instance->data[15]);
-
child_device_obj->channel = channel;
memcpy(&child_device_obj->dev_type, type, sizeof(struct hv_guid));
memcpy(&child_device_obj->dev_instance, instance,
@@ -798,9 +740,6 @@ int vmbus_child_device_register(struct hv_device *child_device_obj)

static atomic_t device_num = ATOMIC_INIT(0);

- DPRINT_DBG(VMBUS_DRV, "child device (%p) registering",
- child_device_obj);
-
/* Set the device name. Otherwise, device_register() will fail. */
dev_set_name(&child_device_obj->device, "vmbus_0_%d",
atomic_inc_return(&device_num));
@@ -835,10 +774,6 @@ int vmbus_child_device_register(struct hv_device *child_device_obj)
*/
void vmbus_child_device_unregister(struct hv_device *device_obj)
{
-
- DPRINT_INFO(VMBUS_DRV, "unregistering child device (%p)",
- &device_obj->device);
-
/*
* Kick off the process of unregistering the device.
* This will call vmbus_remove() and eventually vmbus_device_release()
--
1.6.0.2

2011-03-29 20:48:13

by Hank Janssen

[permalink] [raw]
Subject: [PATCH 03/07] Remove all unneeded DPRINT from hv_utils

Remove all un-needed DPRINT calls from hv_utils.

This patch deals with hv_utils only.

Signed-off-by: Hank Janssen <[email protected]>
Signed-off-by: Haiyang Zhang <[email protected]>
Signed-off-by: K. Y. Srinivasan <[email protected]>

---
drivers/staging/hv/hv_kvp.c | 3 ---
drivers/staging/hv/hv_util.c | 12 ------------
2 files changed, 0 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/hv/hv_kvp.c b/drivers/staging/hv/hv_kvp.c
index faf692e..7775820 100644
--- a/drivers/staging/hv/hv_kvp.c
+++ b/drivers/staging/hv/hv_kvp.c
@@ -259,9 +259,6 @@ void hv_kvp_onchannelcallback(void *context)
vmbus_recvpacket(channel, recv_buffer, PAGE_SIZE, &recvlen, &requestid);

if (recvlen > 0) {
- DPRINT_DBG(VMBUS, "KVP packet: len=%d, requestid=%lld",
- recvlen, requestid);
-
icmsghdrp = (struct icmsg_hdr *)&recv_buffer[
sizeof(struct vmbuspipe_hdr)];

diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
index 4792f2c..3e74f79 100644
--- a/drivers/staging/hv/hv_util.c
+++ b/drivers/staging/hv/hv_util.c
@@ -59,9 +59,6 @@ static void shutdown_onchannelcallback(void *context)
PAGE_SIZE, &recvlen, &requestid);

if (recvlen > 0) {
- DPRINT_DBG(VMBUS, "shutdown packet: len=%d, requestid=%lld",
- recvlen, requestid);
-
icmsghdrp = (struct icmsg_hdr *)&shut_txf_buf[
sizeof(struct vmbuspipe_hdr)];

@@ -159,9 +156,6 @@ static void timesync_onchannelcallback(void *context)
PAGE_SIZE, &recvlen, &requestid);

if (recvlen > 0) {
- DPRINT_DBG(VMBUS, "timesync packet: recvlen=%d, requestid=%lld",
- recvlen, requestid);
-
icmsghdrp = (struct icmsg_hdr *)&time_txf_buf[
sizeof(struct vmbuspipe_hdr)];

@@ -200,9 +194,6 @@ static void heartbeat_onchannelcallback(void *context)
PAGE_SIZE, &recvlen, &requestid);

if (recvlen > 0) {
- DPRINT_DBG(VMBUS, "heartbeat packet: len=%d, requestid=%lld",
- recvlen, requestid);
-
icmsghdrp = (struct icmsg_hdr *)&hbeat_txf_buf[
sizeof(struct vmbuspipe_hdr)];

@@ -214,9 +205,6 @@ static void heartbeat_onchannelcallback(void *context)
sizeof(struct vmbuspipe_hdr) +
sizeof(struct icmsg_hdr)];

- DPRINT_DBG(VMBUS, "heartbeat seq = %lld",
- heartbeat_msg->seq_num);
-
heartbeat_msg->seq_num += 1;
}

--
1.6.0.2

2011-03-29 20:49:14

by Hank Janssen

[permalink] [raw]
Subject: [PATCH 06/07] Replaced DPRINT and printk with native functions in hv_utils

Replaced all DPRINT and printk calls with pr_ calls

Signed-off-by: Hank Janssen <[email protected]>
Signed-off-by: Haiyang Zhang <[email protected]>
Signed-off-by: K. Y. Srinivasan <[email protected]>

---
drivers/staging/hv/hv_kvp.c | 6 +++---
drivers/staging/hv/hv_util.c | 17 +++++++++--------
2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/hv/hv_kvp.c b/drivers/staging/hv/hv_kvp.c
index 7775820..c71a148 100644
--- a/drivers/staging/hv/hv_kvp.c
+++ b/drivers/staging/hv/hv_kvp.c
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
-
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/net.h>
#include <linux/nls.h>
@@ -114,7 +114,7 @@ kvp_cn_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp)

message = (struct hv_ku_msg *)msg->data;
if (msg->seq == KVP_REGISTER) {
- printk(KERN_INFO "KVP: user-mode registering done.\n");
+ pr_info("KVP: user-mode registering done.\n");
kvp_register();
}

@@ -174,7 +174,7 @@ kvp_respond_to_host(char *key, char *value, int error)
/*
* This is a spurious call!
*/
- printk(KERN_WARNING "KVP: Transaction not active\n");
+ pr_warn("KVP: Transaction not active\n");
return;
}
/*
diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
index 3e74f79..3af0a11 100644
--- a/drivers/staging/hv/hv_util.c
+++ b/drivers/staging/hv/hv_util.c
@@ -18,6 +18,8 @@
* Haiyang Zhang <[email protected]>
* Hank Janssen <[email protected]>
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
@@ -76,15 +78,15 @@ static void shutdown_onchannelcallback(void *context)
icmsghdrp->status = HV_S_OK;
execute_shutdown = true;

- DPRINT_INFO(VMBUS, "Shutdown request received -"
- " gracefull shutdown initiated");
+ pr_info("Shutdown request received -"
+ " gracefull shutdown initiated\n");
break;
default:
icmsghdrp->status = HV_E_FAIL;
execute_shutdown = false;

- DPRINT_INFO(VMBUS, "Shutdown request received -"
- " Invalid request");
+ pr_info("Shutdown request received -"
+ " Invalid request\n");
break;
};
}
@@ -242,7 +244,7 @@ MODULE_DEVICE_TABLE(dmi, hv_utils_dmi_table);

static int __init init_hyperv_utils(void)
{
- printk(KERN_INFO "Registering HyperV Utility Driver\n");
+ pr_info("Registering HyperV Utility Driver\n");

if (hv_kvp_init())
return -ENODEV;
@@ -256,8 +258,7 @@ static int __init init_hyperv_utils(void)
hbeat_txf_buf = kmalloc(PAGE_SIZE, GFP_KERNEL);

if (!shut_txf_buf || !time_txf_buf || !hbeat_txf_buf) {
- printk(KERN_INFO
- "Unable to allocate memory for receive buffer\n");
+ pr_info("Unable to allocate memory for receive buffer\n");
kfree(shut_txf_buf);
kfree(time_txf_buf);
kfree(hbeat_txf_buf);
@@ -286,7 +287,7 @@ static int __init init_hyperv_utils(void)

static void exit_hyperv_utils(void)
{
- printk(KERN_INFO "De-Registered HyperV Utility Driver\n");
+ pr_info("De-Registered HyperV Utility Driver\n");

hv_cb_utils[HV_SHUTDOWN_MSG].channel->onchannel_callback =
&chn_cb_negotiate;
--
1.6.0.2

2011-03-29 20:49:16

by Hank Janssen

[permalink] [raw]
Subject: [PATCH 05/07] replace DPRINT with native primitives in hv_netvsc

Replace all remaining DPRINT calls with their native dev_ and
netvsc_ calls. And also change some of the verbiage to be more useful.

rndis_filter has a few remaining DPRINT calls in it that will be removed
in a future patch because the debug will be implemented differently.

Signed-off-by: Hank Janssen <[email protected]>
Signed-off-by: Haiyang Zhang <[email protected]>
Signed-off-by: K. Y. Srinivasan <[email protected]>

---
drivers/staging/hv/netvsc.c | 115 +++++++++++++++++++------------------
drivers/staging/hv/netvsc_drv.c | 36 ++++++------
drivers/staging/hv/rndis_filter.c | 51 +++++++++--------
3 files changed, 103 insertions(+), 99 deletions(-)

diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index be572b4..ddf7546 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -18,6 +18,8 @@
* Haiyang Zhang <[email protected]>
* Hank Janssen <[email protected]>
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/wait.h>
@@ -200,7 +202,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)

net_device = get_outbound_net_device(device);
if (!net_device) {
- DPRINT_ERR(NETVSC, "unable to get net device..."
+ dev_err(&device->device, "unable to get net device..."
"device being destroyed?");
return -1;
}
@@ -209,9 +211,8 @@ static int netvsc_init_recv_buf(struct hv_device *device)
(void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
get_order(net_device->recv_buf_size));
if (!net_device->recv_buf) {
- DPRINT_ERR(NETVSC,
- "unable to allocate receive buffer of size %d",
- net_device->recv_buf_size);
+ dev_err(&device->device, "unable to allocate receive "
+ "buffer of size %d", net_device->recv_buf_size);
ret = -1;
goto cleanup;
}
@@ -225,8 +226,8 @@ static int netvsc_init_recv_buf(struct hv_device *device)
net_device->recv_buf_size,
&net_device->recv_buf_gpadl_handle);
if (ret != 0) {
- DPRINT_ERR(NETVSC,
- "unable to establish receive buffer's gpadl");
+ dev_err(&device->device,
+ "unable to establish receive buffer's gpadl");
goto cleanup;
}

@@ -250,8 +251,8 @@ static int netvsc_init_recv_buf(struct hv_device *device)
VM_PKT_DATA_INBAND,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
if (ret != 0) {
- DPRINT_ERR(NETVSC,
- "unable to send receive buffer's gpadl to netvsp");
+ dev_err(&device->device,
+ "unable to send receive buffer's gpadl to netvsp");
goto cleanup;
}

@@ -264,7 +265,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
/* Check the response */
if (init_packet->msg.v1_msg.
send_recv_buf_complete.status != NVSP_STAT_SUCCESS) {
- DPRINT_ERR(NETVSC, "Unable to complete receive buffer "
+ dev_err(&device->device, "Unable to complete receive buffer "
"initialzation with NetVsp - status %d",
init_packet->msg.v1_msg.
send_recv_buf_complete.status);
@@ -318,7 +319,7 @@ static int netvsc_init_send_buf(struct hv_device *device)

net_device = get_outbound_net_device(device);
if (!net_device) {
- DPRINT_ERR(NETVSC, "unable to get net device..."
+ dev_err(&device->device, "unable to get net device..."
"device being destroyed?");
return -1;
}
@@ -331,8 +332,8 @@ static int netvsc_init_send_buf(struct hv_device *device)
(void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
get_order(net_device->send_buf_size));
if (!net_device->send_buf) {
- DPRINT_ERR(NETVSC, "unable to allocate send buffer of size %d",
- net_device->send_buf_size);
+ dev_err(&device->device, "unable to allocate send "
+ "buffer of size %d", net_device->send_buf_size);
ret = -1;
goto cleanup;
}
@@ -346,7 +347,7 @@ static int netvsc_init_send_buf(struct hv_device *device)
net_device->send_buf_size,
&net_device->send_buf_gpadl_handle);
if (ret != 0) {
- DPRINT_ERR(NETVSC, "unable to establish send buffer's gpadl");
+ dev_err(&device->device, "unable to establish send buffer's gpadl");
goto cleanup;
}

@@ -369,7 +370,7 @@ static int netvsc_init_send_buf(struct hv_device *device)
VM_PKT_DATA_INBAND,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
if (ret != 0) {
- DPRINT_ERR(NETVSC,
+ dev_err(&device->device,
"unable to send receive buffer's gpadl to netvsp");
goto cleanup;
}
@@ -382,7 +383,7 @@ static int netvsc_init_send_buf(struct hv_device *device)
/* Check the response */
if (init_packet->msg.v1_msg.
send_send_buf_complete.status != NVSP_STAT_SUCCESS) {
- DPRINT_ERR(NETVSC, "Unable to complete send buffer "
+ dev_err(&device->device, "Unable to complete send buffer "
"initialzation with NetVsp - status %d",
init_packet->msg.v1_msg.
send_send_buf_complete.status);
@@ -434,8 +435,8 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
* have a leak rather than continue and a bugchk
*/
if (ret != 0) {
- DPRINT_ERR(NETVSC, "unable to send revoke receive "
- "buffer to netvsp");
+ dev_err(&net_device->dev->device, "unable to send "
+ "revoke receive buffer to netvsp");
return -1;
}
}
@@ -447,7 +448,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)

/* If we failed here, we might as well return and have a leak rather than continue and a bugchk */
if (ret != 0) {
- DPRINT_ERR(NETVSC,
+ dev_err(&net_device->dev->device,
"unable to teardown receive buffer's gpadl");
return -1;
}
@@ -501,8 +502,8 @@ static int netvsc_destroy_send_buf(struct netvsc_device *net_device)
* rather than continue and a bugchk
*/
if (ret != 0) {
- DPRINT_ERR(NETVSC, "unable to send revoke send buffer "
- "to netvsp");
+ dev_err(&net_device->dev->device, "unable to send "
+ "revoke send buffer to netvsp");
return -1;
}
}
@@ -517,8 +518,8 @@ static int netvsc_destroy_send_buf(struct netvsc_device *net_device)
* rather than continue and a bugchk
*/
if (ret != 0) {
- DPRINT_ERR(NETVSC, "unable to teardown send buffer's "
- "gpadl");
+ dev_err(&net_device->dev->device,
+ "unable to teardown send buffer's gpadl");
return -1;
}
net_device->send_buf_gpadl_handle = 0;
@@ -544,7 +545,7 @@ static int netvsc_connect_vsp(struct hv_device *device)

net_device = get_outbound_net_device(device);
if (!net_device) {
- DPRINT_ERR(NETVSC, "unable to get net device..."
+ dev_err(&device->device, "unable to get net device..."
"device being destroyed?");
return -1;
}
@@ -672,18 +673,19 @@ static int netvsc_device_add(struct hv_device *device, void *additional_info)
netvsc_channel_cb, device);

if (ret != 0) {
- DPRINT_ERR(NETVSC, "unable to open channel: %d", ret);
+ dev_err(&device->device, "unable to open channel: %d", ret);
ret = -1;
goto cleanup;
}

/* Channel is opened */
- DPRINT_INFO(NETVSC, "*** NetVSC channel opened successfully! ***");
+ pr_info("hv_netvsc channel opened successfully");

/* Connect with the NetVsp */
ret = netvsc_connect_vsp(device);
if (ret != 0) {
- DPRINT_ERR(NETVSC, "unable to connect to NetVSP - %d", ret);
+ dev_err(&device->device,
+ "unable to connect to NetVSP - %d", ret);
ret = -1;
goto close;
}
@@ -724,14 +726,15 @@ static int netvsc_device_remove(struct hv_device *device)
/* Stop outbound traffic ie sends and receives completions */
net_device = release_outbound_net_device(device);
if (!net_device) {
- DPRINT_ERR(NETVSC, "No net device present!!");
+ dev_err(&device->device, "No net device present!!");
return -1;
}

/* Wait for all send completions */
while (atomic_read(&net_device->num_outstanding_sends)) {
- DPRINT_INFO(NETVSC, "waiting for %d requests to complete...",
- atomic_read(&net_device->num_outstanding_sends));
+ dev_err(&device->device,
+ "waiting for %d requests to complete...",
+ atomic_read(&net_device->num_outstanding_sends));
udelay(100);
}

@@ -741,7 +744,7 @@ static int netvsc_device_remove(struct hv_device *device)
net_device = release_inbound_net_device(device);

/* At this point, no one should be accessing netDevice except in here */
- DPRINT_INFO(NETVSC, "net device (%p) safe to remove", net_device);
+ dev_notice(&device->device, "net device safe to remove");

/* Now, we can close the channel safely */
vmbus_close(device->channel);
@@ -773,7 +776,7 @@ static void netvsc_send_completion(struct hv_device *device,

net_device = get_inbound_net_device(device);
if (!net_device) {
- DPRINT_ERR(NETVSC, "unable to get net device..."
+ dev_err(&device->device, "unable to get net device..."
"device being destroyed?");
return;
}
@@ -803,7 +806,7 @@ static void netvsc_send_completion(struct hv_device *device,

atomic_dec(&net_device->num_outstanding_sends);
} else {
- DPRINT_ERR(NETVSC, "Unknown send completion packet type - "
+ dev_err(&device->device, "Unknown send completion packet type- "
"%d received!!", nvsp_packet->hdr.msg_type);
}

@@ -820,7 +823,7 @@ static int netvsc_send(struct hv_device *device,

net_device = get_outbound_net_device(device);
if (!net_device) {
- DPRINT_ERR(NETVSC, "net device (%p) shutting down..."
+ dev_err(&device->device, "net device (%p) shutting down..."
"ignoring outbound packets", net_device);
return -2;
}
@@ -856,7 +859,7 @@ static int netvsc_send(struct hv_device *device,
}

if (ret != 0)
- DPRINT_ERR(NETVSC, "Unable to send packet %p ret %d",
+ dev_err(&device->device, "Unable to send packet %p ret %d",
packet, ret);

atomic_inc(&net_device->num_outstanding_sends);
@@ -882,7 +885,7 @@ static void netvsc_receive(struct hv_device *device,

net_device = get_inbound_net_device(device);
if (!net_device) {
- DPRINT_ERR(NETVSC, "unable to get net device..."
+ dev_err(&device->device, "unable to get net device..."
"device being destroyed?");
return;
}
@@ -892,7 +895,7 @@ static void netvsc_receive(struct hv_device *device,
* packet
*/
if (packet->type != VM_PKT_DATA_USING_XFER_PAGES) {
- DPRINT_ERR(NETVSC, "Unknown packet type received - %d",
+ dev_err(&device->device, "Unknown packet type received - %d",
packet->type);
put_net_device(device);
return;
@@ -904,8 +907,8 @@ static void netvsc_receive(struct hv_device *device,
/* Make sure this is a valid nvsp packet */
if (nvsp_packet->hdr.msg_type !=
NVSP_MSG1_TYPE_SEND_RNDIS_PKT) {
- DPRINT_ERR(NETVSC, "Unknown nvsp packet type received - %d",
- nvsp_packet->hdr.msg_type);
+ dev_err(&device->device, "Unknown nvsp packet type received-"
+ " %d", nvsp_packet->hdr.msg_type);
put_net_device(device);
return;
}
@@ -913,7 +916,7 @@ static void netvsc_receive(struct hv_device *device,
vmxferpage_packet = (struct vmtransfer_page_packet_header *)packet;

if (vmxferpage_packet->xfer_pageset_id != NETVSC_RECEIVE_BUFFER_ID) {
- DPRINT_ERR(NETVSC, "Invalid xfer page set id - "
+ dev_err(&device->device, "Invalid xfer page set id - "
"expecting %x got %x", NETVSC_RECEIVE_BUFFER_ID,
vmxferpage_packet->xfer_pageset_id);
put_net_device(device);
@@ -940,9 +943,9 @@ static void netvsc_receive(struct hv_device *device,
* some of the xfer page packet ranges...
*/
if (count < 2) {
- DPRINT_ERR(NETVSC, "Got only %d netvsc pkt...needed %d pkts. "
- "Dropping this xfer page packet completely!",
- count, vmxferpage_packet->range_cnt + 1);
+ dev_err(&device->device, "Got only %d netvsc pkt...needed "
+ "%d pkts. Dropping this xfer page packet completely!",
+ count, vmxferpage_packet->range_cnt + 1);

/* Return it to the freelist */
spin_lock_irqsave(&net_device->recv_pkt_list_lock, flags);
@@ -968,9 +971,9 @@ static void netvsc_receive(struct hv_device *device,
xferpage_packet->count = count - 1;

if (xferpage_packet->count != vmxferpage_packet->range_cnt) {
- DPRINT_INFO(NETVSC, "Needed %d netvsc pkts to satisy this xfer "
- "page...got %d", vmxferpage_packet->range_cnt,
- xferpage_packet->count);
+ dev_err(&device->device, "Needed %d netvsc pkts to satisy "
+ "this xfer page...got %d",
+ vmxferpage_packet->range_cnt, xferpage_packet->count);
}

/* Each range represents 1 RNDIS pkt that contains 1 ethernet frame */
@@ -1073,20 +1076,20 @@ retry_send_cmplt:
} else if (ret == -1) {
/* no more room...wait a bit and attempt to retry 3 times */
retries++;
- DPRINT_ERR(NETVSC, "unable to send receive completion pkt "
- "(tid %llx)...retrying %d", transaction_id, retries);
+ dev_err(&device->device, "unable to send receive completion pkt"
+ " (tid %llx)...retrying %d", transaction_id, retries);

if (retries < 4) {
udelay(100);
goto retry_send_cmplt;
} else {
- DPRINT_ERR(NETVSC, "unable to send receive completion "
- "pkt (tid %llx)...give up retrying",
- transaction_id);
+ dev_err(&device->device, "unable to send receive "
+ "completion pkt (tid %llx)...give up retrying",
+ transaction_id);
}
} else {
- DPRINT_ERR(NETVSC, "unable to send receive completion pkt - "
- "%llx", transaction_id);
+ dev_err(&device->device, "unable to send receive "
+ "completion pkt - %llx", transaction_id);
}
}

@@ -1107,7 +1110,7 @@ static void netvsc_receive_completion(void *context)
*/
net_device = get_inbound_net_device(device);
if (!net_device) {
- DPRINT_ERR(NETVSC, "unable to get net device..."
+ dev_err(&device->device, "unable to get net device..."
"device being destroyed?");
return;
}
@@ -1160,7 +1163,7 @@ static void netvsc_channel_cb(void *context)

net_device = get_inbound_net_device(device);
if (!net_device) {
- DPRINT_ERR(NETVSC, "net device (%p) shutting down..."
+ dev_err(&device->device, "net device (%p) shutting down..."
"ignoring inbound packets", net_device);
goto out;
}
@@ -1181,7 +1184,7 @@ static void netvsc_channel_cb(void *context)
break;

default:
- DPRINT_ERR(NETVSC,
+ dev_err(&device->device,
"unhandled packet type %d, "
"tid %llx len %d\n",
desc->type, request_id,
@@ -1210,7 +1213,7 @@ static void netvsc_channel_cb(void *context)
buffer = kmalloc(bytes_recvd, GFP_ATOMIC);
if (buffer == NULL) {
/* Try again next time around */
- DPRINT_ERR(NETVSC,
+ dev_err(&device->device,
"unable to allocate buffer of size "
"(%d)!!", bytes_recvd);
break;
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 1772a19..54a203b 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -18,6 +18,8 @@
* Haiyang Zhang <[email protected]>
* Hank Janssen <[email protected]>
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/init.h>
#include <linux/module.h>
#include <linux/highmem.h>
@@ -77,14 +79,14 @@ static int netvsc_open(struct net_device *net)
/* Open up the device */
ret = rndis_filter_open(device_obj);
if (ret != 0) {
- DPRINT_ERR(NETVSC_DRV,
- "unable to open device (ret %d).", ret);
+ netdev_err(net, "unable to open device (ret %d).\n",
+ ret);
return ret;
}

netif_start_queue(net);
} else {
- DPRINT_ERR(NETVSC_DRV, "unable to open device...link is down.");
+ netdev_err(net, "unable to open device...link is down.\n");
}

return ret;
@@ -100,7 +102,7 @@ static int netvsc_close(struct net_device *net)

ret = rndis_filter_close(device_obj);
if (ret != 0)
- DPRINT_ERR(NETVSC_DRV, "unable to close device (ret %d).", ret);
+ netdev_err(net, "unable to close device (ret %d).\n", ret);

return ret;
}
@@ -147,7 +149,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
net_drv_obj->req_ext_size, GFP_ATOMIC);
if (!packet) {
/* out of memory, silently drop packet */
- DPRINT_ERR(NETVSC_DRV, "unable to allocate hv_netvsc_packet");
+ netdev_err(net, "unable to allocate hv_netvsc_packet\n");

dev_kfree_skb(skb);
net->stats.tx_dropped++;
@@ -214,8 +216,8 @@ static void netvsc_linkstatus_callback(struct hv_device *device_obj,
struct net_device *net = dev_get_drvdata(&device_obj->device);

if (!net) {
- DPRINT_ERR(NETVSC_DRV, "got link status but net device "
- "not initialized yet");
+ netdev_err(net, "got link status but net device "
+ "not initialized yet\n");
return;
}

@@ -243,8 +245,8 @@ static int netvsc_recv_callback(struct hv_device *device_obj,
unsigned long flags;

if (!net) {
- DPRINT_ERR(NETVSC_DRV, "got receive callback but net device "
- "not initialized yet");
+ netdev_err(net, "got receive callback but net device"
+ " not initialized yet\n");
return 0;
}

@@ -350,8 +352,7 @@ static int netvsc_probe(struct device *device)
free_netdev(net);
dev_set_drvdata(device, NULL);

- DPRINT_ERR(NETVSC_DRV, "unable to add netvsc device (ret %d)",
- ret);
+ netdev_err(net, "unable to add netvsc device (ret %d)\n", ret);
return ret;
}

@@ -397,7 +398,7 @@ static int netvsc_remove(struct device *device)
int ret;

if (net == NULL) {
- DPRINT_INFO(NETVSC, "no net device to remove");
+ dev_err(device, "No net device to remove\n");
return 0;
}

@@ -417,7 +418,7 @@ static int netvsc_remove(struct device *device)
ret = net_drv_obj->base.dev_rm(device_obj);
if (ret != 0) {
/* TODO: */
- DPRINT_ERR(NETVSC, "unable to remove vsc device (ret %d)", ret);
+ netdev_err(net, "unable to remove vsc device (ret %d)\n", ret);
}

free_netdev(net);
@@ -446,16 +447,13 @@ static void netvsc_drv_exit(void)
/* Get the device */
ret = driver_for_each_device(&drv->driver, NULL,
&current_dev, netvsc_drv_exit_cb);
- if (ret)
- DPRINT_WARN(NETVSC_DRV,
- "driver_for_each_device returned %d", ret);

if (current_dev == NULL)
break;

/* Initiate removal from the top-down */
- DPRINT_INFO(NETVSC_DRV, "unregistering device (%p)...",
- current_dev);
+ dev_err(current_dev, "unregistering device (%s)...\n",
+ dev_name(current_dev));

device_unregister(current_dev);
}
@@ -509,7 +507,7 @@ MODULE_DEVICE_TABLE(dmi, hv_netvsc_dmi_table);

static int __init netvsc_init(void)
{
- DPRINT_INFO(NETVSC_DRV, "Netvsc initializing....");
+ pr_info("initializing....");

if (!dmi_check_system(hv_netvsc_dmi_table))
return -ENODEV;
diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index d1b13dc..1678705 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -25,7 +25,7 @@
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/if_ether.h>
-
+#include <linux/netdevice.h>
#include "logging.h"
#include "hv_api.h"
#include "netvsc_api.h"
@@ -294,10 +294,11 @@ static void rndis_filter_receive_response(struct rndis_device *dev,
memcpy(&request->response_msg, resp,
resp->msg_len);
} else {
- DPRINT_ERR(NETVSC, "rndis response buffer overflow "
- "detected (size %u max %zu)",
- resp->msg_len,
- sizeof(struct rndis_filter_packet));
+ dev_err(&dev->net_dev->dev->device,
+ "rndis response buffer overflow "
+ "detected (size %u max %zu)\n",
+ resp->msg_len,
+ sizeof(struct rndis_filter_packet));

if (resp->ndis_msg_type ==
REMOTE_NDIS_RESET_CMPLT) {
@@ -314,10 +315,11 @@ static void rndis_filter_receive_response(struct rndis_device *dev,
request->wait_condition = 1;
wake_up(&request->wait_event);
} else {
- DPRINT_ERR(NETVSC, "no rndis request found for this response "
- "(id 0x%x res type 0x%x)",
- resp->msg.init_complete.req_id,
- resp->ndis_msg_type);
+ dev_err(&dev->net_dev->dev->device,
+ "no rndis request found for this response "
+ "(id 0x%x res type 0x%x)\n",
+ resp->msg.init_complete.req_id,
+ resp->ndis_msg_type);
}
}

@@ -380,15 +382,15 @@ static int rndis_filter_receive(struct hv_device *dev,

/* Make sure the rndis device state is initialized */
if (!net_dev->extension) {
- DPRINT_ERR(NETVSC, "got rndis message but no rndis device..."
- "dropping this message!");
+ dev_err(&dev->device, "got rndis message but no rndis device - "
+ "dropping this message!\n");
return -1;
}

rndis_dev = (struct rndis_device *)net_dev->extension;
if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) {
- DPRINT_ERR(NETVSC, "got rndis message but rndis device "
- "uninitialized...dropping this message!");
+ dev_err(&dev->device, "got rndis message but rndis device "
+ "uninitialized...dropping this message!\n");
return -1;
}

@@ -409,8 +411,8 @@ static int rndis_filter_receive(struct hv_device *dev,
kunmap_atomic(rndis_hdr - pkt->page_buf[0].offset,
KM_IRQ0);

- DPRINT_ERR(NETVSC, "invalid rndis message? (expected %u "
- "bytes got %u)...dropping this message!",
+ dev_err(&dev->device, "invalid rndis message? (expected %u "
+ "bytes got %u)...dropping this message!\n",
rndis_hdr->msg_len,
pkt->total_data_buflen);
return -1;
@@ -419,8 +421,8 @@ static int rndis_filter_receive(struct hv_device *dev,

if ((rndis_hdr->ndis_msg_type != REMOTE_NDIS_PACKET_MSG) &&
(rndis_hdr->msg_len > sizeof(struct rndis_message))) {
- DPRINT_ERR(NETVSC, "incoming rndis message buffer overflow "
- "detected (got %u, max %zu)...marking it an error!",
+ dev_err(&dev->device, "incoming rndis message buffer overflow "
+ "detected (got %u, max %zu)..marking it an error!\n",
rndis_hdr->msg_len,
sizeof(struct rndis_message));
}
@@ -452,7 +454,8 @@ static int rndis_filter_receive(struct hv_device *dev,
rndis_filter_receive_indicate_status(rndis_dev, &rndis_msg);
break;
default:
- DPRINT_ERR(NETVSC, "unhandled rndis message (type %u len %u)",
+ dev_err(&dev->device,
+ "unhandled rndis message (type %u len %u)\n",
rndis_msg.ndis_msg_type,
rndis_msg.msg_len);
break;
@@ -575,7 +578,8 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
msecs_to_jiffies(2000));
if (request->wait_condition == 0) {
ret = -1;
- DPRINT_ERR(NETVSC, "timeout before we got a set response...");
+ dev_err(&dev->net_dev->dev->device,
+ "timeout before we got a set response...\n");
/*
* We cant deallocate the request since we may still receive a
* send completion for it.
@@ -789,16 +793,15 @@ static int rndis_filte_device_add(struct hv_device *dev,
*/
}

- DPRINT_INFO(NETVSC, "Device 0x%p mac addr %pM",
- rndisDevice, rndisDevice->hw_mac_adr);
-
memcpy(deviceInfo->mac_adr, rndisDevice->hw_mac_adr, ETH_ALEN);

rndis_filter_query_device_link_status(rndisDevice);

deviceInfo->link_state = rndisDevice->link_stat;
- DPRINT_INFO(NETVSC, "Device 0x%p link state %s", rndisDevice,
- ((deviceInfo->link_state) ? ("down") : ("up")));
+
+ dev_info(&dev->device, "Device MAC %pM link state %s",
+ rndisDevice->hw_mac_adr,
+ ((deviceInfo->link_state) ? ("down\n") : ("up\n")));

return ret;
}
--
1.6.0.2

2011-03-29 21:24:58

by Hank Janssen

[permalink] [raw]
Subject: [PATCH 07/07] Replaced printk with pr_info in hv_timesource

Replaced printk in hv_timesource with pr_ calls

Signed-off-by: Hank Janssen <[email protected]>
Signed-off-by: Haiyang Zhang <[email protected]>
Signed-off-by: K. Y. Srinivasan <[email protected]>

---
drivers/staging/hv/hv_timesource.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/hv_timesource.c b/drivers/staging/hv/hv_timesource.c
index a7ee533..0efb049 100644
--- a/drivers/staging/hv/hv_timesource.c
+++ b/drivers/staging/hv/hv_timesource.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/version.h>
#include <linux/clocksource.h>
@@ -91,7 +92,7 @@ static int __init init_hv_clocksource(void)
if (!dmi_check_system(hv_timesource_dmi_table))
return -ENODEV;

- printk(KERN_INFO "Registering HyperV clock source\n");
+ pr_info("Registering HyperV clock source\n");
return clocksource_register(&hyperv_cs);
}

--
1.6.0.2

2011-04-05 07:36:11

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 07/07] Replaced printk with pr_info in hv_timesource

On Tue, Mar 29, 2011 at 01:58:50PM -0700, Hank Janssen wrote:
> Replaced printk in hv_timesource with pr_ calls
>
> Signed-off-by: Hank Janssen <[email protected]>
> Signed-off-by: Haiyang Zhang <[email protected]>
> Signed-off-by: K. Y. Srinivasan <[email protected]>
>
> ---
> drivers/staging/hv/hv_timesource.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/staging/hv/hv_timesource.c b/drivers/staging/hv/hv_timesource.c
> index a7ee533..0efb049 100644
> --- a/drivers/staging/hv/hv_timesource.c
> +++ b/drivers/staging/hv/hv_timesource.c
> @@ -20,6 +20,7 @@
> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
> *
> */
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> #include <linux/version.h>
> #include <linux/clocksource.h>
> @@ -91,7 +92,7 @@ static int __init init_hv_clocksource(void)
> if (!dmi_check_system(hv_timesource_dmi_table))
> return -ENODEV;
>
> - printk(KERN_INFO "Registering HyperV clock source\n");
> + pr_info("Registering HyperV clock source\n");

Why is this line even needed at all? Please remove it in future
patches.

thanks,

greg k-h

2011-04-06 00:14:12

by Hank Janssen

[permalink] [raw]
Subject: RE: [PATCH 07/07] Replaced printk with pr_info in hv_timesource



> -----Original Message-----
> From: Greg KH [mailto:[email protected]]
> Sent: Monday, April 04, 2011 10:01 PM
> To: Hank Janssen
> Cc: Haiyang Zhang; [email protected]; [email protected];
> [email protected]; [email protected]; KY Srinivasan
> Subject: Re: [PATCH 07/07] Replaced printk with pr_info in hv_timesource
>
> > #include <linux/version.h>
> > #include <linux/clocksource.h>
> > @@ -91,7 +92,7 @@ static int __init init_hv_clocksource(void)
> > if (!dmi_check_system(hv_timesource_dmi_table))
> > return -ENODEV;
> >
> > - printk(KERN_INFO "Registering HyperV clock source\n");
> > + pr_info("Registering HyperV clock source\n");
>
> Why is this line even needed at all? Please remove it in future patches.
>

Of course, since there have been so many changes I will wait a day or two
To get stuff settled in staging and I will send the patch to remove it.

Hank.