Skip to contentSkip to conversation

drivers/block/acsi.c: Add KERN_* to printk statements

PATCH In review Richard 2 participants 4 messages Jul 31, 2006

Subsystems (2)
lore
Share & tools
lore

Richard

author
#0 lore raw

PATCH 1/1 drivers/block/acsi.c: Add KERN_* to printk statements

Add KERN_* to printk statements

---

drivers/block/acsi.c +8 -8
@@ -480,7 +480,7 @@
 
 #ifdef NO_WRITE
 	if (rwflag || *cmd = 0x0a) {
-		printk( "ACSI: Write commands disabled!\n" );
+		printk( KERN_INFO "ACSI: Write commands disabled!\n" );
 		return( 0 );
 	}
 #endif
@@ -622,7 +622,7 @@
 		status = dma_wd.fdc_acces_seccount;
 		if (status != 0xff) break;
 #ifdef DEBUG
-		printk("ACSI: skipping 0xff status byte\n" );
+		printk( KERN_DEBUG "ACSI: skipping 0xff status byte\n" );
 #endif
 		udelay(40);
 		acsi_wait_for_noIRQ( 20 );
@@ -972,7 +972,7 @@
 	block = CURRENT->sector;
 	if (block+CURRENT->nr_sectors >= get_capacity(disk)) {
 #ifdef DEBUG
-		printk( "%s: attempted access for blocks %d...%ld past end of device at block %ld.\n",
+		printk( KERN_DEBUG "%s: attempted access for blocks %d...%ld past end of device at block %ld.\n",
 		       disk->disk_name,
 		       block, block + CURRENT->nr_sectors - 1,
 		       get_capacity(disk));
@@ -1305,7 +1305,7 @@
 
 #ifdef DEBUG
 		{	int i;
-		printk( "Mode sense data for ACSI target %d, lun %d seem not valid:",
+		printk( KERN_DEBUG "Mode sense data for ACSI target %d, lun %d seem not valid:",
 				target, lun );
 		for( i = 0; i < sizeof(SENSE_DATA); ++i )
 			printk( "%02x ", (unsigned char)acsi_buffer[i] );
@@ -1423,7 +1423,7 @@
 	if (!acsicmd_nodma(tur_cmd, 0)) {
 		/* timed out -> no device here */
 #ifdef DEBUG_DETECT
-		printk("target %d lun %d: timeout\n", aip->target, aip->lun);
+		printk( KERN_DEBUG "target %d lun %d: timeout\n", aip->target, aip->lun);
 #endif
 		return DEV_NONE;
 	}
@@ -1470,7 +1470,7 @@
 			if (extsense != UNIT_ATTENTION &&
 			    extsense != NOT_READY) {
 #ifdef DEBUG_DETECT
-				printk("target %d lun %d: extended sense %d\n",
+				printk( KERN_DEBUG "target %d lun %d: extended sense %d\n",
 				       aip->target, aip->lun, extsense);
 #endif
 				return DEV_UNKNOWN;
@@ -1479,7 +1479,7 @@
 		else {
 			if (reqsense & 0x7f) {
 #ifdef DEBUG_DETECT
-				printk("target %d lun %d: sense %d\n",
+				printk( KERN_DEBUG "target %d lun %d: sense %d\n",
 				       aip->target, aip->lun, reqsense);
 #endif
 				return DEV_UNKNOWN;
@@ -1489,7 +1489,7 @@
 	else 
 		if (reqsense = 0x4) {	/* SH204 Bug workaround */
 #ifdef DEBUG_DETECT
-			printk("target %d lun %d status=0 sense=4\n",
+			printk( KERN_DEBUG "target %d lun %d status=0 sense=4\n",
 			       aip->target, aip->lun);
 #endif
 			return DEV_UNKNOWN;

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw

Re: [KJ] [PATCH] drivers/block/acsi.c: Add KERN_* to printk

On 31/07/06 02:22 +0200, Richard wrote:
...

drivers/block/acsi.c line 626

Quoted 4 lines

#ifdef DEBUG

drivers/block/acsi.c +1 -1
-		printk("ACSI: skipping 0xff status byte\n" );
+		printk( KERN_DEBUG "ACSI: skipping 0xff status byte\n" );
 #endif

This looks like a perfect example of where pr_debug can be used.

drivers/block/acsi.c line 1427

Quoted 4 lines

#ifdef DEBUG_DETECT

drivers/block/acsi.c +1 -1
-		printk("target %d lun %d: timeout\n", aip->target, aip->lun);
+		printk( KERN_DEBUG "target %d lun %d: timeout\n", aip->target, aip->lun);
 #endif

Unfortunately this one doesn't fit so much with pr_debug :-(

Domen
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#2 lore raw

Re: [KJ] [PATCH] drivers/block/acsi.c: Add KERN_* to printk

In reply to Richard
Quoted 8 lines

van: Domen Puncer <[email protected]>
datum: 2006/07/31 Mon AM 07:38:16 CEST
aan: Richard <[email protected]>
cc: kj <[email protected]>
onderwerp: Re: [KJ] [PATCH] drivers/block/acsi.c: Add KERN_* to printk statements

Quoted 9 lines

On 31/07/06 02:22 +0200, Richard wrote:
...

drivers/block/acsi.c line 626

Quoted 4 lines

#ifdef DEBUG

drivers/block/acsi.c +1 -1
-		printk("ACSI: skipping 0xff status byte\n" );
+		printk( KERN_DEBUG "ACSI: skipping 0xff status byte\n" );
 #endif

This looks like a perfect example of where pr_debug can be used.

Is this prefered above the situation above?

Quoted 6 lines

drivers/block/acsi.c line 1427

Quoted 4 lines

#ifdef DEBUG_DETECT

drivers/block/acsi.c +1 -1
-		printk("target %d lun %d: timeout\n", aip->target, aip->lun);
+		printk( KERN_DEBUG "target %d lun %d: timeout\n", aip->target, aip->lun);
 #endif

Unfortunately this one doesn't fit so much with pr_debug :-(

Unless the intent is to have more levels of debuging, you can change that to #ifdef DEBUG etc.

Richard

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#3 lore raw

Re: [KJ] [PATCH] drivers/block/acsi.c: Add KERN_* to printk

In reply to Richard
Quoted 18 lines · On 31/07/06 11:57 +0200, [email protected] wrote:
Quoted 8 lines

van: Domen Puncer <[email protected]>
datum: 2006/07/31 Mon AM 07:38:16 CEST
aan: Richard <[email protected]>
cc: kj <[email protected]>
onderwerp: Re: [KJ] [PATCH] drivers/block/acsi.c: Add KERN_* to printk statements

Quoted 9 lines

On 31/07/06 02:22 +0200, Richard wrote:
...

drivers/block/acsi.c line 626

Quoted 4 lines

#ifdef DEBUG

drivers/block/acsi.c +1 -1
-		printk("ACSI: skipping 0xff status byte\n" );
+		printk( KERN_DEBUG "ACSI: skipping 0xff status byte\n" );
 #endif

This looks like a perfect example of where pr_debug can be used.

Quoted 1 line

Is this prefered above the situation above?

Yes. It's shorter, no ugly ifdefs, and does the same thing.

Quoted 9 lines
Quoted 7 lines

drivers/block/acsi.c line 1427

Quoted 5 lines

#ifdef DEBUG_DETECT

drivers/block/acsi.c +1 -1
-		printk("target %d lun %d: timeout\n", aip->target, aip->lun);
+		printk( KERN_DEBUG "target %d lun %d: timeout\n", aip->target, aip->lun);
 #endif

Unfortunately this one doesn't fit so much with pr_debug :-(

Unless the intent is to have more levels of debuging, you can change that to #ifdef DEBUG etc.

It looks like there are more debugging levels.

Domen

Quoted 4 lines

Richard

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors