Re: [PATCH v2] xen-blkback: define pr_fmt macro to avoid the duplication of DRV_PFX

2015-04-01 Thread Chentao (Boby)
On 2015/4/1 23:04, Tao Chen wrote: Define pr_fmt macro with {xen-blkback: } prefix, then remove all use of DRV_PFX in the pr sentences. Replace all DPRINTK with pr sentences, and get rid of DPRINTK macro. It will simplify the code. And if the pr sentences miss a \n, add it in the end. If the

Re: [PATCH] xen-blkback: define pr_fmt macro to avoid the duplication of DRV_PFX

2015-04-01 Thread Chentao (Boby)
Thanks roger and joe. I will adopt your suggestions in my v2 patch. On 2015/3/31 22:57, Roger Pau Monné wrote: El 31/03/15 a les 23.14, Tao Chen ha escrit: Define pr_fmt macro with {xen-blkback: } prefix, then remove all use of DRV_PFX in the pr and DPRINTK sentences. It will simplify the

Re: [PATCH] xen-blkback: define pr_fmt macro to avoid the duplication of DRV_PFX

2015-04-01 Thread Chentao (Boby)
Thanks roger and joe. I will adopt your suggestions in my v2 patch. On 2015/3/31 22:57, Roger Pau Monné wrote: El 31/03/15 a les 23.14, Tao Chen ha escrit: Define pr_fmt macro with {xen-blkback: } prefix, then remove all use of DRV_PFX in the pr and DPRINTK sentences. It will simplify the

Re: [PATCH v2] xen-blkback: define pr_fmt macro to avoid the duplication of DRV_PFX

2015-04-01 Thread Chentao (Boby)
On 2015/4/1 23:04, Tao Chen wrote: Define pr_fmt macro with {xen-blkback: } prefix, then remove all use of DRV_PFX in the pr sentences. Replace all DPRINTK with pr sentences, and get rid of DPRINTK macro. It will simplify the code. And if the pr sentences miss a \n, add it in the end. If the

Re: [PATCH] xen-blkback: enlarge the array size of blkback name

2015-03-26 Thread Chentao (Boby)
You are right, roger. Thanks. domid is a u16, it will occupy 5 characters at most. So the biggest length of blkback name is 8+5+5=18. At this situation, define BLKBACK_NAME_LEN macro to be 20 is safe. On 2015/3/26 19:23, Roger Pau Monné wrote: El 13/03/15 a les 16.52, Tao Chen ha escrit:

Re: [PATCH] xen-blkback: enlarge the array size of blkback name

2015-03-26 Thread Chentao (Boby)
You are right, roger. Thanks. domid is a u16, it will occupy 5 characters at most. So the biggest length of blkback name is 8+5+5=18. At this situation, define BLKBACK_NAME_LEN macro to be 20 is safe. On 2015/3/26 19:23, Roger Pau Monné wrote: El 13/03/15 a les 16.52, Tao Chen ha escrit:

Re: [PATCH v2] xen-scsiback: use DRV_PFX in the pr macros and DPRINTK

2015-03-09 Thread Chentao (Boby)
On 2015/3/6 20:50, Joe Perches wrote: On Fri, 2015-03-06 at 17:33 +0800, Chentao (Boby) wrote: #ifdef pr_fmt #undef pr_fmt #endif #define pr_fmt(fmt) "xen-pvscsi: " fmt No, just use add #define pr_fmt(fmt) "xen-pvscsi: " fmt before the first #include. The #ifdef

Re: [PATCH v3] xen-scsiback: define a pr_fmt macro with xen-pvscsi

2015-03-09 Thread Chentao (Boby)
On 2015/3/6 20:53, Juergen Gross wrote: On 03/06/2015 09:34 PM, Tao Chen wrote: Add the {xen-pvscsi: } prefix in pr_fmt and remove DPRINTK, then replace all DPRINTK with pr_debug. Also fixed up some comments just as eliminate redundant whitespace and format the code. These will make the

Re: [PATCH v3] xen-scsiback: define a pr_fmt macro with xen-pvscsi

2015-03-09 Thread Chentao (Boby)
On 2015/3/6 20:53, Juergen Gross wrote: On 03/06/2015 09:34 PM, Tao Chen wrote: Add the {xen-pvscsi: } prefix in pr_fmt and remove DPRINTK, then replace all DPRINTK with pr_debug. Also fixed up some comments just as eliminate redundant whitespace and format the code. These will make the

Re: [PATCH v2] xen-scsiback: use DRV_PFX in the pr macros and DPRINTK

2015-03-09 Thread Chentao (Boby)
On 2015/3/6 20:50, Joe Perches wrote: On Fri, 2015-03-06 at 17:33 +0800, Chentao (Boby) wrote: #ifdef pr_fmt #undef pr_fmt #endif #define pr_fmt(fmt) xen-pvscsi: fmt No, just use add #define pr_fmt(fmt) xen-pvscsi: fmt before the first #include. The #ifdef/#undef/#endif isn't necessary

Re: [PATCH v2] xen-scsiback: use DRV_PFX in the pr macros and DPRINTK

2015-03-06 Thread Chentao (Boby)
On 2015/3/4 18:34, David Vrabel wrote: On 04/03/15 18:32, 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

Re: [PATCH v2] xen-scsiback: use DRV_PFX in the pr macros and DPRINTK

2015-03-06 Thread Chentao (Boby)
On 2015/3/5 0:32, Joe Perches wrote: On Wed, 2015-03-04 at 18:32 +, 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

Re: [PATCH v2] xen-scsiback: use DRV_PFX in the pr macros and DPRINTK

2015-03-06 Thread Chentao (Boby)
On 2015/3/5 0:32, Joe Perches wrote: On Wed, 2015-03-04 at 18:32 +, 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

Re: [PATCH v2] xen-scsiback: use DRV_PFX in the pr macros and DPRINTK

2015-03-06 Thread Chentao (Boby)
On 2015/3/4 18:34, David Vrabel wrote: On 04/03/15 18:32, 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

Re: [PATCH] xen-scsiback: use DRV_PFX in the pr macros

2015-03-04 Thread Chentao (Boby)
Hi, Juergen. Thanks for your advice. I will send a v2 patch based on your suggested modifications. On 2015/3/3 17:52, Juergen Gross wrote: On 03/03/2015 09:37 AM, Tao Chen wrote: Replace the string of {xen-pvscsi:} in the pr sentences with DRV_PFX, it makes the code easier to read. I'm

Re: [PATCH] xen-scsiback: use DRV_PFX in the pr macros

2015-03-04 Thread Chentao (Boby)
Hi, Juergen. Thanks for your advice. I will send a v2 patch based on your suggested modifications. On 2015/3/3 17:52, Juergen Gross wrote: On 03/03/2015 09:37 AM, Tao Chen wrote: Replace the string of {xen-pvscsi:} in the pr sentences with DRV_PFX, it makes the code easier to read. I'm