From patchwork Wed May 28 14:43:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Finn Thain X-Patchwork-Id: 4256201 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 55CB79F336 for ; Wed, 28 May 2014 14:48:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60F0E2026C for ; Wed, 28 May 2014 14:48:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6A09F20266 for ; Wed, 28 May 2014 14:48:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wpf6U-00014p-HL; Wed, 28 May 2014 14:45:18 +0000 Received: from kvm5.telegraphics.com.au ([98.124.60.144]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wpf6Q-0008PW-Bl for linux-arm-kernel@lists.infradead.org; Wed, 28 May 2014 14:45:16 +0000 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id BFB41285DC; Wed, 28 May 2014 10:44:48 -0400 (EDT) Date: Thu, 29 May 2014 00:43:43 +1000 (EST) From: Finn Thain To: Christoph Hellwig Subject: [PATCH] scsi/NCR5380: dprintk macro Message-ID: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140528_074514_533139_3D1785CD X-CRM114-Status: GOOD ( 10.16 ) X-Spam-Score: -0.7 (/) Cc: Sam Creasey , linux-m68k@vger.kernel.org, Russell King , linux-scsi@vger.kernel.org, Michael Schmitz , linux-kernel@vger.kernel.org, "James E.J. Bottomley" , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- I know the whitespace is wrong throughout these drivers but when I put this patch series together it seemed best to defer the whitespace cleanup. (I still intend to do that cleanup.) diff -ru v1/drivers/scsi/NCR5380.h v2/drivers/scsi/NCR5380.h --- v1/drivers/scsi/NCR5380.h 2014-05-29 00:07:28.525627086 +1000 +++ v2/drivers/scsi/NCR5380.h 2014-05-29 00:06:41.335557873 +1000 @@ -295,9 +295,10 @@ #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 @@ 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 diff -ru v1/drivers/scsi/sun3_NCR5380.c v2/drivers/scsi/sun3_NCR5380.c --- v1/drivers/scsi/sun3_NCR5380.c 2014-05-29 00:07:28.525627086 +1000 +++ v2/drivers/scsi/sun3_NCR5380.c 2014-05-29 00:06:41.355557902 +1000 @@ -1006,12 +1006,8 @@ 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 (