Re: [Xen-devel] [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 code.

And if the pr sentences miss a \n, add it in the end. If the DPRINTK
sentences have redundant \n, remove it. It will format the code.

These all make the readability of the code become better.


Thanks for the patch.


Signed-off-by: Tao Chen boby.c...@huawei.com
---
  drivers/block/xen-blkback/blkback.c | 62 ++---
  drivers/block/xen-blkback/common.h  |  6 
  drivers/block/xen-blkback/xenbus.c  | 18 ++-
  3 files changed, 42 insertions(+), 44 deletions(-)


[...]

diff --git a/drivers/block/xen-blkback/common.h 
b/drivers/block/xen-blkback/common.h
index 375d288..f620b5d 100644
--- a/drivers/block/xen-blkback/common.h
+++ b/drivers/block/xen-blkback/common.h
@@ -44,12 +44,6 @@
  #include xen/interface/io/blkif.h
  #include xen/interface/io/protocols.h

-#define DRV_PFX xen-blkback:
-#define DPRINTK(fmt, args...)  \
-   pr_debug(DRV_PFX (%s:%d)  fmt .\n,  \
-__func__, __LINE__, ##args)
-
-
  /*
   * This is the maximum number of segments that would be allowed in indirect
   * requests. This value will also be passed to the frontend.
diff --git a/drivers/block/xen-blkback/xenbus.c 
b/drivers/block/xen-blkback/xenbus.c
index b33083e..0dbbfeb 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -14,6 +14,11 @@

  */

+#define pr_fmt(fmt) xen-blkback:  fmt
+#define DPRINTK(fmt, args...)  \
+   pr_debug((%s:%d)  fmt .\n,  \
+   __func__, __LINE__, ##args)
+
  #include stdarg.h
  #include linux/module.h
  #include linux/kthread.h
@@ -426,14 +431,14 @@ static int xen_vbd_create(struct xen_blkif *blkif, 
blkif_vdev_t handle,
 FMODE_READ : FMODE_WRITE, NULL);

if (IS_ERR(bdev)) {
-   DPRINTK(xen_vbd_create: device %08x could not be opened.\n,
+   DPRINTK(xen_vbd_create: device %08x could not be opened,
vbd-pdevice);
return -ENOENT;
}

vbd-bdev = bdev;
if (vbd-bdev-bd_disk == NULL) {
-   DPRINTK(xen_vbd_create: device %08x doesn't exist.\n,
+   DPRINTK(xen_vbd_create: device %08x doesn't exist,
vbd-pdevice);


IMHO this two above should be made a pr_warn probably...


xen_vbd_free(vbd);
return -ENOENT;
@@ -452,7 +457,7 @@ static int xen_vbd_create(struct xen_blkif *blkif, 
blkif_vdev_t handle,
if (q  blk_queue_secdiscard(q))
vbd-discard_secure = true;

-   DPRINTK(Successful creation of handle=%04x (dom=%u)\n,
+   DPRINTK(Successful creation of handle=%04x (dom=%u),
handle, blkif-domid);


...and this should be turned into a plain pr_debug. And with that we can
get rid of DPRINTK.

Roger.


.




___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [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 DPRINTK
sentences have redundant \n, remove it. It will format the code.



I'm sorry, I made a mistake in this patch log. It must be changed as below.

And if the pr sentences miss a \n, add it in the end. It will format the 
code.


I apologize for the disturb of wrong patch log. Very looking forward
to your reply.


These all make the readability of the code become better.

Signed-off-by: Tao Chen boby.c...@huawei.com
---
v2:
   - Replace all DPRINTK with pr sentences, and get rid of DPRINTK macro.
---
  drivers/block/xen-blkback/blkback.c | 62 ++---
  drivers/block/xen-blkback/common.h  |  6 
  drivers/block/xen-blkback/xenbus.c  | 31 +++
  3 files changed, 49 insertions(+), 50 deletions(-)

diff --git a/drivers/block/xen-blkback/blkback.c 
b/drivers/block/xen-blkback/blkback.c
index 2a04d34..bd2b3bb 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -34,6 +34,8 @@
   * IN THE SOFTWARE.
   */

+#define pr_fmt(fmt) xen-blkback:  fmt
+
  #include linux/spinlock.h
  #include linux/kthread.h
  #include linux/list.h
@@ -211,7 +213,7 @@ static int add_persistent_gnt(struct xen_blkif *blkif,
else if (persistent_gnt-gnt  this-gnt)
new = ((*new)-rb_right);
else {
-   pr_alert_ratelimited(DRV_PFX  trying to add a gref that's 
already in the tree\n);
+   pr_alert_ratelimited(trying to add a gref that's already in 
the tree\n);
return -EINVAL;
}
}
@@ -242,7 +244,7 @@ static struct persistent_gnt *get_persistent_gnt(struct 
xen_blkif *blkif,
node = node-rb_right;
else {
if(test_bit(PERSISTENT_GNT_ACTIVE, data-flags)) {
-   pr_alert_ratelimited(DRV_PFX  requesting a grant 
already in use\n);
+   pr_alert_ratelimited(requesting a grant already in 
use\n);
return NULL;
}
set_bit(PERSISTENT_GNT_ACTIVE, data-flags);
@@ -257,7 +259,7 @@ static void put_persistent_gnt(struct xen_blkif *blkif,
 struct persistent_gnt *persistent_gnt)
  {
if(!test_bit(PERSISTENT_GNT_ACTIVE, persistent_gnt-flags))
- pr_alert_ratelimited(DRV_PFX  freeing a grant already 
unused);
+   pr_alert_ratelimited(freeing a grant already unused\n);
set_bit(PERSISTENT_GNT_WAS_ACTIVE, persistent_gnt-flags);
clear_bit(PERSISTENT_GNT_ACTIVE, persistent_gnt-flags);
atomic_dec(blkif-persistent_gnt_in_use);
@@ -374,7 +376,7 @@ static void purge_persistent_gnt(struct xen_blkif *blkif)
}

if (work_pending(blkif-persistent_purge_work)) {
-   pr_alert_ratelimited(DRV_PFX Scheduled work from previous purge is 
still pending, cannot purge list\n);
+   pr_alert_ratelimited(Scheduled work from previous purge is still 
pending, cannot purge list\n);
return;
}

@@ -396,7 +398,7 @@ static void purge_persistent_gnt(struct xen_blkif *blkif)

total = num_clean;

-   pr_debug(DRV_PFX Going to purge %u persistent grants\n, num_clean);
+   pr_debug(Going to purge %u persistent grants\n, num_clean);

BUG_ON(!list_empty(blkif-persistent_purge_list));
root = blkif-persistent_gnts;
@@ -428,13 +430,13 @@ purge_list:
 * with the requested num
 */
if (!scan_used  !clean_used) {
-   pr_debug(DRV_PFX Still missing %u purged frames\n, num_clean);
+   pr_debug(Still missing %u purged frames\n, num_clean);
scan_used = true;
goto purge_list;
}
  finished:
if (!clean_used) {
-   pr_debug(DRV_PFX Finished scanning for grants to clean, removing 
used flag\n);
+   pr_debug(Finished scanning for grants to clean, removing used 
flag\n);
clean_used = true;
goto purge_list;
}
@@ -444,7 +446,7 @@ finished:

/* We can defer this work */
schedule_work(blkif-persistent_purge_work);
-   pr_debug(DRV_PFX Purged %u/%u\n, (total - num_clean), total);
+   pr_debug(Purged %u/%u\n, (total - num_clean), total);
return;
  }

@@ -520,20 +522,20 @@ static void xen_vbd_resize(struct xen_blkif *blkif)
struct xenbus_device *dev = xen_blkbk_xenbus(blkif-be);
unsigned long long new_size = vbd_sz(vbd);

-   pr_info(DRV_PFX VBD Resize: Domid: %d, Device: (%d, %d)\n,
+   pr_info(VBD Resize: Domid: 

Re: [Xen-devel] [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:

The blkback name is like blkback.domid.xvd[a-z], if domid has three digits
(means larger than 100), then the backmost xvd wouldn't be fully shown.

Define a BLKBACK_NAME_LEN macro which is (TASK_COMM_LEN * 2), enlarge the
array size of blkback name, so it will be fully shown in any case.

Signed-off-by: Tao Chen boby.c...@huawei.com
---
  drivers/block/xen-blkback/xenbus.c | 7 +--
  1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/block/xen-blkback/xenbus.c 
b/drivers/block/xen-blkback/xenbus.c
index e3afe97..0289e21 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -21,6 +21,9 @@
  #include xen/grant_table.h
  #include common.h

+/* Enlarge the array size in order to fully show blkback name. */
+#define BLKBACK_NAME_LEN (TASK_COMM_LEN * 2)


Any reason to use TASK_COMM_LEN instead of just coding it to 17? Or
maybe 20 to be on the safe side?

Roger.

.




___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [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 code easier to read.

Signed-off-by: Tao Chen boby.c...@huawei.com
---
  drivers/xen/xen-scsiback.c | 72
--
  1 file changed, 37 insertions(+), 35 deletions(-)

diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
index 9faca6a..919397e 100644
--- 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 DPRINTK(_f, _a...)\
-pr_debug((file=%s, line=%d)  _f, __FILE__ , __LINE__ , ## _a)
+#ifdef pr_fmt
+#undef pr_fmt
+#endif
+#define pr_fmt(fmt) xen-pvscsi:  fmt


Have you looked around in the kernel how pr_fmt() is used normally?
You can spare 3 lines by placing the #define above all #include lines.



Many thanks for pointing out my mistake. I will correct it.



  #define VSCSI_VERSIONv0.1
  #define VSCSI_NAMELEN32
@@ -271,7 +273,7 @@ static void scsiback_print_status(char
*sense_buffer, int errors,
  {
  struct scsiback_tpg *tpg = pending_req-v2p-tpg;

-pr_err(xen-pvscsi[%s:%d] cmnd[0]=%02x - st=%02x msg=%02x
host=%02x drv=%02x\n,
+pr_err([%s:%d] cmnd[0]=%02x - st=%02x msg=%02x host=%02x
drv=%02x\n,
 tpg-tport-tport_name, pending_req-v2p-lun,
 pending_req-cmnd[0], status_byte(errors), msg_byte(errors),
 host_byte(errors), driver_byte(errors));
@@ -427,7 +429,7 @@ static int scsiback_gnttab_data_map_batch(struct
gnttab_map_grant_ref *map,
  BUG_ON(err);
  for (i = 0; i  cnt; i++) {
  if (unlikely(map[i].status != GNTST_okay)) {
-pr_err(xen-pvscsi: invalid buffer -- could not remap
it\n);
+pr_err(invalid buffer -- could not remap it\n);
  map[i].handle = SCSIBACK_INVALID_HANDLE;
  err = -ENOMEM;
  } else {
@@ -449,7 +451,7 @@ static int scsiback_gnttab_data_map_list(struct
vscsibk_pend *pending_req,
  for (i = 0; i  cnt; i++) {
  if (get_free_page(pg + mapcount)) {
  put_free_pages(pg, mapcount);
-pr_err(xen-pvscsi: no grant page\n);
+pr_err(no grant page\n);
  return -ENOMEM;
  }
  gnttab_set_map_op(map[mapcount], vaddr_page(pg[mapcount]),
@@ -492,7 +494,7 @@ static int scsiback_gnttab_data_map(struct
vscsiif_request *ring_req,
  return 0;

  if (nr_segments  VSCSIIF_SG_TABLESIZE) {
-DPRINTK(xen-pvscsi: invalid parameter nr_seg = %d\n,
+pr_debug(invalid parameter nr_seg = %d\n,
  ring_req-nr_segments);
  return -EINVAL;
  }
@@ -516,13 +518,13 @@ static int scsiback_gnttab_data_map(struct
vscsiif_request *ring_req,
  nr_segments += n_segs;
  }
  if (nr_segments  SG_ALL) {
-DPRINTK(xen-pvscsi: invalid nr_seg = %d\n,
+pr_debug(invalid nr_seg = %d\n,
  nr_segments);


Above 2 lines fit into a single one now.



I will correct it.


  return -EINVAL;
  }
  }

-/* free of (sgl) in fast_flush_area()*/
+/* free of (sgl) in fast_flush_area() */
  pending_req-sgl = kmalloc_array(nr_segments,
  sizeof(struct scatterlist), GFP_KERNEL);
  if (!pending_req-sgl)
@@ -679,7 +681,7 @@ static int prepare_pending_reqs(struct
vscsibk_info *info,
  v2p = scsiback_do_translation(info, vir);
  if (!v2p) {
  pending_req-v2p = NULL;
-DPRINTK(xen-pvscsi: doesn't exist.\n);
+pr_debug(doesn't exist.\n);


Without the line information this message is pretty meaningless.


For this suggestion, I want to modify this print like below

pr_debug(the v2p of (chn:%d, tgt:%d, lun:%d) doesn't exist.\n,
 vir.chn, vir.tgt, vir.lun);

What do you think, Juergen?




  return -ENODEV;
  }
  pending_req-v2p = v2p;
@@ -690,14 +692,14 @@ static int prepare_pending_reqs(struct
vscsibk_info *info,
  (pending_req-sc_data_direction != DMA_TO_DEVICE) 
  (pending_req-sc_data_direction != DMA_FROM_DEVICE) 
  (pending_req-sc_data_direction != DMA_NONE)) {
-DPRINTK(xen-pvscsi: invalid parameter data_dir = %d\n,
+pr_debug(invalid parameter data_dir = %d\n,
  pending_req-sc_data_direction);
  return -EINVAL;
  }

  pending_req-cmd_len = ring_req-cmd_len;
  if (pending_req-cmd_len  VSCSIIF_MAX_COMMAND_SIZE) {
-DPRINTK(xen-pvscsi: invalid parameter cmd_len = %d\n,
+pr_debug(invalid parameter cmd_len = %d\n,
  pending_req-cmd_len);
  return -EINVAL;
  }
@@ -721,7 +723,7 @@ static int scsiback_do_cmd_fn(struct vscsibk_info
*info)

  if 

Re: [Xen-devel] [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.


Then replace all DPRINTK with pr_debug.


Yes on this one.



Thanks very much, Joe.





.




___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [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 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.



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [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 read.


I have already said you needed to use:

#define pr_fmt(fmt)

to do this.

David

.



David, I'm sorry because I didn't read your reply in time.

I will accept your advice in my next patch. Many thanks to you.


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [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 not really convinced this is worth a patch. OTOH I'm not completely
against it. If nobody rejects this and all my further comments are
addressed you can have my:

Acked-by: Juergen Gross jgr...@suse.com



Signed-off-by: Tao Chen boby.c...@huawei.com
---
  drivers/xen/xen-scsiback.c | 67
+++---
  1 file changed, 34 insertions(+), 33 deletions(-)

diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
index 9faca6a..307100d 100644
--- a/drivers/xen/xen-scsiback.c
+++ b/drivers/xen/xen-scsiback.c
@@ -69,6 +69,7 @@
  #include xen/interface/grant_table.h
  #include xen/interface/io/vscsiif.h

+#define DRV_PFX xen-pvscsi:


Using xen-pvscsi:  wouldn't delete the white space after the colon in
most messages.



  #define DPRINTK(_f, _a...)\
  pr_debug((file=%s, line=%d)  _f, __FILE__ , __LINE__ , ## _a)

@@ -84,7 +85,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 */


Unrelated white space change (others as well). Either omit them or
mention them in the commit message.


  unsigned int lun;
  struct kref kref;
  struct list_head l;
@@ -271,7 +272,7 @@ static void scsiback_print_status(char
*sense_buffer, int errors,
  {
  struct scsiback_tpg *tpg = pending_req-v2p-tpg;

-pr_err(xen-pvscsi[%s:%d] cmnd[0]=%02x - st=%02x msg=%02x
host=%02x drv=%02x\n,
+pr_err(DRV_PFX [%s:%d] cmnd[0]=%02x - st=%02x msg=%02x
host=%02x drv=%02x\n,
 tpg-tport-tport_name, pending_req-v2p-lun,
 pending_req-cmnd[0], status_byte(errors), msg_byte(errors),
 host_byte(errors), driver_byte(errors));
@@ -427,7 +428,7 @@ static int scsiback_gnttab_data_map_batch(struct
gnttab_map_grant_ref *map,
  BUG_ON(err);
  for (i = 0; i  cnt; i++) {
  if (unlikely(map[i].status != GNTST_okay)) {
-pr_err(xen-pvscsi: invalid buffer -- could not remap
it\n);
+pr_err(DRV_PFX invalid buffer -- could not remap it\n);
  map[i].handle = SCSIBACK_INVALID_HANDLE;
  err = -ENOMEM;
  } else {
@@ -449,7 +450,7 @@ static int scsiback_gnttab_data_map_list(struct
vscsibk_pend *pending_req,
  for (i = 0; i  cnt; i++) {
  if (get_free_page(pg + mapcount)) {
  put_free_pages(pg, mapcount);
-pr_err(xen-pvscsi: no grant page\n);
+pr_err(DRV_PFX no grant page\n);
  return -ENOMEM;
  }
  gnttab_set_map_op(map[mapcount], vaddr_page(pg[mapcount]),
@@ -492,7 +493,7 @@ static int scsiback_gnttab_data_map(struct
vscsiif_request *ring_req,
  return 0;

  if (nr_segments  VSCSIIF_SG_TABLESIZE) {
-DPRINTK(xen-pvscsi: invalid parameter nr_seg = %d\n,
+DPRINTK(DRV_PFX invalid parameter nr_seg = %d\n,


As DPRINTK already contains the file name, you can omit the prefix.
Alternatively include DRV_PFX in the DPRINTK macro.


  ring_req-nr_segments);
  return -EINVAL;
  }
@@ -516,13 +517,13 @@ static int scsiback_gnttab_data_map(struct
vscsiif_request *ring_req,
  nr_segments += n_segs;
  }
  if (nr_segments  SG_ALL) {
-DPRINTK(xen-pvscsi: invalid nr_seg = %d\n,
+DPRINTK(DRV_PFX invalid nr_seg = %d\n,
  nr_segments);
  return -EINVAL;
  }
  }

-/* free of (sgl) in fast_flush_area()*/
+/* free of (sgl) in fast_flush_area() */
  pending_req-sgl = kmalloc_array(nr_segments,
  sizeof(struct scatterlist), GFP_KERNEL);
  if (!pending_req-sgl)
@@ -679,7 +680,7 @@ static int prepare_pending_reqs(struct
vscsibk_info *info,
  v2p = scsiback_do_translation(info, vir);
  if (!v2p) {
  pending_req-v2p = NULL;
-DPRINTK(xen-pvscsi: doesn't exist.\n);
+DPRINTK(DRV_PFX doesn't exist.\n);
  return -ENODEV;
  }
  pending_req-v2p = v2p;
@@ -690,14 +691,14 @@ static int prepare_pending_reqs(struct
vscsibk_info *info,
  (pending_req-sc_data_direction != DMA_TO_DEVICE) 
  (pending_req-sc_data_direction != DMA_FROM_DEVICE) 
  (pending_req-sc_data_direction != DMA_NONE)) {
-DPRINTK(xen-pvscsi: invalid parameter data_dir = %d\n,
+DPRINTK(DRV_PFX invalid parameter data_dir = %d\n,
  pending_req-sc_data_direction);
  return -EINVAL;
  }

  pending_req-cmd_len = ring_req-cmd_len;
  if (pending_req-cmd_len  VSCSIIF_MAX_COMMAND_SIZE) {
-DPRINTK(xen-pvscsi: invalid parameter cmd_len = %d\n,
+