qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/2] two little build fixes
@ 2012-08-13 11:05 Gerd Hoffmann
  2012-08-13 11:05 ` [Qemu-devel] [PATCH v2 1/2] Avoid asprintf() which is not available on mingw Gerd Hoffmann
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2012-08-13 11:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

  Hi,

Patch #1 uses g_strdup_printf now, #2 is unchanged.

cheers,
  Gerd

Gerd Hoffmann (2):
  Avoid asprintf() which is not available on mingw
  scsi: fix warning

 hw/msix.c     |    8 ++------
 hw/scsi-bus.c |    2 ++
 2 files changed, 4 insertions(+), 6 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH v2 1/2] Avoid asprintf() which is not available on mingw
  2012-08-13 11:05 [Qemu-devel] [PATCH v2 0/2] two little build fixes Gerd Hoffmann
@ 2012-08-13 11:05 ` Gerd Hoffmann
  2012-08-13 19:31   ` 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
  2 siblings, 1 reply; 5+ messages in thread
From: Gerd Hoffmann @ 2012-08-13 11:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH v2 2/2] scsi: fix warning
  2012-08-13 11:05 [Qemu-devel] [PATCH v2 0/2] two little build fixes Gerd Hoffmann
  2012-08-13 11:05 ` [Qemu-devel] [PATCH v2 1/2] Avoid asprintf() which is not available on mingw Gerd Hoffmann
@ 2012-08-13 11:05 ` Gerd Hoffmann
  2012-08-18 20:03 ` [Qemu-devel] [PATCH v2 0/2] two little build fixes Blue Swirl
  2 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2012-08-13 11:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

hw/scsi-bus.c:758: warning: ‘xfer’ may be used uninitialized in this
function

Isn't true, but older gcc versions (for example 4.1 as shipped in rhel5)
are not clever enougth to figure, so sprinkle in a default: line to make
them happy.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/scsi-bus.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index b8a857d..4981a02 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -761,6 +761,7 @@ static int ata_passthrough_12_xfer_size(SCSIDevice *dev, uint8_t *buf)
     switch (length) {
     case 0:
     case 3: /* USB-specific.  */
+    default:
         xfer = 0;
         break;
     case 1:
@@ -784,6 +785,7 @@ static int ata_passthrough_16_xfer_size(SCSIDevice *dev, uint8_t *buf)
     switch (length) {
     case 0:
     case 3: /* USB-specific.  */
+    default:
         xfer = 0;
         break;
     case 1:
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2 1/2] Avoid asprintf() which is not available on mingw
  2012-08-13 11:05 ` [Qemu-devel] [PATCH v2 1/2] Avoid asprintf() which is not available on mingw Gerd Hoffmann
@ 2012-08-13 19:31   ` Stefan Weil
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Weil @ 2012-08-13 19:31 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

Am 13.08.2012 13:05, schrieb Gerd Hoffmann:
> 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,

Reviewed-by: Stefan Weil <sw@weilnetz.de>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/2] two little build fixes
  2012-08-13 11:05 [Qemu-devel] [PATCH v2 0/2] two little build fixes Gerd Hoffmann
  2012-08-13 11:05 ` [Qemu-devel] [PATCH v2 1/2] Avoid asprintf() which is not available on mingw Gerd Hoffmann
  2012-08-13 11:05 ` [Qemu-devel] [PATCH v2 2/2] scsi: fix warning Gerd Hoffmann
@ 2012-08-18 20:03 ` Blue Swirl
  2 siblings, 0 replies; 5+ messages in thread
From: Blue Swirl @ 2012-08-18 20:03 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

On Mon, Aug 13, 2012 at 11:05 AM, Gerd Hoffmann <kraxel@redhat.com> wrote:
>   Hi,
>
> Patch #1 uses g_strdup_printf now, #2 is unchanged.

Thanks, applied both.

>
> cheers,
>   Gerd
>
> Gerd Hoffmann (2):
>   Avoid asprintf() which is not available on mingw
>   scsi: fix warning
>
>  hw/msix.c     |    8 ++------
>  hw/scsi-bus.c |    2 ++
>  2 files changed, 4 insertions(+), 6 deletions(-)
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-08-18 20:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-13 11:05 [Qemu-devel] [PATCH v2 0/2] two little build fixes Gerd Hoffmann
2012-08-13 11:05 ` [Qemu-devel] [PATCH v2 1/2] Avoid asprintf() which is not available on mingw Gerd Hoffmann
2012-08-13 19:31   ` 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

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).