From: "Chentao (Boby)" <boby.chen@huawei.com>
To: Joe Perches <joe@perches.com>
Cc: jgross@suse.com, konrad.wilk@oracle.com,
boris.ostrovsky@oracle.com, david.vrabel@citrix.com,
xen-devel@lists.xenproject.org, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org, wu.wubin@huawei.com,
rudy.zhangmin@huawei.com
Subject: Re: [PATCH v2] xen-scsiback: use DRV_PFX in the pr macros and DPRINTK
Date: Fri, 6 Mar 2015 17:33:10 +0800 [thread overview]
Message-ID: <54F97456.2070102@huawei.com> (raw)
In-Reply-To: <1425486739.2712.12.camel@perches.com>
On 2015/3/5 0:32, Joe Perches wrote:
> On Wed, 2015-03-04 at 18:32 +0000, Tao Chen wrote:
>> Defined the string of {xen-pvscsi: } as DRV_PFX, then use it in the pr sentences and DPRINTK.
>> Also fixed up some comments just as eliminate redundant white spaces and format the code.
>> These will make the code easier to read.
>
> It'd probaby be better just to use pr_fmt
> before any include and remove all the DRV_PRV uses
>
> #define pr_fmt(fmt) "xen-pvscsi: " fmt
>
>> diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
> []
>> @@ -69,8 +69,10 @@
>> #include <xen/interface/grant_table.h>
>> #include <xen/interface/io/vscsiif.h>
>>
>> +#define DRV_PFX "xen-pvscsi: "
>> #define DPRINTK(_f, _a...) \
>> - pr_debug("(file=%s, line=%d) " _f, __FILE__ , __LINE__ , ## _a)
>> + pr_debug(DRV_PFX "(file=%s, line=%d) " _f, \
>> + __FILE__ , __LINE__ , ## _a)
>
> I'd also remove DPRINTK and just use pr_debug directly
> as dynamic_debug can emit file and line as desired.
>
Joe, your suggested code is like below
#ifdef pr_fmt
#undef pr_fmt
#endif
#define pr_fmt(fmt) "xen-pvscsi: " fmt
Then replace all DPRINTK with pr_debug.
Am I right?
>> @@ -84,7 +86,7 @@ struct ids_tuple {
>>
>> struct v2p_entry {
>> struct ids_tuple v; /* translate from */
>> - struct scsiback_tpg *tpg; /* translate to */
>> + struct scsiback_tpg *tpg; /* translate to */
>
> superfluous change.
>
>
>
> .
>
I'm sorry, I made a mistake here. I will modify it in my next patch.
Thanks, Joe.
WARNING: multiple messages have this Message-ID (diff)
From: "Chentao (Boby)" <boby.chen@huawei.com>
To: Joe Perches <joe@perches.com>
Cc: <jgross@suse.com>, <konrad.wilk@oracle.com>,
<boris.ostrovsky@oracle.com>, <david.vrabel@citrix.com>,
<xen-devel@lists.xenproject.org>, <linux-scsi@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <wu.wubin@huawei.com>,
<rudy.zhangmin@huawei.com>
Subject: Re: [PATCH v2] xen-scsiback: use DRV_PFX in the pr macros and DPRINTK
Date: Fri, 6 Mar 2015 17:33:10 +0800 [thread overview]
Message-ID: <54F97456.2070102@huawei.com> (raw)
In-Reply-To: <1425486739.2712.12.camel@perches.com>
On 2015/3/5 0:32, Joe Perches wrote:
> On Wed, 2015-03-04 at 18:32 +0000, Tao Chen wrote:
>> Defined the string of {xen-pvscsi: } as DRV_PFX, then use it in the pr sentences and DPRINTK.
>> Also fixed up some comments just as eliminate redundant white spaces and format the code.
>> These will make the code easier to read.
>
> It'd probaby be better just to use pr_fmt
> before any include and remove all the DRV_PRV uses
>
> #define pr_fmt(fmt) "xen-pvscsi: " fmt
>
>> diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
> []
>> @@ -69,8 +69,10 @@
>> #include <xen/interface/grant_table.h>
>> #include <xen/interface/io/vscsiif.h>
>>
>> +#define DRV_PFX "xen-pvscsi: "
>> #define DPRINTK(_f, _a...) \
>> - pr_debug("(file=%s, line=%d) " _f, __FILE__ , __LINE__ , ## _a)
>> + pr_debug(DRV_PFX "(file=%s, line=%d) " _f, \
>> + __FILE__ , __LINE__ , ## _a)
>
> I'd also remove DPRINTK and just use pr_debug directly
> as dynamic_debug can emit file and line as desired.
>
Joe, your suggested code is like below
#ifdef pr_fmt
#undef pr_fmt
#endif
#define pr_fmt(fmt) "xen-pvscsi: " fmt
Then replace all DPRINTK with pr_debug.
Am I right?
>> @@ -84,7 +86,7 @@ struct ids_tuple {
>>
>> struct v2p_entry {
>> struct ids_tuple v; /* translate from */
>> - struct scsiback_tpg *tpg; /* translate to */
>> + struct scsiback_tpg *tpg; /* translate to */
>
> superfluous change.
>
>
>
> .
>
I'm sorry, I made a mistake here. I will modify it in my next patch.
Thanks, Joe.
next prev parent reply other threads:[~2015-03-06 9:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-04 18:32 [PATCH v2] xen-scsiback: use DRV_PFX in the pr macros and DPRINTK Tao Chen
2015-03-04 18:32 ` Tao Chen
2015-03-04 10:34 ` David Vrabel
2015-03-04 10:34 ` David Vrabel
2015-03-04 10:34 ` David Vrabel
2015-03-06 9:39 ` Chentao (Boby)
2015-03-06 9:39 ` Chentao (Boby)
2015-03-06 9:39 ` Chentao (Boby)
2015-03-04 16:32 ` Joe Perches
2015-03-04 16:32 ` Joe Perches
2015-03-06 9:33 ` Chentao (Boby) [this message]
2015-03-06 9:33 ` Chentao (Boby)
2015-03-06 12:50 ` Joe Perches
2015-03-09 13:59 ` Chentao (Boby)
2015-03-09 13:59 ` Chentao (Boby)
2015-03-09 13:59 ` Chentao (Boby)
2015-03-06 12:50 ` Joe Perches
2015-03-06 9:33 ` Chentao (Boby)
-- strict thread matches above, loose matches on Subject: below --
2015-03-04 18:32 Tao Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54F97456.2070102@huawei.com \
--to=boby.chen@huawei.com \
--cc=boris.ostrovsky@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=jgross@suse.com \
--cc=joe@perches.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=rudy.zhangmin@huawei.com \
--cc=wu.wubin@huawei.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.