From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSv31-0004uc-GJ for qemu-devel@nongnu.org; Mon, 08 Feb 2016 18:16:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSv30-0004IV-O3 for qemu-devel@nongnu.org; Mon, 08 Feb 2016 18:16:47 -0500 References: <1454971529-14830-1-git-send-email-jsnow@redhat.com> <56B92088.6050807@redhat.com> From: John Snow Message-ID: <56B921D5.7070104@redhat.com> Date: Mon, 8 Feb 2016 18:16:37 -0500 MIME-Version: 1.0 In-Reply-To: <56B92088.6050807@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] fdc: always compile-check debug prints List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-block@nongnu.org Cc: qemu-devel@nongnu.org On 02/08/2016 06:11 PM, Eric Blake wrote: > On 02/08/2016 03:45 PM, John Snow wrote: >> Coverity noticed that some variables are only used by debug prints, and >> called them unused. Always compile the print statements. >> >> Bonus: Fix a printf I broke. > > Might be nice to mention the commit that broke it. > Sure. >> >> Signed-off-by: John Snow >> --- >> hw/block/fdc.c | 15 ++++++++------- >> 1 file changed, 8 insertions(+), 7 deletions(-) >> > >> #define FLOPPY_DPRINTF(fmt, ...) \ >> - do { printf("FLOPPY: " fmt , ## __VA_ARGS__); } while (0) >> -#else >> -#define FLOPPY_DPRINTF(fmt, ...) >> -#endif >> + do { \ >> + if (DEBUG_FLOPPY) { \ >> + fprintf(stderr, "FLOPPY: " fmt , ## __VA_ARGS__); \ > > The switch from stdout to stderr doesn't hurt, either, if you want to > mention it in the commit as intentional. > Sure 2x combo > Reviewed-by: Eric Blake > Thanks!