pvSCSI: cleanup and fix few bugs
PATCH 4/4 pvSCSI: cleanup and fix few bugs
This patch clean up the code and fix few bugs.
Best regards,
Signed-off-by Tomonari Horikoshi <[email protected]>
Signed-off-by Jun Kamada <[email protected]>
-----
Jun Kamada
# HG changeset patch
# User [email protected]
# Date 1215499678 -32400
# Node ID 78b9dc262823eb54efeca46edeeb73785ea78bf2 # Parent bba146fe2ef8b6c81f6d036e753d8a79cbafdf4b
pvscsi: cleanup code
Signed-off-by Tomonari Horikoshi <[email protected]>
Signed-off-by Jun Kamada <[email protected]>
drivers/xen/scsiback/scsiback.c +12 -8
@@ -510,7 +510,7 @@ static int prepare_pending_reqs(struct v pending_req->sdev =NULL ;DPRINTK ("scsiback: doesn't exist.\n" ); err = -ENODEV ; - goto invald_value; + goto invalid_value; } pending_req->sdev = sdev;
@@ -524,7 +524,7 @@ static int prepare_pending_reqs(struct vDPRINTK ("scsiback: invalid parameter data_dir = %d\n" , pending_req->sc_data_direction); err = -EINVAL ; - goto invald_value; + goto invalid_value; } pending_req->nr_segments = ring_req->nr_segments;
@@ -533,7 +533,7 @@ static int prepare_pending_reqs(struct vDPRINTK ("scsiback: invalid parameter nr_seg = %d\n" , pending_req->nr_segments); err = -EINVAL ; - goto invald_value; + goto invalid_value; } pending_req->cmd_len = ring_req->cmd_len;
@@ -542,7 +542,7 @@ static int prepare_pending_reqs(struct vDPRINTK ("scsiback: invalid parameter cmd_len = %d\n" , pending_req->cmd_len); err = -EINVAL ; - goto invald_value; + goto invalid_value; }memcpy (pending_req->cmnd, ring_req->cmnd, pending_req->cmd_len);
@@ -551,12 +551,12 @@ static int prepare_pending_reqs(struct vif (scsiback_gnttab_data_map (ring_req, pending_req)) {DPRINTK ("scsiback: invalid buffer\n" ); err = -EINVAL ; - goto invald_value; + goto invalid_value; }return 0 ; -invald_value: +invalid_value:return err; }
@@ -669,7 +669,7 @@ static int __init scsiback_init(void) pending_grant_handles[i] =SCSIBACK_INVALID_HANDLE ;if (scsiback_interface_init () <0 ) - goto out_of_memory; + goto out_of_kmem;memset (pending_reqs,0 ,sizeof (pending_reqs));INIT_LIST_HEAD (&pending_free);
@@ -678,12 +678,16 @@ static int __init scsiback_init(void)list_add_tail (&pending_reqs[i].free_list, &pending_free);if (scsiback_xenbus_init ()) - goto out_of_memory; + goto out_of_xenbus;scsiback_emulation_init ();return 0 ; +out_of_xenbus: +scsiback_xenbus_unregister (); +out_of_kmem: +scsiback_interface_exit (); out_of_memory:kfree (pending_reqs);kfree (pending_grant_handles);
drivers/xen/scsiback/translate.c +1 -1
@@ -107,7 +107,7 @@ int scsiback_del_translation_entry(struc }spin_unlock_irqrestore (&info->v2p_lock, flags); -return 0 ; +return 1 ; found:/* Delete the translation entry specfied */
drivers/xen/scsifront/scsifront.c +0 -1
@@ -146,7 +146,6 @@ static void scsifront_cdb_cmd_done(strucscsifront_gnttab_done (&info->shadow[id], id);add_id_to_freelist (info, id); -rmb ();if (atomic_read (&info->abort_reset_cond) ==VSCSI_IN_RESET ) { sc->result = (DID_RESET <<16 ); }else {
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel