From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 20:55:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01FAC21C; Tue, 25 Mar 2014 20:55:31 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7B36533E; Tue, 25 Mar 2014 20:55:30 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2PKtOot062735 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 25 Mar 2014 13:55:24 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2PKtO5P062734; Tue, 25 Mar 2014 13:55:24 -0700 (PDT) (envelope-from jmg) Date: Tue, 25 Mar 2014 13:55:23 -0700 From: John-Mark Gurney To: Edward Tomasz Napierala Subject: Re: svn commit: r263740 - in head/sys: cam/ctl dev/iscsi Message-ID: <20140325205523.GA60889@funkthat.com> References: <201403251830.s2PIUvIu029793@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201403251830.s2PIUvIu029793@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 25 Mar 2014 13:55:24 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 20:55:31 -0000 Edward Tomasz Napierala wrote this message on Tue, Mar 25, 2014 at 18:30 +0000: > Author: trasz > Date: Tue Mar 25 18:30:57 2014 > New Revision: 263740 > URL: http://svnweb.freebsd.org/changeset/base/263740 > > Log: > Use a less unusual syntax in debug printfs. Just for reference, this is partly a bug fix... if { xxx } while (0) is two statements, and if you tried to use the macros as such: if (something) MACRO(param) else somethingelse; You would get a compile error: t.c:11: error: expected expression before 'else' Now it'll compile properly... Thanks for the fix! > @@ -98,29 +98,38 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO > &maxcmdsn_delta, 256, "Number of commands the initiator can send " > "without confirmation"); > > -#define CFISCSI_DEBUG(X, ...) \ > - if (debug > 1) { \ > - printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ > +#define CFISCSI_DEBUG(X, ...) \ > + do { \ > + if (debug > 1) { \ > + printf("%s: " X "\n", \ > + __func__, ## __VA_ARGS__); \ > + } \ > } while (0) > -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."