mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
xen: Fix coding style errors
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 <emilcondrea@gmail.com> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Quan Xu <xuquan8@huawei.com> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
This commit is contained in:
parent
5b2ecabaea
commit
c22e91b1d8
4 changed files with 76 additions and 64 deletions
|
@ -160,7 +160,8 @@ static void xencons_send(struct XenConsole *con)
|
||||||
if (len < 1) {
|
if (len < 1) {
|
||||||
if (!con->backlog) {
|
if (!con->backlog) {
|
||||||
con->backlog = 1;
|
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 {
|
} else {
|
||||||
buffer_advance(&con->buffer, len);
|
buffer_advance(&con->buffer, len);
|
||||||
|
|
|
@ -103,7 +103,8 @@ static int common_bind(struct common *c)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
xen_be_bind_evtchn(&c->xendev);
|
xen_be_bind_evtchn(&c->xendev);
|
||||||
xen_be_printf(&c->xendev, 1, "ring mfn %"PRI_xen_pfn", remote-port %d, local-port %d\n",
|
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);
|
mfn, c->xendev.remote_port, c->xendev.local_port);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -510,38 +511,45 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
|
||||||
int max_width, max_height;
|
int max_width, max_height;
|
||||||
|
|
||||||
if (fb_len_lim > fb_len_max) {
|
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);
|
||||||
fb_len_lim = fb_len_max;
|
fb_len_lim = fb_len_max;
|
||||||
}
|
}
|
||||||
if (fb_len_lim && fb_len > fb_len_lim) {
|
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);
|
||||||
fb_len = fb_len_lim;
|
fb_len = fb_len_lim;
|
||||||
}
|
}
|
||||||
if (depth != 8 && depth != 16 && depth != 24 && depth != 32) {
|
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);
|
depth);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (row_stride <= 0 || row_stride > fb_len) {
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
max_width = row_stride / (depth / 8);
|
max_width = row_stride / (depth / 8);
|
||||||
if (width < 0 || width > max_width) {
|
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);
|
||||||
width = max_width;
|
width = max_width;
|
||||||
}
|
}
|
||||||
if (offset < 0 || offset >= fb_len) {
|
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);
|
offset, fb_len - 1);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
max_height = (fb_len - offset) / row_stride;
|
max_height = (fb_len - offset) / row_stride;
|
||||||
if (height < 0 || height > max_height) {
|
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);
|
||||||
height = max_height;
|
height = max_height;
|
||||||
}
|
}
|
||||||
|
@ -732,7 +740,8 @@ static void xenfb_update(void *opaque)
|
||||||
xen_be_printf(&xenfb->c.xendev, 3, "update: fullscreen\n");
|
xen_be_printf(&xenfb->c.xendev, 3, "update: fullscreen\n");
|
||||||
xenfb_guest_copy(xenfb, 0, 0, xenfb->width, xenfb->height);
|
xenfb_guest_copy(xenfb, 0, 0, xenfb->width, xenfb->height);
|
||||||
} else if (xenfb->up_count) {
|
} 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++)
|
for (i = 0; i < xenfb->up_count; i++)
|
||||||
xenfb_guest_copy(xenfb,
|
xenfb_guest_copy(xenfb,
|
||||||
xenfb->up_rects[i].x,
|
xenfb->up_rects[i].x,
|
||||||
|
|
|
@ -151,7 +151,8 @@ static void net_tx_packets(struct XenNetDev *netdev)
|
||||||
continue;
|
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.gref, txreq.offset, txreq.size, txreq.flags,
|
||||||
(txreq.flags & NETTXF_csum_blank) ? " csum_blank" : "",
|
(txreq.flags & NETTXF_csum_blank) ? " csum_blank" : "",
|
||||||
(txreq.flags & NETTXF_data_validated) ? " data_validated" : "",
|
(txreq.flags & NETTXF_data_validated) ? " data_validated" : "",
|
||||||
|
@ -162,7 +163,8 @@ static void net_tx_packets(struct XenNetDev *netdev)
|
||||||
netdev->xendev.dom,
|
netdev->xendev.dom,
|
||||||
txreq.gref, PROT_READ);
|
txreq.gref, PROT_READ);
|
||||||
if (page == NULL) {
|
if (page == NULL) {
|
||||||
xen_be_printf(&netdev->xendev, 0, "error: tx gref dereference failed (%d)\n",
|
xen_be_printf(&netdev->xendev, 0,
|
||||||
|
"error: tx gref dereference failed (%d)\n",
|
||||||
txreq.gref);
|
txreq.gref);
|
||||||
net_tx_error(netdev, &txreq, rc);
|
net_tx_error(netdev, &txreq, rc);
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -54,7 +54,7 @@ static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup =
|
||||||
QTAILQ_HEAD_INITIALIZER(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 = 0;
|
static int debug;
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue