[patch 4/4] acorn: clean up printk()'s in drivers/acorn/block/mfmhd.c

[patch 4/4] acorn: clean up printk()'s in drivers/acorn/block/mfmhd.c

Post by dome » Mon, 07 Mar 2005 08:00:14


This patch puts KERN_ constants in printk()'s and makes the debugging printk()'s
more consistent in drivers/acorn/block/mfmhd.c

Signed-off-by: James Nelson < XXXX@XXXXX.COM >
Signed-off-by: Domen Puncer < XXXX@XXXXX.COM >
---


kj-domen/drivers/acorn/block/mfmhd.c | 151 +++++++++++++++--------------------
1 files changed, 66 insertions(+), 85 deletions(-)

diff -puN drivers/acorn/block/mfmhd.c~printk-drivers_acorn_block_mfmhd drivers/acorn/block/mfmhd.c
--- kj/drivers/acorn/block/mfmhd.c~printk-drivers_acorn_block_mfmhd 2005-03-05 16:11:44.000000000 +0100
+++ kj-domen/drivers/acorn/block/mfmhd.c 2005-03-05 16:11:44.000000000 +0100
@@ -98,6 +98,8 @@
* This would be a performance boost with dual drive systems.
*/

+#undef DEBUG /* define to enable debugging statements */
+
#include <linux/module.h>
#include <linux/config.h>
#include <linux/sched.h>
@@ -126,6 +128,7 @@ static void (*do_mfm)(void) = NULL;
static struct request_queue *mfm_queue;
static DEFINE_SPINLOCK(mfm_lock);

+#define PFX "mfm: "
#define MAJOR_NR MFM_ACORN_MAJOR
#define QUEUE (mfm_queue)
#define CURRENT elv_next_request(mfm_queue)
@@ -153,12 +156,7 @@ struct hd_geometry {
* Linux I/O address of onboard MFM controller or 0 to disable this
*/
#define ONBOARD_MFM_ADDRESS ((0x002d0000 >> 2) | 0x80000000)
-/*
- * Uncomment this to enable debugging in the MFM driver...
- */
-#ifndef DEBUG
-/*#define DEBUG */
-#endif
+
/*
* End of configuration
*/
@@ -300,28 +298,8 @@ int number_mfm_drives = 1;
#define STAT_POL 0x0200 /* Polling */

/* ------------------------------------------------------------------------------------------ */
-#ifdef DEBUG
-static void console_printf(const char *fmt,...)
-{
- static char buffer[2048]; /* Arbitary! */
- extern void console_print(const char *);
- unsigned long flags;
- va_list ap;
-
- local_irq_save(flags);
-
- va_start(ap, fmt);
- vsprintf(buffer, fmt, ap);
- console_print(buffer);
- va_end(fmt);

- local_irq_restore(flags);
-}; /* console_printf */
-
-#define DBG(x...) console_printf(x)
-#else
-#define DBG(x...)
-#endif
+#define DBG(fmt, args...) pr_debug(PFX "%s(): " fmt, __FUNCTION__ , ## args)

static void print_status(void)
{
@@ -377,23 +355,23 @@ static void issue_command(int command, u
int status;
#ifdef DEBUG
int i;
- console_printf("issue_command: %02X: ", command);
+ DBG("%02X:", command);
for (i = 0; i < len; i++)
- console_printf("%02X ", cmdb[i]);
- console_printf("\n");
+ printk(" %02X", cmdb[i]);
+ printk("\n");
#endif

do {
status = inw(MFM_STATUS);
} while (status & (STAT_BSY | STAT_POL));
- DBG("issue_command: status after pol/bsy loop: %02X:\n ", status >> 8);
+ DBG("status after pol/bsy loop: %02X:\n", status >> 8);

if (status & (STAT_CPR | STAT_CED | STAT_SED | STAT_DER | STAT_ABN)) {
outw(CMD_RCAL, MFM_COMMAND);
while (inw(MFM_STATUS) & STAT_BSY);
}
status = inw(MFM_STATUS);
- DBG("issue_command: status before parameter issue: %02X:\n ", status >> 8);
+ DBG("status before parameter issue: %02X:\n", status >> 8);

while (len > 0) {
outw(cmdb[1] | (cmdb[0] << 8), MFM_DATAOUT);
@@ -401,11 +379,11 @@ static void issue_command(int command, u
cmdb += 2;
}
status = inw(MFM_STATUS);
- DBG("issue_command: status before command issue: %02X:\n ", status >> 8);
+ DBG("s