提交 0a46618d 编写于 作者: H Hank Janssen 提交者: Greg Kroah-Hartman

staging: hv: 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: NHank Janssen <hjanssen@microsoft.com>
Signed-off-by: NHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: NK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 8de61e31
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
* Haiyang Zhang <haiyangz@microsoft.com> * Haiyang Zhang <haiyangz@microsoft.com>
* Hank Janssen <hjanssen@microsoft.com> * Hank Janssen <hjanssen@microsoft.com>
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/wait.h> #include <linux/wait.h>
...@@ -898,7 +900,7 @@ int vmbus_recvpacket(struct vmbus_channel *channel, void *buffer, ...@@ -898,7 +900,7 @@ int vmbus_recvpacket(struct vmbus_channel *channel, void *buffer,
if (userlen > bufferlen) { if (userlen > bufferlen) {
spin_unlock_irqrestore(&channel->inbound_lock, flags); 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); bufferlen, userlen);
return -1; return -1;
} }
...@@ -950,8 +952,9 @@ int vmbus_recvpacket_raw(struct vmbus_channel *channel, void *buffer, ...@@ -950,8 +952,9 @@ int vmbus_recvpacket_raw(struct vmbus_channel *channel, void *buffer,
if (packetlen > bufferlen) { if (packetlen > bufferlen) {
spin_unlock_irqrestore(&channel->inbound_lock, flags); spin_unlock_irqrestore(&channel->inbound_lock, flags);
DPRINT_ERR(VMBUS, "buffer too small - needed %d bytes but " pr_err("Buffer too small - needed %d bytes but "
"got space for only %d bytes", packetlen, bufferlen); "got space for only %d bytes\n",
packetlen, bufferlen);
return -2; return -2;
} }
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
* Haiyang Zhang <haiyangz@microsoft.com> * Haiyang Zhang <haiyangz@microsoft.com>
* Hank Janssen <hjanssen@microsoft.com> * Hank Janssen <hjanssen@microsoft.com>
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/wait.h> #include <linux/wait.h>
...@@ -403,8 +405,7 @@ static void vmbus_process_offer(struct work_struct *work) ...@@ -403,8 +405,7 @@ static void vmbus_process_offer(struct work_struct *work)
*/ */
ret = vmbus_child_device_register(newchannel->device_obj); ret = vmbus_child_device_register(newchannel->device_obj);
if (ret != 0) { if (ret != 0) {
DPRINT_ERR(VMBUS, pr_err("unable to add child device object (relid %d)\n",
"unable to add child device object (relid %d)",
newchannel->offermsg.child_relid); newchannel->offermsg.child_relid);
spin_lock_irqsave(&vmbus_connection.channel_lock, flags); spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
...@@ -430,8 +431,9 @@ static void vmbus_process_offer(struct work_struct *work) ...@@ -430,8 +431,9 @@ static void vmbus_process_offer(struct work_struct *work)
hv_cb_utils[cnt].callback, hv_cb_utils[cnt].callback,
newchannel) == 0) { newchannel) == 0) {
hv_cb_utils[cnt].channel = newchannel; 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(); count_hv_channel();
} }
} }
...@@ -472,7 +474,7 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr) ...@@ -472,7 +474,7 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr)
/* Allocate the channel object and save this offer. */ /* Allocate the channel object and save this offer. */
newchannel = alloc_channel(); newchannel = alloc_channel();
if (!newchannel) { if (!newchannel) {
DPRINT_ERR(VMBUS, "unable to allocate channel object"); pr_err("Unable to allocate channel object\n");
return; return;
} }
...@@ -730,8 +732,7 @@ void vmbus_onmessage(void *context) ...@@ -730,8 +732,7 @@ void vmbus_onmessage(void *context)
size = msg->header.payload_size; size = msg->header.payload_size;
if (hdr->msgtype >= CHANNELMSG_COUNT) { if (hdr->msgtype >= CHANNELMSG_COUNT) {
DPRINT_ERR(VMBUS, pr_err("Received invalid channel message type %d size %d\n",
"Received invalid channel message type %d size %d",
hdr->msgtype, size); hdr->msgtype, size);
print_hex_dump_bytes("", DUMP_PREFIX_NONE, print_hex_dump_bytes("", DUMP_PREFIX_NONE,
(unsigned char *)msg->u.payload, size); (unsigned char *)msg->u.payload, size);
...@@ -741,8 +742,7 @@ void vmbus_onmessage(void *context) ...@@ -741,8 +742,7 @@ void vmbus_onmessage(void *context)
if (gChannelMessageTable[hdr->msgtype].messageHandler) if (gChannelMessageTable[hdr->msgtype].messageHandler)
gChannelMessageTable[hdr->msgtype].messageHandler(hdr); gChannelMessageTable[hdr->msgtype].messageHandler(hdr);
else else
DPRINT_ERR(VMBUS, "Unhandled channel message type %d", pr_err("Unhandled channel message type %d\n", hdr->msgtype);
hdr->msgtype);
} }
/* /*
...@@ -770,7 +770,7 @@ int vmbus_request_offers(void) ...@@ -770,7 +770,7 @@ int vmbus_request_offers(void)
ret = vmbus_post_msg(msg, ret = vmbus_post_msg(msg,
sizeof(struct vmbus_channel_message_header)); sizeof(struct vmbus_channel_message_header));
if (ret != 0) { if (ret != 0) {
DPRINT_ERR(VMBUS, "Unable to request offers - %d", ret); pr_err("Unable to request offers - %d\n", ret);
goto cleanup; goto cleanup;
} }
...@@ -810,9 +810,8 @@ void vmbus_release_unattached_channels(void) ...@@ -810,9 +810,8 @@ void vmbus_release_unattached_channels(void)
if (!channel->device_obj->drv) { if (!channel->device_obj->drv) {
list_del(&channel->listentry); list_del(&channel->listentry);
DPRINT_INFO(VMBUS,
"Releasing unattached device object %p", pr_err("Releasing unattached device object\n");
channel->device_obj);
vmbus_child_device_unregister(channel->device_obj); vmbus_child_device_unregister(channel->device_obj);
free_channel(channel); free_channel(channel);
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
* Hank Janssen <hjanssen@microsoft.com> * Hank Janssen <hjanssen@microsoft.com>
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/wait.h> #include <linux/wait.h>
...@@ -153,8 +155,8 @@ int vmbus_connect(void) ...@@ -153,8 +155,8 @@ int vmbus_connect(void)
if (msginfo->response.version_response.version_supported) { if (msginfo->response.version_response.version_supported) {
vmbus_connection.conn_state = CONNECTED; vmbus_connection.conn_state = CONNECTED;
} else { } else {
DPRINT_ERR(VMBUS, "Vmbus connection failed!!..." pr_err("Unable to connect, "
"current version (%d) not supported", "Version %d not supported by Hyper-V\n",
VMBUS_REVISION_NUMBER); VMBUS_REVISION_NUMBER);
ret = -1; ret = -1;
goto Cleanup; goto Cleanup;
...@@ -216,7 +218,7 @@ int vmbus_disconnect(void) ...@@ -216,7 +218,7 @@ int vmbus_disconnect(void)
vmbus_connection.conn_state = DISCONNECTED; vmbus_connection.conn_state = DISCONNECTED;
DPRINT_INFO(VMBUS, "Vmbus disconnected!!"); pr_info("hv_vmbus disconnected\n");
Cleanup: Cleanup:
kfree(msg); kfree(msg);
...@@ -269,7 +271,7 @@ static void process_chn_event(void *context) ...@@ -269,7 +271,7 @@ static void process_chn_event(void *context)
* (void*)channel); * (void*)channel);
*/ */
} else { } else {
DPRINT_ERR(VMBUS, "channel not found for relid - %d.", relid); pr_err("channel not found for relid - %d\n", relid);
} }
} }
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
* Hank Janssen <hjanssen@microsoft.com> * Hank Janssen <hjanssen@microsoft.com>
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -116,7 +118,7 @@ static int query_hypervisor_info(void) ...@@ -116,7 +118,7 @@ static int query_hypervisor_info(void)
edx = 0; edx = 0;
op = HVCPUID_VERSION; op = HVCPUID_VERSION;
cpuid(op, &eax, &ebx, &ecx, &edx); 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, eax,
ebx >> 16, ebx >> 16,
ebx & 0xFFFF, ebx & 0xFFFF,
...@@ -369,8 +371,7 @@ void hv_synic_init(void *irqarg) ...@@ -369,8 +371,7 @@ void hv_synic_init(void *irqarg)
(void *)get_zeroed_page(GFP_ATOMIC); (void *)get_zeroed_page(GFP_ATOMIC);
if (hv_context.synic_message_page[cpu] == NULL) { if (hv_context.synic_message_page[cpu] == NULL) {
DPRINT_ERR(VMBUS, pr_err("Unable to allocate SYNIC message page\n");
"unable to allocate SYNIC message page!!");
goto Cleanup; goto Cleanup;
} }
...@@ -378,8 +379,7 @@ void hv_synic_init(void *irqarg) ...@@ -378,8 +379,7 @@ void hv_synic_init(void *irqarg)
(void *)get_zeroed_page(GFP_ATOMIC); (void *)get_zeroed_page(GFP_ATOMIC);
if (hv_context.synic_event_page[cpu] == NULL) { if (hv_context.synic_event_page[cpu] == NULL) {
DPRINT_ERR(VMBUS, pr_err("Unable to allocate SYNIC event page\n");
"unable to allocate SYNIC event page!!");
goto Cleanup; goto Cleanup;
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
* Hank Janssen <hjanssen@microsoft.com> * Hank Janssen <hjanssen@microsoft.com>
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
* *
* 3/9/2011: K. Y. Srinivasan - Significant restructuring and cleanup * 3/9/2011: K. Y. Srinivasan - Significant restructuring and cleanup
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/device.h> #include <linux/device.h>
...@@ -350,18 +352,16 @@ static int vmbus_probe(struct device *child_device) ...@@ -350,18 +352,16 @@ static int vmbus_probe(struct device *child_device)
ret = dev->probe_error = ret = dev->probe_error =
drv->driver.probe(child_device); drv->driver.probe(child_device);
if (ret != 0) { if (ret != 0) {
DPRINT_ERR(VMBUS_DRV, "probe() failed for device %s " pr_err("probe failed for device %s (%d)\n",
"(%p) on driver %s (%d)...", dev_name(child_device), ret);
dev_name(child_device), child_device,
child_device->driver->name, ret);
INIT_WORK(&dev->probe_failed_work_item, INIT_WORK(&dev->probe_failed_work_item,
vmbus_probe_failed_cb); vmbus_probe_failed_cb);
schedule_work(&dev->probe_failed_work_item); schedule_work(&dev->probe_failed_work_item);
} }
} else { } else {
DPRINT_ERR(VMBUS_DRV, "probe() method not set for driver - %s", pr_err("probe not set for driver %s\n",
child_device->driver->name); dev_name(child_device));
ret = -1; ret = -1;
} }
return ret; return ret;
...@@ -386,9 +386,8 @@ static int vmbus_remove(struct device *child_device) ...@@ -386,9 +386,8 @@ static int vmbus_remove(struct device *child_device)
if (drv->driver.remove) { if (drv->driver.remove) {
ret = drv->driver.remove(child_device); ret = drv->driver.remove(child_device);
} else { } else {
DPRINT_ERR(VMBUS_DRV, pr_err("remove not set for driver %s\n",
"remove() method not set for driver - %s", dev_name(child_device));
child_device->driver->name);
ret = -1; ret = -1;
} }
} }
...@@ -572,12 +571,10 @@ static int vmbus_bus_init(struct pci_dev *pdev) ...@@ -572,12 +571,10 @@ static int vmbus_bus_init(struct pci_dev *pdev)
/* Hypervisor initialization...setup hypercall page..etc */ /* Hypervisor initialization...setup hypercall page..etc */
ret = hv_init(); ret = hv_init();
if (ret != 0) { if (ret != 0) {
DPRINT_ERR(VMBUS, "Unable to initialize the hypervisor - 0x%x", pr_err("Unable to initialize the hypervisor - 0x%x\n", ret);
ret);
goto cleanup; goto cleanup;
} }
hv_bus.bus.name = driver_name; hv_bus.bus.name = driver_name;
/* Initialize the bus context */ /* Initialize the bus context */
...@@ -599,7 +596,7 @@ static int vmbus_bus_init(struct pci_dev *pdev) ...@@ -599,7 +596,7 @@ static int vmbus_bus_init(struct pci_dev *pdev)
driver_name, pdev); driver_name, pdev);
if (ret != 0) { if (ret != 0) {
DPRINT_ERR(VMBUS_DRV, "ERROR - Unable to request IRQ %d", pr_err("Unable to request IRQ %d\n",
pdev->irq); pdev->irq);
bus_unregister(&hv_bus.bus); bus_unregister(&hv_bus.bus);
...@@ -669,8 +666,7 @@ int vmbus_child_driver_register(struct device_driver *drv) ...@@ -669,8 +666,7 @@ int vmbus_child_driver_register(struct device_driver *drv)
{ {
int ret; int ret;
DPRINT_INFO(VMBUS_DRV, "child driver (%p) registering - name %s", pr_info("child driver registering - name %s\n", drv->name);
drv, drv->name);
/* The child driver on this vmbus */ /* The child driver on this vmbus */
drv->bus = &hv_bus.bus; drv->bus = &hv_bus.bus;
...@@ -695,8 +691,7 @@ EXPORT_SYMBOL(vmbus_child_driver_register); ...@@ -695,8 +691,7 @@ EXPORT_SYMBOL(vmbus_child_driver_register);
*/ */
void vmbus_child_driver_unregister(struct device_driver *drv) void vmbus_child_driver_unregister(struct device_driver *drv)
{ {
DPRINT_INFO(VMBUS_DRV, "child driver (%p) unregistering - name %s", pr_info("child driver unregistering - name %s\n", drv->name);
drv, drv->name);
driver_unregister(drv); driver_unregister(drv);
...@@ -717,8 +712,7 @@ struct hv_device *vmbus_child_device_create(struct hv_guid *type, ...@@ -717,8 +712,7 @@ struct hv_device *vmbus_child_device_create(struct hv_guid *type,
/* Allocate the new child device */ /* Allocate the new child device */
child_device_obj = kzalloc(sizeof(struct hv_device), GFP_KERNEL); child_device_obj = kzalloc(sizeof(struct hv_device), GFP_KERNEL);
if (!child_device_obj) { if (!child_device_obj) {
DPRINT_ERR(VMBUS_DRV, pr_err("Unable to allocate device object for child device\n");
"unable to allocate device_context for child device");
return NULL; return NULL;
} }
...@@ -759,11 +753,10 @@ int vmbus_child_device_register(struct hv_device *child_device_obj) ...@@ -759,11 +753,10 @@ int vmbus_child_device_register(struct hv_device *child_device_obj)
ret = child_device_obj->probe_error; ret = child_device_obj->probe_error;
if (ret) if (ret)
DPRINT_ERR(VMBUS_DRV, "unable to register child device (%p)", pr_err("Unable to register child device\n");
&child_device_obj->device);
else else
DPRINT_INFO(VMBUS_DRV, "child device (%p) registered", pr_info("child device %s registered\n",
&child_device_obj->device); dev_name(&child_device_obj->device));
return ret; return ret;
} }
...@@ -780,8 +773,8 @@ void vmbus_child_device_unregister(struct hv_device *device_obj) ...@@ -780,8 +773,8 @@ void vmbus_child_device_unregister(struct hv_device *device_obj)
*/ */
device_unregister(&device_obj->device); device_unregister(&device_obj->device);
DPRINT_INFO(VMBUS_DRV, "child device (%p) unregistered", pr_info("child device %s unregistered\n",
&device_obj->device); dev_name(&device_obj->device));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册