From: Ian Campbell Subject: Re: [PATCH] opw: libxl: use GCSPRINTF in place of libxl_sprintf() in libxl_qmp.c Date: Mon, 11 Nov 2013 12:26:51 +0000 Message-ID: <1384172811.8909.59.camel@kazak.uk.xensource.com> References: <1384141269-22487-1-git-send-email-kelleynnn@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1384141269-22487-1-git-send-email-kelleynnn@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Kelley Nielsen Cc: anthony.perard@citrix.com, xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Sun, 2013-11-10 at 19:41 -0800, Kelley Nielsen wrote: > > #define QMP_PARAMETERS_SPRINTF(args, name, format, ...) \ > qmp_parameters_add_string(gc, args, name, \ > - libxl__sprintf(gc, format, __VA_ARGS__)) > + GCSPRINTF(format, __VA_ARGS__)) Might now be short enough to fit on the line after "name, "? > @@ -766,7 +764,7 @@ static int pci_add_callback(libxl__qmp_handler *qmp, > const libxl__json_object *bus = NULL; > GC_INIT(qmp->ctx); > int i, j, rc = -1; > - char *asked_id = libxl__sprintf(gc, PCI_PT_QDEV_ID, > + char *asked_id = GCSPRINTF(PCI_PT_QDEV_ID, > pcidev->bus, pcidev->dev, pcidev->func); > > for (i = 0; (bus = libxl__json_array_get(response, i)); i++) { > @@ -835,7 +833,7 @@ int libxl__qmp_pci_add(libxl__gc *gc, int domid, libxl_device_pci *pcidev) > if (!qmp) > return -1; > > - hostaddr = libxl__sprintf(gc, "%04x:%02x:%02x.%01x", pcidev->domain, > + hostaddr = GCSPRINTF("%04x:%02x:%02x.%01x", pcidev->domain, > pcidev->bus, pcidev->dev, pcidev->func); Please also reindent the following line in these two cases, or unwrap if the result is <80 columns. Ian.