All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix uninitialized variable error in scsi_io_completion
@ 2008-12-15 15:31 Alan Stern
  2008-12-15 15:46 ` Boaz Harrosh
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Stern @ 2008-12-15 15:31 UTC (permalink / raw)
  To: James Bottomley; +Cc: SCSI development list

This patch (as1191) adds a missing "default" case in
scsi_io_completion(), thereby fixing an "uninitialized variable"
error.  It also adds a missing newline to a log entry.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>

---

James, I'm shocked!  :-)   Didn't you ever try to compile your changes 
to this routine?

Alan Stern



Index: usb-2.6/drivers/scsi/scsi_lib.c
===================================================================
--- usb-2.6.orig/drivers/scsi/scsi_lib.c
+++ usb-2.6/drivers/scsi/scsi_lib.c
@@ -1024,6 +1024,10 @@ void scsi_io_completion(struct scsi_cmnd
 				case 0x09: /* self test in progress */
 					action = ACTION_DELAYED_RETRY;
 					break;
+				default:
+					description = "Device not ready";
+					action = ACTION_FAIL;
+					break;
 				}
 			} else {
 				description = "Device not ready";
@@ -1049,7 +1053,7 @@ void scsi_io_completion(struct scsi_cmnd
 		/* Give up and fail the remainder of the request */
 		if (!(req->cmd_flags & REQ_QUIET)) {
 			if (description)
-				scmd_printk(KERN_INFO, cmd, "%s",
+				scmd_printk(KERN_INFO, cmd, "%s\n",
 					    description);
 			scsi_print_result(cmd);
 			if (driver_byte(result) & DRIVER_SENSE)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix uninitialized variable error in scsi_io_completion
  2008-12-15 15:31 [PATCH] Fix uninitialized variable error in scsi_io_completion Alan Stern
@ 2008-12-15 15:46 ` Boaz Harrosh
  0 siblings, 0 replies; 2+ messages in thread
From: Boaz Harrosh @ 2008-12-15 15:46 UTC (permalink / raw)
  To: Alan Stern; +Cc: James Bottomley, SCSI development list

Alan Stern wrote:
> This patch (as1191) adds a missing "default" case in
> scsi_io_completion(), thereby fixing an "uninitialized variable"
> error.  It also adds a missing newline to a log entry.
> 
> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
> 
> ---
> 
> James, I'm shocked!  :-)   Didn't you ever try to compile your changes 
> to this routine?
> 
> Alan Stern
> 
> 
> 
> Index: usb-2.6/drivers/scsi/scsi_lib.c
> ===================================================================
> --- usb-2.6.orig/drivers/scsi/scsi_lib.c
> +++ usb-2.6/drivers/scsi/scsi_lib.c
> @@ -1024,6 +1024,10 @@ void scsi_io_completion(struct scsi_cmnd
>  				case 0x09: /* self test in progress */
>  					action = ACTION_DELAYED_RETRY;
>  					break;
> +				default:
> +					description = "Device not ready";
> +					action = ACTION_FAIL;
> +					break;
>  				}
>  			} else {
>  				description = "Device not ready";
> @@ -1049,7 +1053,7 @@ void scsi_io_completion(struct scsi_cmnd
>  		/* Give up and fail the remainder of the request */
>  		if (!(req->cmd_flags & REQ_QUIET)) {
>  			if (description)
> -				scmd_printk(KERN_INFO, cmd, "%s",
> +				scmd_printk(KERN_INFO, cmd, "%s\n",
>  					    description);
>  			scsi_print_result(cmd);
>  			if (driver_byte(result) & DRIVER_SENSE)
> 
> --

Good catch, I saw the warning but failed to see the missing case.
I attributed it to my brain dead gcc version.

Boaz
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-15 15:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-15 15:31 [PATCH] Fix uninitialized variable error in scsi_io_completion Alan Stern
2008-12-15 15:46 ` Boaz Harrosh

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.