public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* sddr09: don't hide real errors in debug prints
@ 2004-10-04 16:13 Pavel Machek
  2004-10-04 19:14 ` Andries Brouwer
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Machek @ 2004-10-04 16:13 UTC (permalink / raw)
  To: Andrew Morton, kernel list, Rusty trivial patch monkey Russell,
	aeb

Hi!

sddr09 hides in debug prints. That seems wrong and this fixes
it. Please apply,
									Pavel

--- tmp/linux/drivers/usb/storage/sddr09.c	2004-10-01 00:30:20.000000000 +0200
+++ linux/drivers/usb/storage/sddr09.c	2004-10-01 00:47:53.000000000 +0200
@@ -370,7 +371,7 @@
 	result = sddr09_send_scsi_command(us, command, 12);
 
 	if (result != USB_STOR_TRANSPORT_GOOD) {
-		US_DEBUGP("Result for send_control in sddr09_read2%d %d\n",
+		printk(KERN_WARNING "Error in send_control in sddr09_read2%d %d\n",
 			  x, result);
 		return result;
 	}
@@ -379,7 +380,7 @@
 				       buf, bulklen, use_sg, NULL);
 
 	if (result != USB_STOR_XFER_GOOD) {
-		US_DEBUGP("Result for bulk_transfer in sddr09_read2%d %d\n",
+		printk(KERN_WARNING "Error in bulk_transfer in sddr09_read2%d %d\n",
 			  x, result);
 		return USB_STOR_TRANSPORT_ERROR;
 	}
@@ -498,7 +499,7 @@
 	result = sddr09_send_scsi_command(us, command, 12);
 
 	if (result != USB_STOR_TRANSPORT_GOOD)
-		US_DEBUGP("Result for send_control in sddr09_erase %d\n",
+		printk(KERN_WARNING "Error in send_control in sddr09_erase %d\n",
 			  result);
 
 	return result;
@@ -556,7 +557,7 @@
 	result = sddr09_send_scsi_command(us, command, 12);
 
 	if (result != USB_STOR_TRANSPORT_GOOD) {
-		US_DEBUGP("Result for send_control in sddr09_writeX %d\n",
+		printk(KERN_WARNING "Error in send_control in sddr09_writeX %d\n",
 			  result);
 		return result;
 	}
@@ -565,7 +566,7 @@
 				       buf, bulklen, use_sg, NULL);
 
 	if (result != USB_STOR_XFER_GOOD) {
-		US_DEBUGP("Result for bulk_transfer in sddr09_writeX %d\n",
+		printk(KERN_WARNING "Error in bulk_transfer in sddr09_writeX %d\n",
 			  result);
 		return USB_STOR_TRANSPORT_ERROR;
 	}
@@ -634,7 +635,7 @@
 	result = sddr09_send_scsi_command(us, command, 4*nsg+3);
 
 	if (result != USB_STOR_TRANSPORT_GOOD) {
-		US_DEBUGP("Result for send_control in sddr09_read_sg %d\n",
+		printk(KERN_WARNING "Error in send_control in sddr09_read_sg %d\n",
 			  result);
 		return result;
 	}
@@ -647,7 +648,7 @@
 				       buf, bulklen, NULL);
 	kfree(buf);
 	if (result != USB_STOR_XFER_GOOD) {
-		US_DEBUGP("Result for bulk_transfer in sddr09_read_sg %d\n",
+		printk(KERN_WARNING "Error in bulk_transfer in sddr09_read_sg %d\n",
 			  result);
 		return USB_STOR_TRANSPORT_ERROR;
 	}
@@ -710,7 +711,7 @@
 	len = min(sectors, (unsigned int) info->blocksize) * info->pagesize;
 	buffer = kmalloc(len, GFP_NOIO);
 	if (buffer == NULL) {
-		printk("sddr09_read_data: Out of memory\n");
+		printk(KERN_ERR "sddr09_read_data: Out of memory\n");
 		return USB_STOR_TRANSPORT_ERROR;
 	}
 

-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

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

* Re: sddr09: don't hide real errors in debug prints
  2004-10-04 16:13 sddr09: don't hide real errors in debug prints Pavel Machek
@ 2004-10-04 19:14 ` Andries Brouwer
  0 siblings, 0 replies; 2+ messages in thread
From: Andries Brouwer @ 2004-10-04 19:14 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Andrew Morton, kernel list, Rusty trivial patch monkey Russell,
	Andries.Brouwer

On Mon, Oct 04, 2004 at 06:13:51PM +0200, Pavel Machek wrote:

> sddr09 hides in debug prints. That seems wrong and this fixes
> it. Please apply,
> 									Pavel
> 
> --- tmp/linux/drivers/usb/storage/sddr09.c	2004-10-01 00:30:20.000000000 +0200
> +++ linux/drivers/usb/storage/sddr09.c	2004-10-01 00:47:53.000000000 +0200
> @@ -370,7 +371,7 @@
>  	result = sddr09_send_scsi_command(us, command, 12);
>  
>  	if (result != USB_STOR_TRANSPORT_GOOD) {
> -		US_DEBUGP("Result for send_control in sddr09_read2%d %d\n",
> +		printk(KERN_WARNING "Error in send_control in sddr09_read2%d %d\n",
>  			  x, result);
>  		return result;
>  	}

Hmm. I have no serious objections -- this is just a little kernel bloat,
but on the other hand, I don't see the point. Why do you want a printk
when some intermediate routine passes an error from a lower level
to a higher level?

When debugging that may be useful. But otherwise?


Andries

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

end of thread, other threads:[~2004-10-04 19:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-04 16:13 sddr09: don't hide real errors in debug prints Pavel Machek
2004-10-04 19:14 ` Andries Brouwer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox