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

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

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


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

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


kj-domen/drivers/acorn/block/fd1772.c | 138 ++++++++++++++++------------------
1 files changed, 68 insertions(+), 70 deletions(-)

diff -puN drivers/acorn/block/fd1772.c~printk-drivers_acorn_block_fd1772 drivers/acorn/block/fd1772.c
--- kj/drivers/acorn/block/fd1772.c~printk-drivers_acorn_block_fd1772 2005-03-05 16:11:43.000000000 +0100
+++ kj-domen/drivers/acorn/block/fd1772.c 2005-03-05 16:11:43.000000000 +0100
@@ -124,6 +124,8 @@
* Minor parameter, name layouts for 2.4.x differences
*/

+#undef DEBUG /* define to enable debugging statements */
+
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/fcntl.h>
@@ -166,13 +168,6 @@
/* Ditto worries for Arc - DAG */
#define FD_MAX_UNITS 4
#define TRACKBUFFER 0
-/*#define DEBUG*/
-
-#ifdef DEBUG
-#define DPRINT(a) printk a
-#else
-#define DPRINT(a)
-#endif

static struct request_queue *floppy_queue;

@@ -181,6 +176,9 @@ static struct request_queue *floppy_queu
#define DEVICE_NAME "floppy"
#define QUEUE (floppy_queue)
#define CURRENT elv_next_request(floppy_queue)
+#define PFX DEVICE_NAME ": "
+
+#define DBG(fmt, args...) pr_debug(PFX "%s(): " fmt, __FUNCTION__ , ## args)

/* Disk types: DD */
static struct archy_disk_type {
@@ -241,9 +239,9 @@ extern volatile int fdc1772_fdc_int_done
void FDC1772_WRITE(int reg, unsigned char val)
{
if (reg == FDC1772REG_CMD) {
- DPRINT(("FDC1772_WRITE new command 0x%x @ %d\n", val,jiffies));
+ DBG("new command 0x%x @ %d\n", val,jiffies);
if (fdc1772_fdc_int_done) {
- DPRINT(("FDC1772_WRITE: Hmm fdc1772_fdc_int_done true - resetting\n"));
+ DBG("Hmm fdc1772_fdc_int_done true - resetting\n");
fdc1772_fdc_int_done = 0;
};
};
@@ -410,9 +408,7 @@ static void fd_select_side(int side)

static void fd_select_drive(int drive)
{
-#ifdef DEBUG
- printk("fd_select_drive:%d\n", drive);
-#endif
+ DBG("%d\n", drive);
/* Hmm - nowhere do we seem to turn the motor on - I'm going to do it here! */
oldlatch_aupdate(LATCHA_MOTOR | LATCHA_INUSE, 0);

@@ -435,7 +431,7 @@ static void fd_deselect(void)
{
unsigned long flags;

- DPRINT(("fd_deselect\n"));
+ DBG("start\n");

oldlatch_aupdate(LATCHA_FDSELALL | LATCHA_MOTOR | LATCHA_INUSE, 0xf | LATCHA_MOTOR | LATCHA_INUSE);

@@ -475,7 +471,7 @@ static void fd_motor_off_timer(unsigned
* off on the Arc, since the motor control is actually on
* Latch A
*/
- DPRINT(("fdc1772: deselecting in fd_motor_off_timer\n"));
+ DBG("deselecting\n");
fd_deselect();
MotorOn = 0;
restore_flags(flags);
@@ -524,7 +520,7 @@ static void check_change(unsigned long d
/* The idea here is that if the write protect line has changed then
the disc must have changed */
if (stat != unit[drive].wpstat) {
- DPRINT(("wpstat[%d] = %d\n", drive, stat));
+ DBG("wpstat[%d] = %d\n", drive, stat);
unit[drive].wpstat = stat;
set_bit(drive, &changed_floppies);
}
@@ -580,12 +576,13 @@ static void floppy_irqconsequencehandler
if (handler) {
nop();
status = (unsigned char) fdc1772_comendstatus;
- DPRINT(("FDC1772 irq, status = %02x handler = %08lx\n", (unsigned int) status, (unsigne