]> git.karo-electronics.de Git - linux-beck.git/commitdiff
scsi/NCR5380: dprintk macro
authorFinn Thain <fthain@telegraphics.com.au>
Wed, 28 May 2014 14:43:43 +0000 (00:43 +1000)
committerChristoph Hellwig <hch@lst.de>
Wed, 28 May 2014 16:14:16 +0000 (18:14 +0200)
This is the delta between the two submissions:
[PATCH 00/12] scsi/NCR5380: fix debugging macros and #include structure
and
[PATCH v2 00/12] scsi/NCR5380: fix debugging macros and #include structure

The macro definition changes were discussed on the mailing list during
review. The idea is to get the compiler to check the parameters of
disabled printk() calls so that the debugging code doesn't rot again.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/NCR5380.h
drivers/scsi/sun3_NCR5380.c

index 1541c62ddf5f81733fd91472cb80d0bbdd8b225b..c79ddfa6f53c52d58ab814846fb5023ed821bf4a 100644 (file)
@@ -295,9 +295,10 @@ struct NCR5380_hostdata {
 #define NDEBUG (0)
 #endif
 
+#define dprintk(flg, fmt, ...) \
+       do { if ((NDEBUG) & (flg)) pr_debug(fmt, ## __VA_ARGS__); } while (0)
+
 #if NDEBUG
-#define dprintk(flg, fmt, args...) \
-       do { if ((NDEBUG) & (flg)) pr_debug(fmt, ## args); } while (0)
 #define NCR5380_dprint(flg, arg) \
        do { if ((NDEBUG) & (flg)) NCR5380_print(arg); } while (0)
 #define NCR5380_dprint_phase(flg, arg) \
@@ -305,7 +306,6 @@ struct NCR5380_hostdata {
 static void NCR5380_print_phase(struct Scsi_Host *instance);
 static void NCR5380_print(struct Scsi_Host *instance);
 #else
-#define dprintk(flg, fmt, args...)     do {} while (0)
 #define NCR5380_dprint(flg, arg)       do {} while (0)
 #define NCR5380_dprint_phase(flg, arg) do {} while (0)
 #endif
index 61a2c101b4bc8fe9365e0a141aab013a245a5536..88220794cc986c07e8f3289f3222ef1bf1900922 100644 (file)
@@ -1006,12 +1006,8 @@ static void NCR5380_main (struct work_struct *bl)
            for (tmp = (struct scsi_cmnd *) hostdata->issue_queue,
                 prev = NULL; tmp; prev = tmp, tmp = NEXT(tmp) ) {
 
-#if (NDEBUG & NDEBUG_LISTS)
                if (prev != tmp)
-                   printk("MAIN tmp=%p   target=%d   busy=%d lun=%d\n",
-                          tmp, tmp->target, hostdata->busy[tmp->target],
-                          tmp->lun);
-#endif
+                       dprintk(NDEBUG_LISTS, "MAIN tmp=%p   target=%d   busy=%d lun=%d\n", tmp, tmp->device->id, hostdata->busy[tmp->device->id], tmp->device->lun);
                /*  When we find one, remove it from the issue queue. */
                /* ++guenther: possible race with Falcon locking */
                if (