]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
stdio: remove useless strncpy
authorVincent Palatin <vpalatin@chromium.org>
Wed, 5 Dec 2012 14:46:32 +0000 (14:46 +0000)
committerTom Rini <trini@ti.com>
Tue, 11 Dec 2012 20:17:33 +0000 (13:17 -0700)
The name is already copied when we memcpy() the whole structure.

This is because struct stdio_dev has this field:

char name[16]; /* Device name */

So the data is inline, rather than being a pointer.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
common/stdio.c

index 9f48e5f5034da70cda786d8569a7287780868c9c..97ff9cf4a6a49f533f90240e9469bd4063986a11 100644 (file)
@@ -135,7 +135,6 @@ struct stdio_dev* stdio_clone(struct stdio_dev *dev)
                return NULL;
 
        memcpy(_dev, dev, sizeof(struct stdio_dev));
-       strncpy(_dev->name, dev->name, 16);
 
        return _dev;
 }