From patchwork Tue Oct 25 05:50:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Condrea X-Patchwork-Id: 9394065 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 A2E2360231 for ; Tue, 25 Oct 2016 06:04:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93E2E2935D for ; Tue, 25 Oct 2016 06:04:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 88D352936F; Tue, 25 Oct 2016 06:04:40 +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 A7EFB2935D for ; Tue, 25 Oct 2016 06:04:39 +0000 (UTC) Received: from localhost ([::1]:51968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byuqk-00026B-Jc for patchwork-qemu-devel@patchwork.kernel.org; Tue, 25 Oct 2016 02:04:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byueY-0000sJ-FU for qemu-devel@nongnu.org; Tue, 25 Oct 2016 01:52:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byueW-0004Tu-Vl for qemu-devel@nongnu.org; Tue, 25 Oct 2016 01:52:02 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:34365) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1byueW-0004Th-KW for qemu-devel@nongnu.org; Tue, 25 Oct 2016 01:52:00 -0400 Received: by mail-wm0-x244.google.com with SMTP id y138so121379wme.1 for ; Mon, 24 Oct 2016 22:52:00 -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=27Js3bgLuvZL9StbdccqbMzMnEoI/rrRE1fGu8gKHA4=; b=fGiNfdfYhjqSyYTT09bVW8ZwoZOOeqwM5tgDZwHwTQK26rgHC4w5ggwkkVAhYVaX2U Ev1NkP3XTaOjyuC4d15xKtVr+k07Gb6ynEnx6jSklHwnBzQso4AyGk1YSJpDj8hhLiAQ HpOC66+hxcov4Jr/ScD32MopU0481Tv+N7Mgjav+s1REP57KmrDhJzE+4FIOMM0y/3Ic juvVqLgMECWb92ML72wTi17CULKJeY4iCZaEUJMt6xJGhrS34O7zUysIduJCsXWMvbbS IwG7QIpeFGwgOWTpLqIHpguW7My2HG0P2VT9zts472jRXK/gmFH1Jq7og6ZvUaJqf6ju G3zA== 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=27Js3bgLuvZL9StbdccqbMzMnEoI/rrRE1fGu8gKHA4=; b=Qn9RMNhYDRPjpWB6BPVKkgKS30jkzJQuWMuc2g/yqACUGWM2dk6gueJHX9cYt737ga R2h2tV/85siDgBhhp2pa8wJswDbep/wvM6xS9CLwHiX/t9uFH4agBvlZBbbYBITrROtu mbD9z3m7J2zbOH4y8zRquruTJ8s14Z8WbXkG0ynj8NhGG5N96uf101Dy3xVpm6vhxy1v ivPfAn5Mb7pNxlhJIoTs9y+JsQpcvYB/i1Dl3XDsyA3IN5lfJVzPP2Tmh2yC5zfR9MrG JDEW14QcpS12ONo/0vfm2xGwT1amE/17dzXlQZH7Jm0dcNlneAii5aZ2uM82MufEXNlz 7JiA== X-Gm-Message-State: ABUngvcJ612evoQL7u/qvw6DWUxcy4sItOtnx1jQwa7ZZqirSEd2S+5LE7p6VwrMLnXr8A== X-Received: by 10.28.48.203 with SMTP id w194mr1341518wmw.115.1477374719299; Mon, 24 Oct 2016 22:51:59 -0700 (PDT) Received: from localhost.localdomain ([79.112.79.134]) by smtp.gmail.com with ESMTPSA id gk6sm1358053wjc.21.2016.10.24.22.51.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Oct 2016 22:51:58 -0700 (PDT) From: Emil Condrea To: qemu-devel@nongnu.org Date: Tue, 25 Oct 2016 08:50:07 +0300 Message-Id: <1477374619-13149-2-git-send-email-emilcondrea@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1477374619-13149-1-git-send-email-emilcondrea@gmail.com> References: <1477374619-13149-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::244 Subject: [Qemu-devel] [PATCH v3 01/13] xen: Fix coding style errors 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, pbonzini@redhat.com, dgdegra@tycho.nsa.gov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Fixes the following errors: * ERROR: line over 90 characters * ERROR: code indent should never use tabs * ERROR: space prohibited after that open square bracket '[' * ERROR: do not initialise statics to 0 or NULL * ERROR: "(foo*)" should be "(foo *)" Signed-off-by: Emil Condrea --- hw/char/xen_console.c | 21 ++++++------ hw/display/xenfb.c | 91 ++++++++++++++++++++++++++++----------------------- hw/net/xen_nic.c | 8 +++-- hw/xen/xen_backend.c | 20 +++++------ 4 files changed, 76 insertions(+), 64 deletions(-) diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c index 86cdc52..d236a46 100644 --- a/hw/char/xen_console.c +++ b/hw/char/xen_console.c @@ -158,16 +158,17 @@ static void xencons_send(struct XenConsole *con) len = size; } if (len < 1) { - if (!con->backlog) { - con->backlog = 1; - xen_be_printf(&con->xendev, 1, "backlog piling up, nobody listening?\n"); - } + if (!con->backlog) { + con->backlog = 1; + xen_be_printf(&con->xendev, 1, + "backlog piling up, nobody listening?\n"); + } } else { - buffer_advance(&con->buffer, len); - if (con->backlog && len == size) { - con->backlog = 0; - xen_be_printf(&con->xendev, 1, "backlog is gone\n"); - } + buffer_advance(&con->buffer, len); + if (con->backlog && len == size) { + con->backlog = 0; + xen_be_printf(&con->xendev, 1, "backlog is gone\n"); + } } } @@ -191,7 +192,7 @@ static int con_init(struct XenDevice *xendev) type = xenstore_read_str(con->console, "type"); if (!type || strcmp(type, "ioemu") != 0) { - xen_be_printf(xendev, 1, "not for me (type=%s)\n", type); + xen_be_printf(xendev, 1, "not for me (type=%s)\n", type); ret = -1; goto out; } diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index 46b7d5e..eaa1fce 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -90,21 +90,22 @@ static int common_bind(struct common *c) xen_pfn_t mfn; if (xenstore_read_fe_uint64(&c->xendev, "page-ref", &val) == -1) - return -1; + return -1; mfn = (xen_pfn_t)val; assert(val == mfn); if (xenstore_read_fe_int(&c->xendev, "event-channel", &c->xendev.remote_port) == -1) - return -1; + return -1; c->page = xenforeignmemory_map(xen_fmem, c->xendev.dom, PROT_READ | PROT_WRITE, 1, &mfn, NULL); if (c->page == NULL) - return -1; + return -1; xen_be_bind_evtchn(&c->xendev); - xen_be_printf(&c->xendev, 1, "ring mfn %"PRI_xen_pfn", remote-port %d, local-port %d\n", - mfn, c->xendev.remote_port, c->xendev.local_port); + xen_be_printf(&c->xendev, 1, + "ring mfn %"PRI_xen_pfn", remote-port %d, local-port %d\n", + mfn, c->xendev.remote_port, c->xendev.local_port); return 0; } @@ -500,8 +501,8 @@ out: } static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim, - int width, int height, int depth, - size_t fb_len, int offset, int row_stride) + int width, int height, int depth, + size_t fb_len, int offset, int row_stride) { size_t mfn_sz = sizeof(*((struct xenfb_page *)0)->pd); size_t pd_len = sizeof(((struct xenfb_page *)0)->pd) / mfn_sz; @@ -510,40 +511,47 @@ 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", - fb_len_lim, fb_len_max); - fb_len_lim = fb_len_max; + 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", - fb_len, fb_len_lim); - fb_len = fb_len_lim; + 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", - depth); - return -1; + 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); - return -1; + 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", - width, max_width); - width = max_width; + 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", - offset, fb_len - 1); - return -1; + 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", - height, max_height); - height = max_height; + xen_be_printf(&xenfb->c.xendev, 0, + "invalid frontend height %d limited to %d\n", + height, max_height); + height = max_height; } xenfb->fb_len = fb_len; xenfb->row_stride = row_stride; @@ -554,7 +562,7 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim, xenfb->up_fullscreen = 1; xenfb->do_resize = 1; xen_be_printf(&xenfb->c.xendev, 1, "framebuffer %dx%dx%d offset %d stride %d\n", - width, height, depth, offset, row_stride); + width, height, depth, offset, row_stride); return 0; } @@ -696,9 +704,9 @@ static void xenfb_update(void *opaque) return; if (!xenfb->feature_update) { - /* we don't get update notifications, thus use the - * sledge hammer approach ... */ - xenfb->up_fullscreen = 1; + /* we don't get update notifications, thus use the + * sledge hammer approach ... */ + xenfb->up_fullscreen = 1; } /* resize if needed */ @@ -729,18 +737,19 @@ static void xenfb_update(void *opaque) /* run queued updates */ if (xenfb->up_fullscreen) { - xen_be_printf(&xenfb->c.xendev, 3, "update: fullscreen\n"); - xenfb_guest_copy(xenfb, 0, 0, xenfb->width, xenfb->height); + 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); - for (i = 0; i < xenfb->up_count; i++) - xenfb_guest_copy(xenfb, - xenfb->up_rects[i].x, - xenfb->up_rects[i].y, - xenfb->up_rects[i].w, - xenfb->up_rects[i].h); + 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, + xenfb->up_rects[i].y, + xenfb->up_rects[i].w, + xenfb->up_rects[i].h); } else { - xen_be_printf(&xenfb->c.xendev, 3, "update: nothing\n"); + xen_be_printf(&xenfb->c.xendev, 3, "update: nothing\n"); } xenfb->up_count = 0; xenfb->up_fullscreen = 0; diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c index 6856b52..9d93466 100644 --- a/hw/net/xen_nic.c +++ b/hw/net/xen_nic.c @@ -151,7 +151,8 @@ static void net_tx_packets(struct XenNetDev *netdev) continue; } - xen_be_printf(&netdev->xendev, 3, "tx packet ref %d, off %d, len %d, flags 0x%x%s%s%s%s\n", + xen_be_printf(&netdev->xendev, 3, + "tx packet ref %d, off %d, len %d, flags 0x%x%s%s%s%s\n", txreq.gref, txreq.offset, txreq.size, txreq.flags, (txreq.flags & NETTXF_csum_blank) ? " csum_blank" : "", (txreq.flags & NETTXF_data_validated) ? " data_validated" : "", @@ -162,8 +163,9 @@ static void net_tx_packets(struct XenNetDev *netdev) netdev->xendev.dom, txreq.gref, PROT_READ); if (page == NULL) { - xen_be_printf(&netdev->xendev, 0, "error: tx gref dereference failed (%d)\n", - txreq.gref); + xen_be_printf(&netdev->xendev, 0, + "error: tx gref dereference failed (%d)\n", + txreq.gref); net_tx_error(netdev, &txreq, rc); continue; } diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index 69a2388..545ee47 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -54,7 +54,7 @@ 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 int debug = 0; +static int debug; /* ------------------------------------------------------------- */ @@ -215,13 +215,13 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t const char *xenbus_strstate(enum xenbus_state state) { static const char *const name[] = { - [ XenbusStateUnknown ] = "Unknown", - [ XenbusStateInitialising ] = "Initialising", - [ XenbusStateInitWait ] = "InitWait", - [ XenbusStateInitialised ] = "Initialised", - [ XenbusStateConnected ] = "Connected", - [ XenbusStateClosing ] = "Closing", - [ XenbusStateClosed ] = "Closed", + [XenbusStateUnknown] = "Unknown", + [XenbusStateInitialising] = "Initialising", + [XenbusStateInitWait] = "InitWait", + [XenbusStateInitialised] = "Initialised", + [XenbusStateConnected] = "Connected", + [XenbusStateClosing] = "Closing", + [XenbusStateClosed] = "Closed", }; return (state < ARRAY_SIZE(name)) ? name[state] : "INVALID"; } @@ -702,10 +702,10 @@ static void xenstore_update(void *unused) if (sscanf(vec[XS_WATCH_TOKEN], "be:%" PRIxPTR ":%d:%" PRIxPTR, &type, &dom, &ops) == 3) { - xenstore_update_be(vec[XS_WATCH_PATH], (void*)type, dom, (void*)ops); + xenstore_update_be(vec[XS_WATCH_PATH], (void *)type, dom, (void*)ops); } if (sscanf(vec[XS_WATCH_TOKEN], "fe:%" PRIxPTR, &ptr) == 1) { - xenstore_update_fe(vec[XS_WATCH_PATH], (void*)ptr); + xenstore_update_fe(vec[XS_WATCH_PATH], (void *)ptr); } cleanup: