[PATCH 1/6] Staging: hv: vmbus_drv.c Replaced DPRINT with native pr_XXX

Hank Janssen hjanssen at microsoft.com
Wed Feb 23 16:58:10 UTC 2011



> -----Original Message-----
> From: Joe Perches [mailto:joe at perches.com]
> Sent: Tuesday, February 22, 2011 8:51 PM


> On Tue, 2011-02-22 at 15:32 -0800, Hank Janssen wrote:
> > This group of patches removes all DPRINT from hv_vmbus.ko.
> > It is divided in several patches due to size.
> []
> > -		DPRINT_ERR(VMBUS_DRV,
> > -			   "ERROR - Unable to register vmbus root device");
> > +		pr_err("%s: %s ERROR Unable to register vmbus root device",
> > +		       VMBUS_MOD, __func__);
> 
> All of the pr_<level> calls should probably have a terminating "\n"

I will correct them and resubmit.

> 
> Also, ff all the pr_<level>'s are using VMBUS_MOD,
> then perhaps it would look better to add
> 
> #define pr_fmt(fmt) "%s: " fmt, VMBUS_MOD
> or
> #define pr_fmt(fmt) "%s:%s " fmt, VMBUS_MOD, __func__
> (if you must)

I wrestled with that when I did the conversion, The reason I did not
Do that is when I check other drivers very few do it that way, most do
It the way I do it or actually hard code the module name to be printed.
And since the original objection was that DPRINT seems to implement it's
own logging I did not want to re-implement the pr_XXX calls with this layer
of indirection which almost looks like I am going down the path of DPRINT
again.

So what is the general consensus. The current way I implemented it seems
to be how other drivers use it to.

Hank.



More information about the devel mailing list