qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] NBD cleanup
Date: Wed, 18 Jun 2008 02:08:37 -0500	[thread overview]
Message-ID: <20080618070837.GC1486@tapir> (raw)
In-Reply-To: <4851582E.6030404@codemonkey.ws>

[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]

On Thu, Jun 12, 2008 at 12:09:02PM -0500, Anthony Liguori wrote:
> Laurent Vivier wrote:
> >This patch removes include of malloc.h from qemu-nbd.c to make it
> >compile on OS X. (as reported by C.W. Betts and commented by Daniel P.
> >Berrange)
> >It adjusts a printf format in nbd.c.

this last snippet avoids the following warning on amd64 linux (and other LP64
platforms) :

  nbd.c: In function `nbd_trip':
  nbd.c:391: warning: unsigned int format, different type arg (arg 7)

but will trigger something similar in x86 linux (and other ILP32 platforms)
where sizeof returns unsigned instead.

to prevent this line to keep getting changed back and forth (as shown by r4676
and the two currently proposed patches that touch nbd) to avoid this warning;
casting it to unsigned long as suggested in the attached patch (to be applied
instead of this one) should be enough, if probably not that elegant.

> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

Reviewed-by: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe>

Carlo

[-- Attachment #2: qemu-nbd-cleanup.patch --]
[-- Type: text/plain, Size: 679 bytes --]

Index: nbd.c
===================================================================
--- nbd.c	(revision 4745)
+++ nbd.c	(working copy)
@@ -388,8 +388,8 @@
 	}
 
 	if (len > sizeof(data)) {
-		LOG("len (%u) is larger than max len (%u)",
-		    len, sizeof(data));
+		LOG("len (%u) is larger than max len (%lu)",
+		    len, (unsigned long)sizeof(data));
 		errno = EINVAL;
 		return -1;
 	}
Index: qemu-nbd.c
===================================================================
--- qemu-nbd.c	(revision 4745)
+++ qemu-nbd.c	(working copy)
@@ -21,7 +21,6 @@
 #include "block_int.h"
 #include "nbd.h"
 
-#include <malloc.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <getopt.h>

      reply	other threads:[~2008-06-18  6:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-07 12:24 [Qemu-devel] [PATCH] NBD cleanup Laurent Vivier
2008-06-12 17:09 ` Anthony Liguori
2008-06-18  7:08   ` Carlo Marcelo Arenas Belon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080618070837.GC1486@tapir \
    --to=carenas@sajinet.com.pe \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).