Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f83bb2d40a879c21c5085ee8cfc426f9936901ee
Commit:     f83bb2d40a879c21c5085ee8cfc426f9936901ee
Parent:     0ecd233bb6efa9745dffc6134ceab8aba1aa030b
Author:     Jiri Slaby <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 7 00:16:44 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Feb 7 08:42:34 2008 -0800

    Char: mxser, simplify mxser_get_serial_info
    
    Initialize temp structure directly with proper values without first zeroing
    it and setting later as suggested by Jan.
    
    Signed-off-by: Jiri Slaby <[EMAIL PROTECTED]>
    Cc: Jan Engelhardt <[EMAIL PROTECTED]>
    Reviewed-by: Alan Cox <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/char/mxser_new.c |   27 ++++++++++++---------------
 1 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c
index 9449fba..937c101 100644
--- a/drivers/char/mxser_new.c
+++ b/drivers/char/mxser_new.c
@@ -1168,21 +1168,18 @@ static void mxser_flush_buffer(struct tty_struct *tty)
 static int mxser_get_serial_info(struct mxser_port *info,
                struct serial_struct __user *retinfo)
 {
-       struct serial_struct tmp;
-
-       if (!retinfo)
-               return -EFAULT;
-       memset(&tmp, 0, sizeof(tmp));
-       tmp.type = info->type;
-       tmp.line = info->tty->index;
-       tmp.port = info->ioaddr;
-       tmp.irq = info->board->irq;
-       tmp.flags = info->flags;
-       tmp.baud_base = info->baud_base;
-       tmp.close_delay = info->close_delay;
-       tmp.closing_wait = info->closing_wait;
-       tmp.custom_divisor = info->custom_divisor;
-       tmp.hub6 = 0;
+       struct serial_struct tmp = {
+               .type = info->type,
+               .line = info->tty->index,
+               .port = info->ioaddr,
+               .irq = info->board->irq,
+               .flags = info->flags,
+               .baud_base = info->baud_base,
+               .close_delay = info->close_delay,
+               .closing_wait = info->closing_wait,
+               .custom_divisor = info->custom_divisor,
+               .hub6 = 0
+       };
        if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
                return -EFAULT;
        return 0;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to