From patchwork Tue Oct 4 06:43:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Condrea X-Patchwork-Id: 9361193 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7E4CC607D8 for ; Tue, 4 Oct 2016 06:45:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B18D287D5 for ; Tue, 4 Oct 2016 06:45:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5FAD028825; Tue, 4 Oct 2016 06:45:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 88CDB287D5 for ; Tue, 4 Oct 2016 06:45:21 +0000 (UTC) Received: from localhost ([::1]:40437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brJTc-0001sE-GT for patchwork-qemu-devel@patchwork.kernel.org; Tue, 04 Oct 2016 02:45:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brJSq-0001fG-Mr for qemu-devel@nongnu.org; Tue, 04 Oct 2016 02:44:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brJSm-0005Zt-0F for qemu-devel@nongnu.org; Tue, 04 Oct 2016 02:44:32 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:35492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brJSl-0005Ym-Fq for qemu-devel@nongnu.org; Tue, 04 Oct 2016 02:44:27 -0400 Received: by mail-wm0-x242.google.com with SMTP id f193so13422085wmg.2 for ; Mon, 03 Oct 2016 23:44:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=93jBV8eVQty/JHRzh2Ckip/rN2tFfl+Jika4imv3PBU=; b=Y/d5D2UPvzF1fO4oC+LXXttsgcqsRlblXPqgHrIUnCN94F6jFUM5lVUR1dKnTPM25e 0I1OPkSyBVVfYznmSkCbVSaG2FSzlVBWCq+yMcrgSi6h6B4ZHQpAjVHS0JicwNx7yooQ 8IeXaG6qUIRdSG7fxliGFj+qJni2bF49ejeDBWgKazk1TbMV4To+ULJStSK1Y6LjkHW8 cAd9vrq2BybTOhDU3tU4BA2UTAagCuweK4YvNNmFPLY5TvCywx7i9Tyf3ImvOdTCmO9C FJJfJLd/BB50J/KgJU/qSBQWOugP08h25pQErkSwMw+xDGE6iNEFW4kGVBU+GXk6T2NX mWrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=93jBV8eVQty/JHRzh2Ckip/rN2tFfl+Jika4imv3PBU=; b=YXrfO1YTUvEbexDkLVL7Y5IREwvyPWQGdKSfh30qgH0ZWY8DFj5PSIVuXbcGQVo8pC N/KGkmBc0YZ4+j+/44JF9PmnYkhQgjgR2qgqu1IB4xLTNN4MMV+XMP8iXwGPHAx3Xci5 0ZTQ1yDBz37XDPlxtRTZqIO3z5LIwmiDifuGOrpZk15PVKWSJQIwL2o1efA7jBIdHZPh PqRWL9QL4H07vCZunMMINQuIz+IURH/bBW8AEFM2oNtCaGfLGdvo79LW0NYR3oCwOjsh 8zkxBpNsfnFBVaqyd8iO41ritBPfsEyHqvRJjgS/CexCV1vzGbI3thpmT9qy4YO0ttSq /wIg== X-Gm-Message-State: AA6/9RmsGGfz3PRMJwz460eWBI2v/s8LxD0jcq/v5wMTsT8xW/UGBBQO0cjqNg4V7zFlEA== X-Received: by 10.194.13.97 with SMTP id g1mr1427582wjc.223.1475563466671; Mon, 03 Oct 2016 23:44:26 -0700 (PDT) Received: from localhost.localdomain ([79.112.35.35]) by smtp.gmail.com with ESMTPSA id f142sm2341423wmf.19.2016.10.03.23.44.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Oct 2016 23:44:25 -0700 (PDT) From: Emil Condrea To: qemu-devel@nongnu.org Date: Tue, 4 Oct 2016 09:43:31 +0300 Message-Id: <1475563424-6604-3-git-send-email-emilcondrea@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1475563424-6604-1-git-send-email-emilcondrea@gmail.com> References: <1475563424-6604-1-git-send-email-emilcondrea@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: xuquan8@huawei.com, sstabellini@kernel.org, wei.liu2@citrix.com, stefanb@linux.vnet.ibm.com, xen-devel@lists.xen.org, anthony.perard@citrix.com, dgdegra@tycho.nsa.gov, Emil Condrea Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Fixes: * WARNING: line over 80 characters Signed-off-by: Emil Condrea --- hw/block/xen_disk.c | 3 ++- hw/char/xen_console.c | 6 ++++-- hw/display/xenfb.c | 30 ++++++++++++++++++++---------- hw/net/xen_nic.c | 12 ++++++++---- hw/xen/xen_backend.c | 15 ++++++++++----- include/hw/xen/xen_backend.h | 8 +++++--- 6 files changed, 49 insertions(+), 25 deletions(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index 5aa350a..24edeb2 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -1068,7 +1068,8 @@ static int blk_connect(struct XenDevice *xendev) blk_set_enable_write_cache(blkdev->blk, !writethrough); } else { /* setup via qemu cmdline -> already setup for us */ - xen_be_printf(&blkdev->xendev, 2, "get configured bdrv (cmdline setup)\n"); + xen_be_printf(&blkdev->xendev, 2, + "get configured bdrv (cmdline setup)\n"); blkdev->blk = blk_by_legacy_dinfo(blkdev->dinfo); if (blk_is_read_only(blkdev->blk) && !readonly) { xen_be_printf(&blkdev->xendev, 0, "Unexpected read-only drive"); diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c index 4e35c82..399bb5d 100644 --- a/hw/char/xen_console.c +++ b/hw/char/xen_console.c @@ -156,7 +156,8 @@ static void xencons_send(struct XenConsole *con) if (len < 1) { if (!con->backlog) { con->backlog = 1; - xen_be_printf(&con->xendev, 1, "backlog piling up, nobody listening?\n"); + xen_be_printf(&con->xendev, 1, + "backlog piling up, nobody listening?\n"); } } else { buffer_advance(&con->buffer, len); @@ -247,7 +248,8 @@ static int con_initialise(struct XenDevice *xendev) } } - xen_be_printf(xendev, 1, "ring mfn %d, remote port %d, local port %d, limit %zd\n", + xen_be_printf(xendev, 1, + "ring mfn %d, remote port %d, local port %d, limit %zd\n", con->ring_ref, con->xendev.remote_port, con->xendev.local_port, diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index a9a93f9..9bcf60b 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -511,38 +511,45 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim, int max_width, max_height; if (fb_len_lim > fb_len_max) { - xen_be_printf(&xenfb->c.xendev, 0, "fb size limit %zu exceeds %zu, corrected\n", + xen_be_printf(&xenfb->c.xendev, 0, + "fb size limit %zu exceeds %zu, corrected\n", fb_len_lim, fb_len_max); fb_len_lim = fb_len_max; } if (fb_len_lim && fb_len > fb_len_lim) { - xen_be_printf(&xenfb->c.xendev, 0, "frontend fb size %zu limited to %zu\n", + xen_be_printf(&xenfb->c.xendev, 0, + "frontend fb size %zu limited to %zu\n", fb_len, fb_len_lim); fb_len = fb_len_lim; } if (depth != 8 && depth != 16 && depth != 24 && depth != 32) { - xen_be_printf(&xenfb->c.xendev, 0, "can't handle frontend fb depth %d\n", + xen_be_printf(&xenfb->c.xendev, 0, + "can't handle frontend fb depth %d\n", depth); return -1; } if (row_stride <= 0 || row_stride > fb_len) { - xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n", row_stride); + xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n", + row_stride); return -1; } max_width = row_stride / (depth / 8); if (width < 0 || width > max_width) { - xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend width %d limited to %d\n", + xen_be_printf(&xenfb->c.xendev, 0, + "invalid frontend width %d limited to %d\n", width, max_width); width = max_width; } if (offset < 0 || offset >= fb_len) { - xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend offset %d (max %zu)\n", + xen_be_printf(&xenfb->c.xendev, 0, + "invalid frontend offset %d (max %zu)\n", offset, fb_len - 1); return -1; } max_height = (fb_len - offset) / row_stride; if (height < 0 || height > max_height) { - xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend height %d limited to %d\n", + xen_be_printf(&xenfb->c.xendev, 0, + "invalid frontend height %d limited to %d\n", height, max_height); height = max_height; } @@ -554,7 +561,8 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim, xenfb->offset = offset; xenfb->up_fullscreen = 1; xenfb->do_resize = 1; - xen_be_printf(&xenfb->c.xendev, 1, "framebuffer %dx%dx%d offset %d stride %d\n", + xen_be_printf(&xenfb->c.xendev, 1, + "framebuffer %dx%dx%d offset %d stride %d\n", width, height, depth, offset, row_stride); return 0; } @@ -722,7 +730,8 @@ static void xenfb_update(void *opaque) break; } dpy_gfx_replace_surface(xenfb->c.con, surface); - xen_be_printf(&xenfb->c.xendev, 1, "update: resizing: %dx%d @ %d bpp%s\n", + xen_be_printf(&xenfb->c.xendev, 1, + "update: resizing: %dx%d @ %d bpp%s\n", xenfb->width, xenfb->height, xenfb->depth, is_buffer_shared(surface) ? " (shared)" : ""); xenfb->up_fullscreen = 1; @@ -733,7 +742,8 @@ static void xenfb_update(void *opaque) xen_be_printf(&xenfb->c.xendev, 3, "update: fullscreen\n"); xenfb_guest_copy(xenfb, 0, 0, xenfb->width, xenfb->height); } else if (xenfb->up_count) { - xen_be_printf(&xenfb->c.xendev, 3, "update: %d rects\n", xenfb->up_count); + xen_be_printf(&xenfb->c.xendev, 3, "update: %d rects\n", + xenfb->up_count); for (i = 0; i < xenfb->up_count; i++) xenfb_guest_copy(xenfb, xenfb->up_rects[i].x, diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c index f401cd2..30efe47 100644 --- a/hw/net/xen_nic.c +++ b/hw/net/xen_nic.c @@ -140,7 +140,8 @@ static void net_tx_packets(struct XenNetDev *netdev) #endif if (txreq.size < 14) { - xen_be_printf(&netdev->xendev, 0, "bad packet size: %d\n", txreq.size); + xen_be_printf(&netdev->xendev, 0, "bad packet size: %d\n", + txreq.size); net_tx_error(netdev, &txreq, rc); continue; } @@ -213,7 +214,8 @@ static void net_rx_response(struct XenNetDev *netdev, resp->status = (int16_t)st; } - xen_be_printf(&netdev->xendev, 3, "rx response: idx %d, status %d, flags 0x%x\n", + xen_be_printf(&netdev->xendev, 3, + "rx response: idx %d, status %d, flags 0x%x\n", i, resp->status, resp->flags); netdev->rx_ring.rsp_prod_pvt = ++i; @@ -256,7 +258,8 @@ static ssize_t net_rx_packet(NetClientState *nc, const uint8_t *buf, size_t size netdev->xendev.dom, rxreq.gref, PROT_WRITE); if (page == NULL) { - xen_be_printf(&netdev->xendev, 0, "error: rx gref dereference failed (%d)\n", + xen_be_printf(&netdev->xendev, 0, + "error: rx gref dereference failed (%d)\n", rxreq.gref); net_rx_response(netdev, &rxreq, NETIF_RSP_ERROR, 0, 0, 0); return -1; @@ -330,7 +333,8 @@ static int net_connect(struct XenDevice *xendev) rx_copy = 0; } if (rx_copy == 0) { - xen_be_printf(&netdev->xendev, 0, "frontend doesn't support rx-copy.\n"); + xen_be_printf(&netdev->xendev, 0, + "frontend doesn't support rx-copy.\n"); return -1; } diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index 545ee47..0aca6ae 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -53,7 +53,8 @@ struct xs_dirs { static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup = QTAILQ_HEAD_INITIALIZER(xs_cleanup); -static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs = QTAILQ_HEAD_INITIALIZER(xendevs); +static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs = + QTAILQ_HEAD_INITIALIZER(xendevs); static int debug; /* ------------------------------------------------------------- */ @@ -205,7 +206,8 @@ int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival) return xenstore_read_int(xendev->fe, node, ival); } -int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t *uval) +int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, + uint64_t *uval) { return xenstore_read_uint64(xendev->fe, node, uval); } @@ -385,7 +387,8 @@ static void xen_be_frontend_changed(struct XenDevice *xendev, const char *node) g_free(xendev->protocol); xendev->protocol = xenstore_read_fe_str(xendev, "protocol"); if (xendev->protocol) { - xen_be_printf(xendev, 1, "frontend protocol: %s\n", xendev->protocol); + xen_be_printf(xendev, 1, "frontend protocol: %s\n", + xendev->protocol); } } @@ -617,7 +620,8 @@ static int xenstore_scan(const char *type, int dom, struct XenDevOps *ops) snprintf(token, sizeof(token), "be:%p:%d:%p", type, dom, ops); snprintf(path, sizeof(path), "backend/%s/%d", type, dom); if (!xs_watch(xenstore, path, token)) { - xen_be_printf(NULL, 0, "xen be: watching backend path (%s) failed\n", path); + xen_be_printf(NULL, 0, "xen be: watching backend path (%s) failed\n", + path); return -1; } @@ -830,7 +834,8 @@ int xen_be_send_notify(struct XenDevice *xendev) * 2 == noisy debug messages (logfile only). * 3 == will flood your log (logfile only). */ -void xen_be_printf(struct XenDevice *xendev, int msg_level, const char *fmt, ...) +void xen_be_printf(struct XenDevice *xendev, int msg_level, + const char *fmt, ...) { va_list args; diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h index 0df282a..0ccbc0f 100644 --- a/include/hw/xen/xen_backend.h +++ b/include/hw/xen/xen_backend.h @@ -79,7 +79,8 @@ int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival); char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node); int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival); int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval); -int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t *uval); +int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, + uint64_t *uval); const char *xenbus_strstate(enum xenbus_state state); struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev); @@ -93,8 +94,9 @@ int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state); int xen_be_bind_evtchn(struct XenDevice *xendev); void xen_be_unbind_evtchn(struct XenDevice *xendev); int xen_be_send_notify(struct XenDevice *xendev); -void xen_be_printf(struct XenDevice *xendev, int msg_level, const char *fmt, ...) - GCC_FMT_ATTR(3, 4); +void xen_be_printf(struct XenDevice *xendev, int msg_level, + const char *fmt, ...) GCC_FMT_ATTR(3, 4); + /* actual backend drivers */ extern struct XenDevOps xen_console_ops; /* xen_console.c */