From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH v2 1/2] Avoid asprintf() which is not available on mingw
Date: Mon, 13 Aug 2012 13:05:43 +0200 [thread overview]
Message-ID: <1344855944-28250-2-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1344855944-28250-1-git-send-email-kraxel@redhat.com>
Use g_strdup_printf() instead.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/msix.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/msix.c b/hw/msix.c
index 800fc32..aea340b 100644
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -307,13 +307,9 @@ int msix_init_exclusive_bar(PCIDevice *dev, unsigned short nentries,
return -EINVAL;
}
- if (asprintf(&name, "%s-msix", dev->name) == -1) {
- return -ENOMEM;
- }
-
+ name = g_strdup_printf("%s-msix", dev->name);
memory_region_init(&dev->msix_exclusive_bar, name, MSIX_EXCLUSIVE_BAR_SIZE);
-
- free(name);
+ g_free(name);
ret = msix_init(dev, nentries, &dev->msix_exclusive_bar, bar_nr,
MSIX_EXCLUSIVE_BAR_TABLE_OFFSET, &dev->msix_exclusive_bar,
--
1.7.1
next prev parent reply other threads:[~2012-08-13 11:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-13 11:05 [Qemu-devel] [PATCH v2 0/2] two little build fixes Gerd Hoffmann
2012-08-13 11:05 ` Gerd Hoffmann [this message]
2012-08-13 19:31 ` [Qemu-devel] [PATCH v2 1/2] Avoid asprintf() which is not available on mingw Stefan Weil
2012-08-13 11:05 ` [Qemu-devel] [PATCH v2 2/2] scsi: fix warning Gerd Hoffmann
2012-08-18 20:03 ` [Qemu-devel] [PATCH v2 0/2] two little build fixes Blue Swirl
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=1344855944-28250-2-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--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).