From: Christophe Lucas <clucas@rotomalug.org>
Subject: [KJ] [PATCH] printk : drivers/block/cciss.c


printk() calls should include appropriate KERN_* constant.

Signed-off-by: Christophe Lucas <clucas@rotomalug.org>
Signed-off-by: Domen Puncer <domen@coderock.org>
---
 cciss.c |   69 ++++++++++++++++++++++++++++++----------------------------------
 1 files changed, 33 insertions(+), 36 deletions(-)

Index: quilt/drivers/block/cciss.c
===================================================================
--- quilt.orig/drivers/block/cciss.c
+++ quilt/drivers/block/cciss.c
@@ -1541,9 +1541,6 @@ static int register_new_disk(ctlr_info_t
 
 	if( return_code == IO_OK)
 	{
-		
-		// printk("LUN Data\n--------------------------\n");
-
 		listlength |= (0xff & (unsigned int)(ld_buff->LUNListLength[0])) << 24;
 		listlength |= (0xff & (unsigned int)(ld_buff->LUNListLength[1])) << 16;
 		listlength |= (0xff & (unsigned int)(ld_buff->LUNListLength[2])) << 8;	
@@ -1579,7 +1576,7 @@ static int register_new_disk(ctlr_info_t
 		for(j=0; j <= h->highest_lun; j++)
 		{
 #ifdef CCISS_DEBUG
-			printk("Checking %d %x against %x\n", j,h->drv[j].LunID,
+			printk(KERN_DEBUG "Checking %d %x against %x\n", j,h->drv[j].LunID,
 						lunid);
 #endif /* CCISS_DEBUG */
 			if (h->drv[j].LunID == lunid)
@@ -1594,7 +1591,7 @@ static int register_new_disk(ctlr_info_t
 		else
 		{	/* It is the new lun we have been looking for */
 #ifdef CCISS_DEBUG
-			printk("new lun found at %d\n", i);
+			printk(KERN_DEBUG "new lun found at %d\n", i);
 #endif /* CCISS_DEBUG */
 			new_lun_index = i;
 			new_lun_found = 1;
@@ -1610,12 +1607,12 @@ static int register_new_disk(ctlr_info_t
 	for(i=0; i <CISS_MAX_LUN; i++)
 	{
 #ifdef CCISS_DEBUG
-		printk("Checking Index %d\n", i);
+		printk(KERN_DEBUG "Checking Index %d\n", i);
 #endif /* CCISS_DEBUG */
 		if(h->drv[i].LunID == 0)
 		{
 #ifdef CCISS_DEBUG
-			printk("free index found at %d\n", i);
+			printk(KERN_DEBUG "free index found at %d\n", i);
 #endif /* CCISS_DEBUG */
 			free_index_found = 1;
 			free_index = i;
@@ -2066,7 +2063,7 @@ static inline void complete_command( ctl
 	complete_buffers(cmd->rq->bio, status);
 
 #ifdef CCISS_DEBUG
-	printk("Done with %p\n", cmd->rq);
+	printk(KERN_DEBUG "Done with %p\n", cmd->rq);
 #endif /* CCISS_DEBUG */ 
 
 	end_that_request_last(cmd->rq);
@@ -2293,31 +2290,31 @@ static void print_cfg_table( CfgTable_st
 	int i;
 	char temp_name[17];
 
-	printk("Controller Configuration information\n");
-	printk("------------------------------------\n");
+	printk(KERN_DEBUG "Controller Configuration information\n");
+	printk(KERN_DEBUG "------------------------------------\n");
 	for(i=0;i<4;i++)
 		temp_name[i] = readb(&(tb->Signature[i]));
 	temp_name[4]='\0';
-	printk("   Signature = %s\n", temp_name); 
-	printk("   Spec Number = %d\n", readl(&(tb->SpecValence)));
-	printk("   Transport methods supported = 0x%x\n", 
+	printk(KERN_DEBUG "   Signature = %s\n", temp_name);
+	printk(KERN_DEBUG "   Spec Number = %d\n", readl(&(tb->SpecValence)));
+	printk(KERN_DEBUG "   Transport methods supported = 0x%x\n",
 				readl(&(tb-> TransportSupport)));
-	printk("   Transport methods active = 0x%x\n", 
+	printk(KERN_DEBUG "   Transport methods active = 0x%x\n",
 				readl(&(tb->TransportActive)));
-	printk("   Requested transport Method = 0x%x\n", 
+	printk(KERN_DEBUG "   Requested transport Method = 0x%x\n",
 			readl(&(tb->HostWrite.TransportRequest)));
-	printk("   Coalese Interrupt Delay = 0x%x\n", 
+	printk(KERN_DEBUG "   Coalese Interrupt Delay = 0x%x\n",
 			readl(&(tb->HostWrite.CoalIntDelay)));
-	printk("   Coalese Interrupt Count = 0x%x\n", 
+	printk(KERN_DEBUG "   Coalese Interrupt Count = 0x%x\n",
 			readl(&(tb->HostWrite.CoalIntCount)));
-	printk("   Max outstanding commands = 0x%d\n", 
+	printk(KERN_DEBUG "   Max outstanding commands = 0x%d\n",
 			readl(&(tb->CmdsOutMax)));
-	printk("   Bus Types = 0x%x\n", readl(&(tb-> BusTypes)));
+	printk(KERN_DEBUG "   Bus Types = 0x%x\n", readl(&(tb-> BusTypes)));
 	for(i=0;i<16;i++)
 		temp_name[i] = readb(&(tb->ServerName[i]));
 	temp_name[16] = '\0';
-	printk("   Server Name = %s\n", temp_name);
-	printk("   Heartbeat Counter = 0x%x\n\n\n", 
+	printk(KERN_DEBUG "   Server Name = %s\n", temp_name);
+	printk(KERN_DEBUG "   Heartbeat Counter = 0x%x\n\n\n",
 			readl(&(tb->HeartBeat)));
 }
 #endif /* CCISS_DEBUG */ 
@@ -2410,7 +2407,7 @@ static int cciss_pci_init(ctlr_info_t *c
 			c->io_mem_length = pci_resource_end(pdev, i) -
 				pci_resource_start(pdev, i) +1;
 #ifdef CCISS_DEBUG
-			printk("IO value found base_addr[%d] %lx %lx\n", i,
+			printk(KERN_DEBUG "IO value found base_addr[%d] %lx %lx\n", i,
 				c->io_mem_addr, c->io_mem_length);
 #endif /* CCISS_DEBUG */
 			/* register the IO range */ 
@@ -2427,9 +2424,9 @@ static int cciss_pci_init(ctlr_info_t *c
 	}
 
 #ifdef CCISS_DEBUG
-	printk("command = %x\n", command);
-	printk("irq = %x\n", pdev->irq);
-	printk("board_id = %x\n", board_id);
+	printk(KERN_DEBUG "command = %x\n", command);
+	printk(KERN_DEBUG "irq = %x\n", pdev->irq);
+	printk(KERN_DEBUG "board_id = %x\n", board_id);
 #endif /* CCISS_DEBUG */ 
 
 	c->intr = pdev->irq;
@@ -2441,7 +2438,7 @@ static int cciss_pci_init(ctlr_info_t *c
 
 	c->paddr = pci_resource_start(pdev, 0); /* addressing mode bits already removed */
 #ifdef CCISS_DEBUG
-	printk("address 0 = %x\n", c->paddr);
+	printk(KERN_DEBUG "address 0 = %x\n", c->paddr);
 #endif /* CCISS_DEBUG */ 
 	c->vaddr = remap_pci_mem(c->paddr, 200);
 
@@ -2463,12 +2460,12 @@ static int cciss_pci_init(ctlr_info_t *c
 	cfg_base_addr = readl(c->vaddr + SA5_CTCFG_OFFSET);
 	cfg_base_addr &= (__u32) 0x0000ffff;
 #ifdef CCISS_DEBUG
-	printk("cfg base address = %x\n", cfg_base_addr);
+	printk(KERN_DEBUG "cfg base address = %x\n", cfg_base_addr);
 #endif /* CCISS_DEBUG */
 	cfg_base_addr_index =
 		find_PCI_BAR_index(pdev, cfg_base_addr);
 #ifdef CCISS_DEBUG
-	printk("cfg base address index = %x\n", cfg_base_addr_index);
+	printk(KERN_DEBUG "cfg base address index = %x\n", cfg_base_addr_index);
 #endif /* CCISS_DEBUG */
 	if (cfg_base_addr_index == -1) {
 		printk(KERN_WARNING "cciss: Cannot find cfg_base_addr_index\n");
@@ -2478,7 +2475,7 @@ static int cciss_pci_init(ctlr_info_t *c
 
 	cfg_offset = readl(c->vaddr + SA5_CTMEM_OFFSET);
 #ifdef CCISS_DEBUG
-	printk("cfg offset = %x\n", cfg_offset);
+	printk(KERN_DEBUG "cfg offset = %x\n", cfg_offset);
 #endif /* CCISS_DEBUG */
 	c->cfgtable =  remap_pci_mem(pci_resource_start(pdev,
 				cfg_base_addr_index) + cfg_offset,
@@ -2507,7 +2504,7 @@ static int cciss_pci_init(ctlr_info_t *c
 	      (readb(&c->cfgtable->Signature[2]) != 'S') ||
 	      (readb(&c->cfgtable->Signature[3]) != 'S') )
 	{
-		printk("Does not appear to be a valid CISS config table\n");
+		printk(KERN_WARNING "Does not appear to be a valid CISS config table\n");
 		return -1;
 	}
 
@@ -2522,7 +2519,7 @@ static int cciss_pci_init(ctlr_info_t *c
 #endif
 
 #ifdef CCISS_DEBUG
-	printk("Trying to put board into Simple mode\n");
+	printk(KERN_DEBUG "Trying to put board into Simple mode\n");
 #endif /* CCISS_DEBUG */ 
 	c->max_commands = readl(&(c->cfgtable->CmdsOutMax));
 	/* Update the field, and then ring the doorbell */ 
@@ -2615,7 +2612,7 @@ static void cciss_getgeometry(int cntl_n
 	if( return_code == IO_OK)
 	{
 #ifdef CCISS_DEBUG
-		printk("LUN Data\n--------------------------\n");
+		printk(KERN_DEBUG "LUN Data\n--------------------------\n");
 #endif /* CCISS_DEBUG */ 
 
 		listlength |= (0xff & (unsigned int)(ld_buff->LUNListLength[0])) << 24;
@@ -2744,11 +2741,11 @@ static int __devinit cciss_init_one(stru
 
 	/* configure PCI DMA stuff */
 	if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK))
-		printk("cciss: using DAC cycles\n");
+		printk(KERN_INFO "cciss: using DAC cycles\n");
 	else if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK))
-		printk("cciss: not using DAC cycles\n");
+		printk(KERN_INFO "cciss: not using DAC cycles\n");
 	else {
-		printk("cciss: no suitable DMA available\n");
+		printk(KERN_INFO "cciss: no suitable DMA available\n");
 		goto clean1;
 	}
 
@@ -2885,7 +2882,7 @@ static void __devexit cciss_remove_one (
 
 	if (pci_get_drvdata(pdev) == NULL)
 	{
-		printk( KERN_ERR "cciss: Unable to remove device \n");
+		printk(KERN_ERR "cciss: Unable to remove device \n");
 		return;
 	}
 	tmp_ptr = pci_get_drvdata(pdev);
