mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fix a code style in drivers/char/virtio_console.c
@ 2010-05-18  5:17 Steven Liu
  2010-05-18  5:22 ` Amit Shah
  0 siblings, 1 reply; 5+ messages in thread
From: Steven Liu @ 2010-05-18  5:17 UTC (permalink / raw)
  To: amit.shah, linux-kernel, virtualization

fix a code style in drivers/char/virtio_console.c

Signed-off-by: Liu Qi <lingjiujianke@gmail.com>
---
 drivers/char/virtio_console.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 196428c..61dad7e 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -1299,36 +1299,31 @@ static int init_vqs(struct ports_device *portdev)
        char **io_names;
        struct virtqueue **vqs;
        u32 i, j, nr_ports, nr_queues;
-       int err;
+       int err = -ENOMEM;

        nr_ports = portdev->config.max_nr_ports;
        nr_queues = use_multiport(portdev) ? (nr_ports + 1) * 2 : 2;

        vqs = kmalloc(nr_queues * sizeof(struct virtqueue *), GFP_KERNEL);
        if (!vqs) {
-               err = -ENOMEM;
                goto fail;
        }
        io_callbacks = kmalloc(nr_queues * sizeof(vq_callback_t *), GFP_KERNEL);
        if (!io_callbacks) {
-               err = -ENOMEM;
                goto free_vqs;
        }
        io_names = kmalloc(nr_queues * sizeof(char *), GFP_KERNEL);
        if (!io_names) {
-               err = -ENOMEM;
                goto free_callbacks;
        }
        portdev->in_vqs = kmalloc(nr_ports * sizeof(struct virtqueue *),
                                  GFP_KERNEL);
        if (!portdev->in_vqs) {
-               err = -ENOMEM;
                goto free_names;
        }
        portdev->out_vqs = kmalloc(nr_ports * sizeof(struct virtqueue *),
                                   GFP_KERNEL);
        if (!portdev->out_vqs) {
-               err = -ENOMEM;
                goto free_invqs;
        }

--
1.7.1



Best regards

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

end of thread, other threads:[~2010-05-18  6:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-18  5:17 [PATCH] fix a code style in drivers/char/virtio_console.c Steven Liu
2010-05-18  5:22 ` Amit Shah
2010-05-18  5:41   ` Steven Liu
2010-05-18  6:32     ` Amit Shah
2010-05-18  6:41       ` Steven Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®