Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16b9d870 authored by Finn Thain's avatar Finn Thain Committed by Christoph Hellwig
Browse files

scsi/NCR5380: dprintk macro



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: default avatarFinn Thain <fthain@telegraphics.com.au>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent a48ac9e5
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -295,9 +295,10 @@ struct NCR5380_hostdata {
#define NDEBUG (0)
#define NDEBUG (0)
#endif
#endif


#define dprintk(flg, fmt, ...) \
	do { if ((NDEBUG) & (flg)) pr_debug(fmt, ## __VA_ARGS__); } while (0)

#if NDEBUG
#if NDEBUG
#define dprintk(flg, fmt, args...) \
	do { if ((NDEBUG) & (flg)) pr_debug(fmt, ## args); } while (0)
#define NCR5380_dprint(flg, arg) \
#define NCR5380_dprint(flg, arg) \
	do { if ((NDEBUG) & (flg)) NCR5380_print(arg); } while (0)
	do { if ((NDEBUG) & (flg)) NCR5380_print(arg); } while (0)
#define NCR5380_dprint_phase(flg, arg) \
#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_phase(struct Scsi_Host *instance);
static void NCR5380_print(struct Scsi_Host *instance);
static void NCR5380_print(struct Scsi_Host *instance);
#else
#else
#define dprintk(flg, fmt, args...)     do {} while (0)
#define NCR5380_dprint(flg, arg)       do {} while (0)
#define NCR5380_dprint(flg, arg)       do {} while (0)
#define NCR5380_dprint_phase(flg, arg) do {} while (0)
#define NCR5380_dprint_phase(flg, arg) do {} while (0)
#endif
#endif
+1 −5
Original line number Original line Diff line number Diff line
@@ -1006,12 +1006,8 @@ static void NCR5380_main (struct work_struct *bl)
	    for (tmp = (struct scsi_cmnd *) hostdata->issue_queue,
	    for (tmp = (struct scsi_cmnd *) hostdata->issue_queue,
		 prev = NULL; tmp; prev = tmp, tmp = NEXT(tmp) ) {
		 prev = NULL; tmp; prev = tmp, tmp = NEXT(tmp) ) {


#if (NDEBUG & NDEBUG_LISTS)
		if (prev != tmp)
		if (prev != tmp)
		    printk("MAIN tmp=%p   target=%d   busy=%d lun=%d\n",
			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);
			   tmp, tmp->target, hostdata->busy[tmp->target],
			   tmp->lun);
#endif
		/*  When we find one, remove it from the issue queue. */
		/*  When we find one, remove it from the issue queue. */
		/* ++guenther: possible race with Falcon locking */
		/* ++guenther: possible race with Falcon locking */
		if (
		if (