]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Fix GCC format-security errors and convert sprintfs.
authorBen Whitten <ben.whitten@gmail.com>
Wed, 30 Dec 2015 13:05:58 +0000 (13:05 +0000)
committerTom Rini <trini@konsulko.com>
Fri, 15 Jan 2016 03:11:34 +0000 (22:11 -0500)
With format-security errors turned on, GCC picks up the use of sprintf with
a format parameter not being a string literal.

Simple uses of sprintf are also converted to use strcpy.

Signed-off-by: Ben Whitten <ben.whitten@gmail.com>
Acked-by: Wolfgang Denk <wd@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
53 files changed:
arch/mips/mach-au1x00/au1x00_eth.c
arch/powerpc/cpu/mpc8260/ether_scc.c
arch/powerpc/cpu/mpc8xx/fec.c
arch/powerpc/cpu/mpc8xx/scc.c
arch/powerpc/cpu/mpc8xx/video.c
board/freescale/b4860qds/eth_b4860qds.c
board/freescale/corenet_ds/eth_hydra.c
board/freescale/corenet_ds/eth_superhydra.c
board/freescale/ls1021aqds/eth.c
board/freescale/ls1043aqds/eth.c
board/freescale/ls2080aqds/eth.c
board/freescale/t102xqds/eth_t102xqds.c
board/freescale/t1040qds/eth.c
board/freescale/t208xqds/eth_t208xqds.c
board/freescale/t4qds/eth.c
board/gdsys/common/ihs_mdio.c
board/keymile/common/common.c
board/mpl/common/common_util.c
board/samsung/universal_c210/universal.c
board/siemens/rut/board.c
board/vscom/baltos/board.c
common/cmd_elf.c
common/cmd_mtdparts.c
disk/part_dos.c
disk/part_efi.c
disk/part_iso.c
drivers/block/sata_dwc.c
drivers/net/altera_tse.c
drivers/net/at91_emac.c
drivers/net/ax88180.c
drivers/net/cpsw.c
drivers/net/davinci_emac.c
drivers/net/designware.c
drivers/net/dm9000x.c
drivers/net/fm/memac_phy.c
drivers/net/fm/tgec_phy.c
drivers/net/fsl_mdio.c
drivers/net/ftgmac100.c
drivers/net/ftmac100.c
drivers/net/greth.c
drivers/net/keystone_net.c
drivers/net/ldpaa_eth/ldpaa_eth.c
drivers/net/lpc32xx_eth.c
drivers/net/mpc512x_fec.c
drivers/net/mpc5xxx_fec.c
drivers/net/mvgbe.c
drivers/net/ne2000_base.c
drivers/net/pch_gbe.c
drivers/net/sh_eth.c
drivers/net/tsec.c
drivers/usb/gadget/f_fastboot.c
include/configs/tam3517-common.h
scripts/kconfig/mconf.c

index d6ebe0764344c4bc55f0036064318968367f7ce7..3f9f91eb0408e9426c5a82492570a55812d75e10 100644 (file)
@@ -279,7 +279,7 @@ int au1x00_enet_initialize(bd_t *bis){
 
        memset(dev, 0, sizeof *dev);
 
-       sprintf(dev->name, "Au1X00 ethernet");
+       strcpy(dev->name, "Au1X00 ethernet");
        dev->iobase = 0;
        dev->priv   = 0;
        dev->init   = au1x00_init;
index 5ba8bed20dbddecb3c731eb400e68bc95f0ff234..fff8f2b8d3e93982d5e8d8ed83012069bc355d96 100644 (file)
@@ -355,7 +355,7 @@ int mpc82xx_scc_enet_initialize(bd_t *bis)
        dev = (struct eth_device *) malloc(sizeof *dev);
        memset(dev, 0, sizeof *dev);
 
-       sprintf(dev->name, "SCC");
+       strcpy(dev->name, "SCC");
        dev->init   = sec_init;
        dev->halt   = sec_halt;
        dev->send   = sec_send;
index 2e196033c240af33a4dbc0b8ccd765a0a2857b25..ea4ab3a04237837b4cb76480be9f79782e8d0e9c 100644 (file)
@@ -148,7 +148,7 @@ int fec_initialize(bd_t *bis)
                /* for FEC1 make sure that the name of the interface is the same
                   as the old one for compatibility reasons */
                if (i == 0) {
-                       sprintf (dev->name, "FEC");
+                       strcpy(dev->name, "FEC");
                } else {
                        sprintf (dev->name, "FEC%d",
                                ether_fcc_info[i].ether_index + 1);
index 549844032bef7a03ddc356603ad1dd44f52e413c..3474637fac9311f0c0df7f1554458c55f0a3cc41 100644 (file)
@@ -77,7 +77,7 @@ int scc_initialize(bd_t *bis)
        dev = (struct eth_device*) malloc(sizeof *dev);
        memset(dev, 0, sizeof *dev);
 
-       sprintf(dev->name, "SCC");
+       strcpy(dev->name, "SCC");
        dev->iobase = 0;
        dev->priv   = 0;
        dev->init   = scc_init;
index 15cee3fd4a15d8b8224faa115bbb460b6caff1c9..c35406d37b53df73198e8e5744a1acdfb13614b5 100644 (file)
@@ -981,11 +981,11 @@ static void *video_logo (void)
                 U_BOOT_VERSION, U_BOOT_DATE, U_BOOT_TIME);
        video_drawstring (VIDEO_INFO_X, VIDEO_INFO_Y, info);
 
-       sprintf (info, "(C) 2002 DENX Software Engineering");
+       strcpy(info, "(C) 2002 DENX Software Engineering");
        video_drawstring (VIDEO_INFO_X, VIDEO_INFO_Y + VIDEO_FONT_HEIGHT,
                                        info);
 
-       sprintf (info, "    Wolfgang DENK, wd@denx.de");
+       strcpy(info, "    Wolfgang DENK, wd@denx.de");
        video_drawstring (VIDEO_INFO_X, VIDEO_INFO_Y + VIDEO_FONT_HEIGHT * 2,
                                        info);
 
index df90476a772c1ca8f97ee8fcae731970019be00c..4b2303e8496eefc55daf68a30e7ebd9f28a10925 100644 (file)
@@ -408,22 +408,22 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,
                                    sizeof(f_link));
                        break;
                case 0x98: /* XAUI interface */
-                       sprintf(alias, "phy_xaui_slot1");
+                       strcpy(alias, "phy_xaui_slot1");
                        fdt_status_okay_by_alias(fdt, alias);
 
-                       sprintf(alias, "phy_xaui_slot2");
+                       strcpy(alias, "phy_xaui_slot2");
                        fdt_status_okay_by_alias(fdt, alias);
                        break;
                case 0x9e: /* XAUI interface */
                case 0x9a:
                case 0x93:
                case 0x91:
-                       sprintf(alias, "phy_xaui_slot1");
+                       strcpy(alias, "phy_xaui_slot1");
                        fdt_status_okay_by_alias(fdt, alias);
                        break;
                case 0x97: /* XAUI interface */
                case 0xc3:
-                       sprintf(alias, "phy_xaui_slot2");
+                       strcpy(alias, "phy_xaui_slot2");
                        fdt_status_okay_by_alias(fdt, alias);
                        break;
                default:
index 172a55b9883bff1245bcc3fbea5918f40b2ec6c3..55437e843d62c245bc34acbbe1028fbb0766376e 100644 (file)
@@ -170,7 +170,7 @@ static int hydra_mdio_init(char *realbusname, char *fakebusname)
        bus->read = hydra_mdio_read;
        bus->write = hydra_mdio_write;
        bus->reset = hydra_mdio_reset;
-       sprintf(bus->name, fakebusname);
+       strcpy(bus->name, fakebusname);
 
        hmdio->realbus = miiphy_get_dev_by_name(realbusname);
 
index 62b163580b2d38fbb7b2350f5a4aea2694da0696..3f11f5f279a954fbc3a2ee976f08af39b617ff6a 100644 (file)
@@ -175,7 +175,7 @@ static int super_hydra_mdio_init(char *realbusname, char *fakebusname)
        bus->read = super_hydra_mdio_read;
        bus->write = super_hydra_mdio_write;
        bus->reset = super_hydra_mdio_reset;
-       sprintf(bus->name, fakebusname);
+       strcpy(bus->name, fakebusname);
 
        hmdio->realbus = miiphy_get_dev_by_name(realbusname);
 
index be351befec066f20a003b44098c5180df3c85455..bf3e08a8cf9dcad6bddcfb072183223c6c7ec682 100644 (file)
@@ -113,7 +113,7 @@ static int ls1021a_mdio_init(char *realbusname, char *fakebusname)
        bus->read = ls1021a_mdio_read;
        bus->write = ls1021a_mdio_write;
        bus->reset = ls1021a_mdio_reset;
-       sprintf(bus->name, fakebusname);
+       strcpy(bus->name, fakebusname);
 
        lsmdio->realbus = miiphy_get_dev_by_name(realbusname);
 
index b7fc360e2ccc649b1cbbe0fd1cbe431febf5a207..88b10a0f2f1223866d82e461dea4fb378d7841b1 100644 (file)
@@ -136,7 +136,7 @@ static int ls1043aqds_mdio_init(char *realbusname, u8 muxval)
        bus->read = ls1043aqds_mdio_read;
        bus->write = ls1043aqds_mdio_write;
        bus->reset = ls1043aqds_mdio_reset;
-       sprintf(bus->name, ls1043aqds_mdio_name_for_muxval(muxval));
+       strcpy(bus->name, ls1043aqds_mdio_name_for_muxval(muxval));
 
        pmdio->realbus = miiphy_get_dev_by_name(realbusname);
 
index 0637ecf2a7f09f9c277f603a039a998e9ab6c0e7..ebc9d4746815882843eb4ea1a61b719c3375b177 100644 (file)
@@ -412,7 +412,7 @@ static int ls2080a_qds_mdio_init(char *realbusname, u8 muxval)
        bus->read = ls2080a_qds_mdio_read;
        bus->write = ls2080a_qds_mdio_write;
        bus->reset = ls2080a_qds_mdio_reset;
-       sprintf(bus->name, ls2080a_qds_mdio_name_for_muxval(muxval));
+       strcpy(bus->name, ls2080a_qds_mdio_name_for_muxval(muxval));
 
        pmdio->realbus = miiphy_get_dev_by_name(realbusname);
 
index 99c23f79f47114938aef34efc8bf14eb270aaaee..ca54e2a4f0a39917e090efdd84315b84a12c6e3d 100644 (file)
@@ -148,7 +148,7 @@ static int t1024qds_mdio_init(char *realbusname, u8 muxval)
        bus->read = t1024qds_mdio_read;
        bus->write = t1024qds_mdio_write;
        bus->reset = t1024qds_mdio_reset;
-       sprintf(bus->name, t1024qds_mdio_name_for_muxval(muxval));
+       strcpy(bus->name, t1024qds_mdio_name_for_muxval(muxval));
 
        pmdio->realbus = miiphy_get_dev_by_name(realbusname);
 
index 8bf34fa79ac6dfe93afeaeaf76d6b39456743b22..872e6e8228a7a003c132a06919f4c6aeacad3d49 100644 (file)
@@ -162,7 +162,7 @@ static int t1040_qds_mdio_init(char *realbusname, u8 muxval)
        bus->read = t1040_qds_mdio_read;
        bus->write = t1040_qds_mdio_write;
        bus->reset = t1040_qds_mdio_reset;
-       sprintf(bus->name, t1040_qds_mdio_name_for_muxval(muxval));
+       strcpy(bus->name, t1040_qds_mdio_name_for_muxval(muxval));
 
        pmdio->realbus = miiphy_get_dev_by_name(realbusname);
 
index 1c0ce2492ca2e5742764f1ec8cfc0e37abc32829..f08cff265465f89ed0da8a50a747418033ce1171 100644 (file)
@@ -176,7 +176,7 @@ static int t208xqds_mdio_init(char *realbusname, u8 muxval)
        bus->read = t208xqds_mdio_read;
        bus->write = t208xqds_mdio_write;
        bus->reset = t208xqds_mdio_reset;
-       sprintf(bus->name, t208xqds_mdio_name_for_muxval(muxval));
+       strcpy(bus->name, t208xqds_mdio_name_for_muxval(muxval));
 
        pmdio->realbus = miiphy_get_dev_by_name(realbusname);
 
index 2dfdcbbd398e126cefd139f8a2d05af5490f4f3e..83a3a9bba28fab3722abfccb0662c33ceeacbbe9 100644 (file)
@@ -153,7 +153,7 @@ static int t4240qds_mdio_init(char *realbusname, u8 muxval)
        bus->read = t4240qds_mdio_read;
        bus->write = t4240qds_mdio_write;
        bus->reset = t4240qds_mdio_reset;
-       sprintf(bus->name, t4240qds_mdio_name_for_muxval(muxval));
+       strcpy(bus->name, t4240qds_mdio_name_for_muxval(muxval));
 
        pmdio->realbus = miiphy_get_dev_by_name(realbusname);
 
index 1d6eb7bd55f0b92161feab4a31aeae6d0db61b6b..262ead5516449fb38c87dbe14d8669c233c1f2d0 100644 (file)
@@ -80,7 +80,7 @@ int ihs_mdio_init(struct ihs_mdio_info *info)
        bus->read = ihs_mdio_read;
        bus->write = ihs_mdio_write;
        bus->reset = ihs_mdio_reset;
-       sprintf(bus->name, info->name);
+       strcpy(bus->name, info->name);
 
        bus->priv = info;
 
index 8de129dc83f2a342f51abbbeec92c599c3f3c870..a42f3eca33b3f22b1721879da42116d03b9f7d99 100644 (file)
@@ -168,7 +168,7 @@ static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc,
                printf("can't get the IVM_Boardid\n");
                return 1;
        }
-       sprintf((char *)buf, "%s", p);
+       strcpy((char *)buf, p);
        setenv("boardid", (char *)buf);
        printf("set boardid=%s\n", buf);
 
@@ -177,7 +177,7 @@ static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc,
                printf("can't get the IVM_HWKey\n");
                return 1;
        }
-       sprintf((char *)buf, "%s", p);
+       strcpy((char *)buf, p);
        setenv("hwkey", (char *)buf);
        printf("set hwkey=%s\n", buf);
        printf("Execute manually saveenv for persistent storage.\n");
index 6b96bd526e8026c9c2455d91c5c42b7e3adc145f..226217570c261b0f9932cdbcd2776d1365098b2e 100644 (file)
@@ -698,12 +698,12 @@ void video_get_info_str (int line_number, char *info)
                s=getenv ("serial#");
 #ifdef CONFIG_PIP405
                if (!s || strncmp (s, "PIP405", 6)) {
-                       sprintf(buf,"### No HW ID - assuming PIP405");
+                       strcpy(buf,"### No HW ID - assuming PIP405");
                }
 #endif
 #ifdef CONFIG_MIP405
                if (!s || strncmp (s, "MIP405", 6)) {
-                       sprintf(buf,"### No HW ID - assuming MIP405");
+                       strcpy(buf,"### No HW ID - assuming MIP405");
                }
 #endif
                else {
@@ -718,7 +718,7 @@ void video_get_info_str (int line_number, char *info)
                                }
                                buf[i++] = *s;
                        }
-                       sprintf(&buf[i]," SN ");
+                       strcpy(&buf[i]," SN ");
                        i+=4;
                        for (; s < e; ++s) {
                                buf[i++] = *s;
@@ -744,7 +744,7 @@ void video_get_info_str (int line_number, char *info)
                        ctfb.modeIdent);
                return;
        case 1:
-               sprintf (buf, "%s",CONFIG_IDENT_STRING);
+               strcpy(buf, CONFIG_IDENT_STRING);
                sprintf (info, " %s", &buf[1]);
                return;
     }
index c25b486f4a91610dc451126809aa2171983d07ce..426ae14af26db0e19da90e0a75201095d802f3b7 100644 (file)
@@ -355,10 +355,10 @@ int exynos_init(void)
        }
 
        /* Request soft I2C gpios */
-       sprintf(buf, "soft_i2c_scl");
+       strcpy(buf, "soft_i2c_scl");
        gpio_request(CONFIG_SOFT_I2C_GPIO_SCL, buf);
 
-       sprintf(buf, "soft_i2c_sda");
+       strcpy(buf, "soft_i2c_sda");
        gpio_request(CONFIG_SOFT_I2C_GPIO_SDA, buf);
 
        check_hw_revision();
index f94e3e5736f3644fe0e3d7ba34bbde3efb753272..b3c666c054f1060fccc61edfd5679d2801cdbc00 100644 (file)
@@ -480,7 +480,7 @@ int board_late_init(void)
                sprintf(tmp, "%s_%s", factory_dat.asn,
                        factory_dat.comp_version);
        else
-               sprintf(tmp, "QMX7.E38_4.0");
+               strcpy(tmp, "QMX7.E38_4.0");
 
        ret = setenv("boardid", tmp);
        if (ret)
index 638d14f6d06ee95929c1b1b5d554a48ef23742cc..ac44e32341ff3f94c4e4779331416e9b7ac6f583 100644 (file)
@@ -346,7 +346,7 @@ int board_late_init(void)
 
        /* get production data */
        if (read_eeprom(&header)) {
-               sprintf(model, "211");
+               strcpy(model, "211");
        } else {
                sprintf(model, "%d", header.SystemId);
                if (header.SystemId == 215) {
index 86e694ac69c42c314a28d5214dae9972469858a0..5190cc6c0fe0a11fba99985681f08526bf449606 100644 (file)
@@ -288,9 +288,10 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                                                  (size_t)255));
                } else {
                        tmp = getenv("bootdev");
-                       if (tmp)
-                               ptr = sprintf(build_buf, tmp);
-                       else
+                       if (tmp) {
+                               strcpy(build_buf, tmp);
+                               ptr = strlen(tmp);
+                       } else
                                printf("## VxWorks boot device not specified\n");
 
                        tmp = getenv("bootfile");
@@ -331,8 +332,10 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                                ptr += sprintf(build_buf + ptr, "tn=%s ", tmp);
 
                        tmp = getenv("othbootargs");
-                       if (tmp)
-                               ptr += sprintf(build_buf + ptr, tmp);
+                       if (tmp) {
+                               strcpy(build_buf + ptr, tmp);
+                               ptr += strlen(tmp);
+                       }
 
                        memcpy((void *)bootaddr, build_buf,
                               max(strlen(build_buf), (size_t)255));
index 422c069513843f930ce1eeccf2a9aa2e89b7fcf1..dab195841a74fbeed0104e0f6d6f55328b682472 100644 (file)
@@ -1086,7 +1086,7 @@ static int generate_mtdparts(char *buf, u32 buflen)
                return 0;
        }
 
-       sprintf(p, "mtdparts=");
+       strcpy(p, "mtdparts=");
        p += 9;
 
        list_for_each(dentry, &devices) {
index 1e5cb330cd5566f3d638ce2ad1f9a2378f802263..08872d6a03f4f43454f35a2bb0e8a75defc6159c 100644 (file)
@@ -237,7 +237,7 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc,
                                        break;
                        }
                        /* sprintf(info->type, "%d, pt->sys_ind); */
-                       sprintf ((char *)info->type, "U-Boot");
+                       strcpy((char *)info->type, "U-Boot");
                        info->bootable = is_bootable(pt);
 #ifdef CONFIG_PARTITION_UUIDS
                        sprintf(info->uuid, "%08x-%02x", disksig, part_num);
@@ -273,7 +273,7 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc,
                info->size = dev_desc->lba;
                info->blksz = DOS_PART_DEFAULT_SECTOR;
                info->bootable = 0;
-               sprintf ((char *)info->type, "U-Boot");
+               strcpy((char *)info->type, "U-Boot");
 #ifdef CONFIG_PARTITION_UUIDS
                info->uuid[0] = 0;
 #endif
index 22dfbb16b56c0ad36932ebfeca431af20498d658..e1b58c54b45b9c03e515a0b0ddca18f9825308c5 100644 (file)
@@ -281,7 +281,7 @@ int get_partition_info_efi(block_dev_desc_t * dev_desc, int part,
 
        sprintf((char *)info->name, "%s",
                        print_efiname(&gpt_pte[part - 1]));
-       sprintf((char *)info->type, "U-Boot");
+       strcpy((char *)info->type, "U-Boot");
        info->bootable = is_bootable(&gpt_pte[part - 1]);
 #ifdef CONFIG_PARTITION_UUIDS
        uuid_bin_to_str(gpt_pte[part - 1].unique_partition_guid.b, info->uuid,
index 0b1ac606374bbbf781e95dbe0ebf886335703bf7..5f4bb182dd28a5f5f94db1b353514ef509f3c36a 100644 (file)
@@ -137,7 +137,7 @@ int get_partition_info_iso_verb(block_dev_desc_t * dev_desc, int part_num, disk_
        /* the validation entry seems to be ok, now search the "partition" */
        entry_num=0;
        offset=0x20;
-       sprintf ((char *)info->type, "U-Boot");
+       strcpy((char *)info->type, "U-Boot");
        switch(dev_desc->if_type) {
                case IF_TYPE_IDE:
                case IF_TYPE_SATA:
index 9e8b067cdc890ca77f653173455ab3006501ccca..b14985a027dc8b25ed47ddbf05b87d2b271ab4b6 100644 (file)
@@ -626,7 +626,7 @@ int scan_sata(int dev)
                        if (id[162] & 1)
                                printf("supports DRM functions and may "
                                        "not be fully accessable.\n");
-                       sprintf(revbuf, "%s", "CFA");
+                       strcpy(revbuf, "CFA");
                } else {
                        if (ata_id_has_tpm(id))
                                printf("supports DRM functions and may "
@@ -653,7 +653,7 @@ int scan_sata(int dev)
                                ncq_desc[0] = '\0';
 
                        if (ata_dev->horkage & ATA_HORKAGE_NONCQ)
-                               sprintf(ncq_desc, "%s", "NCQ (not used)");
+                               strcpy(ncq_desc, "NCQ (not used)");
 
                        if (ap.flags & ATA_FLAG_NCQ)
                                ata_dev->flags |= ATA_DFLAG_NCQ;
index 3eaa27067772a4b18dd2f6d31bf2bf055b76a3e4..92a1b644958cf7050e96a66ba5afa62f2ba456ad 100644 (file)
@@ -417,7 +417,7 @@ static int tse_mdio_init(const char *name, struct altera_tse_priv *priv)
 
        bus->read = tse_mdio_read;
        bus->write = tse_mdio_write;
-       snprintf(bus->name, sizeof(bus->name), name);
+       snprintf(bus->name, sizeof(bus->name), "%s", name);
 
        bus->priv = (void *)priv;
 
index d51e098c560f2d0a3d6b04e7a1762485ac6fcf16..26595929c51b91b64c41ded84bdc6caeaf1b3117 100644 (file)
@@ -490,7 +490,7 @@ int at91emac_register(bd_t *bis, unsigned long iobase)
        memset(emacfix, 0, sizeof(emac_device));
 
        memset(dev, 0, sizeof(*dev));
-       sprintf(dev->name, "emac");
+       strcpy(dev->name, "emac");
        dev->iobase = iobase;
        dev->priv = emacfix;
        dev->init = at91emac_init;
index ded9e064e51aa6d03e6632a5f79d7b840d6a303c..43a67a514bb911ae766cc4d96b784d71a6d94a87 100644 (file)
@@ -722,7 +722,7 @@ int ax88180_initialize (bd_t * bis)
 
        memset (priv, 0, sizeof *priv);
 
-       sprintf (dev->name, "ax88180");
+       strcpy(dev->name, "ax88180");
        dev->iobase = AX88180_BASE;
        dev->priv = priv;
        dev->init = ax88180_init;
index 3dff9df3779d28e95c422a28162ddeb982f7874d..71047544634e6e73707832d08f54d03e5f24e84a 100644 (file)
@@ -567,7 +567,7 @@ static void cpsw_mdio_init(const char *name, u32 mdio_base, u32 div)
 
        bus->read = cpsw_mdio_read;
        bus->write = cpsw_mdio_write;
-       sprintf(bus->name, name);
+       strcpy(bus->name, name);
 
        mdio_register(bus);
 }
index 04447953c92f1efea7b4cc577e7c3c93debc352d..92c3dcae3c96d36ef1bbccc12f4e552123fe37ba 100644 (file)
@@ -777,7 +777,7 @@ int davinci_emac_initialize(void)
                return -1;
 
        memset(dev, 0, sizeof *dev);
-       sprintf(dev->name, "DaVinci-EMAC");
+       strcpy(dev->name, "DaVinci-EMAC");
 
        dev->iobase = 0;
        dev->init = davinci_eth_open;
index 0fccbc0040a9c8a88a81e7c79c268d92f3ed5a08..68b6548309ef8b6a1a929de0b372f41656962a1f 100644 (file)
@@ -81,7 +81,7 @@ static int dw_mdio_init(const char *name, struct eth_mac_regs *mac_regs_p)
 
        bus->read = dw_mdio_read;
        bus->write = dw_mdio_write;
-       snprintf(bus->name, sizeof(bus->name), name);
+       snprintf(bus->name, sizeof(bus->name), "%s", name);
 
        bus->priv = (void *)mac_regs_p;
 
index 3c41cec3e4d30f8b28d71a7f077a61232e302972..93c6667bca9a5773d9f5efefc049bc80b1b35e67 100644 (file)
@@ -630,7 +630,7 @@ int dm9000_initialize(bd_t *bis)
        dev->halt = dm9000_halt;
        dev->send = dm9000_send;
        dev->recv = dm9000_rx;
-       sprintf(dev->name, "dm9000");
+       strcpy(dev->name, "dm9000");
 
        eth_register(dev);
 
index 4ab78e6c253e0e1a8665711b5f0899f01768e66f..507934268260ae2613f4b28a598dcced709ebb51 100644 (file)
@@ -146,7 +146,7 @@ int fm_memac_mdio_init(bd_t *bis, struct memac_mdio_info *info)
        bus->read = memac_mdio_read;
        bus->write = memac_mdio_write;
        bus->reset = memac_mdio_reset;
-       sprintf(bus->name, info->name);
+       strcpy(bus->name, info->name);
 
        bus->priv = info->regs;
 
index 24cb17b6edde1790fe0954e873e70cc8b2413d8e..f038541c8dec17a9ec588216172b86c3597c71dd 100644 (file)
@@ -118,7 +118,7 @@ int fm_tgec_mdio_init(bd_t *bis, struct tgec_mdio_info *info)
        bus->read = tgec_mdio_read;
        bus->write = tgec_mdio_write;
        bus->reset = tgec_mdio_reset;
-       sprintf(bus->name, info->name);
+       strcpy(bus->name, info->name);
 
        bus->priv = info->regs;
 
index d6b181b38604c4dd4133646baf07d641200f7551..f48bbc312390aaa6846142271f033c25c1f84008 100644 (file)
@@ -104,7 +104,7 @@ int fsl_pq_mdio_init(bd_t *bis, struct fsl_pq_mdio_info *info)
        bus->read = tsec_phy_read;
        bus->write = tsec_phy_write;
        bus->reset = fsl_pq_mdio_reset;
-       sprintf(bus->name, info->name);
+       strcpy(bus->name, info->name);
 
        bus->priv = (void *)info->regs;
 
index 515f0b2746cd86c035e76e8f74200ea1a31a9c2a..5ccc4beda817891edf8fdc39f69711eb8b36f94a 100644 (file)
@@ -562,7 +562,7 @@ int ftgmac100_initialize(bd_t *bd)
        memset(dev, 0, sizeof(*dev));
        memset(priv, 0, sizeof(*priv));
 
-       sprintf(dev->name, "FTGMAC100");
+       strcpy(dev->name, "FTGMAC100");
        dev->iobase     = CONFIG_FTGMAC100_BASE;
        dev->init       = ftgmac100_init;
        dev->halt       = ftgmac100_halt;
index bd94f83f04472a3997381e8264641e717c292cd6..1fc7da9a3e71cda2cf6bc5b63d5c8c06512f9781 100644 (file)
@@ -246,7 +246,7 @@ int ftmac100_initialize (bd_t *bd)
        memset (dev, 0, sizeof (*dev));
        memset (priv, 0, sizeof (*priv));
 
-       sprintf (dev->name, "FTMAC100");
+       strcpy(dev->name, "FTMAC100");
        dev->iobase     = CONFIG_FTMAC100_BASE;
        dev->init       = ftmac100_init;
        dev->halt       = ftmac100_halt;
index 088cb229da17f7c4d2d4f6c7098f81e418824f6e..aa5d7114a5b8ddf0d164632eda0c634fa72318ac 100644 (file)
@@ -640,9 +640,9 @@ int greth_initialize(bd_t * bis)
 
        /* Make descriptor string */
        if (greth->gbit_mac) {
-               sprintf(dev->name, "GRETH_10/100/GB");
+               strcpy(dev->name, "GRETH_10/100/GB");
        } else {
-               sprintf(dev->name, "GRETH_10/100");
+               strcpy(dev->name, "GRETH_10/100");
        }
 
        /* initiate PHY, select speed/duplex depending on connected PHY */
index 24ca52e2dfb950c5e6562b8313d8fbb6a12870a0..209fae94a77b69cbea2426e25d786adc0bbfe3be 100644 (file)
@@ -586,7 +586,7 @@ int keystone2_emac_initialize(struct eth_priv_t *eth_priv)
                mdio_bus->write = keystone2_mdio_write;
                mdio_bus->reset = keystone2_mdio_reset;
                mdio_bus->priv  = (void *)EMAC_MDIO_BASE_ADDR;
-               sprintf(mdio_bus->name, "ethernet-mdio");
+               strcpy(mdio_bus->name, "ethernet-mdio");
 
                res = mdio_register(mdio_bus);
                if (res)
index 69530b11cf1074f31c984c3e13e65f30e9e2be91..3857122bd05c1f057b3d5aec911b5f5de9cacd02 100644 (file)
@@ -628,11 +628,11 @@ static int ldpaa_dpmac_bind(struct ldpaa_eth_priv *priv)
 #endif
 
        memset(&dpmac_endpoint, 0, sizeof(struct dprc_endpoint));
-       sprintf(dpmac_endpoint.type, "dpmac");
+       strcpy(dpmac_endpoint.type, "dpmac");
        dpmac_endpoint.id = priv->dpmac_id;
 
        memset(&dpni_endpoint, 0, sizeof(struct dprc_endpoint));
-       sprintf(dpni_endpoint.type, "dpni");
+       strcpy(dpni_endpoint.type, "dpni");
        dpni_endpoint.id = dflt_dpni->dpni_id;
 
        err = dprc_connect(dflt_mc_io, MC_CMD_NO_FLAGS,
index 3ba5b4b1f9b32ba44145e8842913c423ba9ff397..6cc273c33c81f046b1ce4f555d590213eddaa77a 100644 (file)
@@ -582,7 +582,7 @@ int lpc32xx_eth_phylib_init(struct eth_device *dev, int phyid)
        }
        bus->read = lpc32xx_eth_phy_read;
        bus->write = lpc32xx_eth_phy_write;
-       sprintf(bus->name, dev->name);
+       strcpy(bus->name, dev->name);
 
        ret = mdio_register(bus);
        if (ret) {
index 22ea114f01bd7674bcf9a948bfb06b7e5af85945..e850672a4ffbd16af02924ae3e90abb2d23d0285 100644 (file)
@@ -635,7 +635,7 @@ int mpc512x_fec_initialize (bd_t * bis)
        dev->send = mpc512x_fec_send;
        dev->recv = mpc512x_fec_recv;
 
-       sprintf (dev->name, "FEC");
+       strcpy(dev->name, "FEC");
        eth_register (dev);
 
 #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
index 2ebd1761c3e7315fc904b152c709cc7657959a96..e13b4cf32b4b91a02c76f9d760426ed30de3842a 100644 (file)
@@ -913,7 +913,7 @@ int mpc5xxx_fec_initialize(bd_t * bis)
        dev->send = mpc5xxx_fec_send;
        dev->recv = mpc5xxx_fec_recv;
 
-       sprintf(dev->name, "FEC");
+       strcpy(dev->name, "FEC");
        eth_register(dev);
 
 #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
index ab5aa68fc8cf7ce41d51d2222e0c225a83dc7fa0..b16be9214289dd976e02cd9737e135264a3a51ae 100644 (file)
@@ -675,7 +675,7 @@ int mvgbe_phylib_init(struct eth_device *dev, int phyid)
        }
        bus->read = mvgbe_phy_read;
        bus->write = mvgbe_phy_write;
-       sprintf(bus->name, dev->name);
+       strcpy(bus->name, dev->name);
 
        ret = mdio_register(bus);
        if (ret) {
index 07a7cec2a85971089e7d07fa2da2c698245f0256..887cfd957b3e11cce0afcda349275511c4e35331 100644 (file)
@@ -794,7 +794,7 @@ int ne2k_register(void)
        dev->send = ne2k_send;
        dev->recv = ne2k_recv;
 
-       sprintf(dev->name, "NE2000");
+       strcpy(dev->name, "NE2000");
 
        return eth_register(dev);
 }
index 1b4dd56d52b3e5895b6f5c0787f9fa204bc5f40f..56d29d47af71c33750fc5954fafee7dffc6b0601 100644 (file)
@@ -386,7 +386,7 @@ static int pch_gbe_mdio_init(const char *name, struct pch_gbe_regs *mac_regs)
 
        bus->read = pch_gbe_mdio_read;
        bus->write = pch_gbe_mdio_write;
-       sprintf(bus->name, name);
+       strcpy(bus->name, name);
 
        bus->priv = (void *)mac_regs;
 
index a320b4d75b628febc3a6d7b36b4145537920da58..443a4da52752d8f1b044e69908cdbe8ca4d35fec 100644 (file)
@@ -560,7 +560,7 @@ int sh_eth_initialize(bd_t *bd)
        dev->recv = sh_eth_recv;
        eth->port_info[eth->port].dev = dev;
 
-       sprintf(dev->name, SHETHER_NAME);
+       strcpy(dev->name, SHETHER_NAME);
 
        /* Register Device to EtherNet subsystem  */
        eth_register(dev);
index 4bdc188c8f395551ddce7db00c6031fdc66acae1..9b09caf8c8322cce6254c01b4211bf2fe3ea76d2 100644 (file)
@@ -632,7 +632,7 @@ static int tsec_initialize(bd_t *bis, struct tsec_info_struct *tsec_info)
        priv->phyaddr = tsec_info->phyaddr;
        priv->flags = tsec_info->flags;
 
-       sprintf(dev->name, tsec_info->devname);
+       strcpy(dev->name, tsec_info->devname);
        priv->interface = tsec_info->interface;
        priv->bus = miiphy_get_dev_by_name(tsec_info->mii_devname);
        dev->iobase = 0;
index 20b6c18b9cfd20c6a659fd14b99e0759c300ea5b..87e54ebec76be84669129be60e30a9c01429b7de 100644 (file)
@@ -477,7 +477,7 @@ static void rx_handler_dl_image(struct usb_ep *ep, struct usb_request *req)
                req->complete = rx_handler_command;
                req->length = EP_BUFFER_SIZE;
 
-               sprintf(response, "OKAY");
+               strcpy(response, "OKAY");
                fastboot_tx_write_str(response);
 
                printf("\ndownloading of %d bytes finished\n", download_bytes);
@@ -506,10 +506,10 @@ static void cb_download(struct usb_ep *ep, struct usb_request *req)
        printf("Starting download of %d bytes\n", download_size);
 
        if (0 == download_size) {
-               sprintf(response, "FAILdata invalid size");
+               strcpy(response, "FAILdata invalid size");
        } else if (download_size > CONFIG_FASTBOOT_BUF_SIZE) {
                download_size = 0;
-               sprintf(response, "FAILdata too large");
+               strcpy(response, "FAILdata too large");
        } else {
                sprintf(response, "DATA%08x", download_size);
                req->complete = rx_handler_dl_image;
index ec0a812aa12805b1f5f4b412581abadc09fbd925..2d941ca65b0eb7cc4993adc6a67dd159d9ceb0a5 100644 (file)
@@ -384,7 +384,7 @@ do {                                                                \
                if (i)                                          \
                        sprintf(ethname, "eth%daddr", i);       \
                else                                            \
-                       sprintf(ethname, "ethaddr");            \
+                       strcpy(ethname, "ethaddr");             \
                printf("Setting %s from EEPROM with %s\n", ethname, buf);\
                setenv(ethname, buf);                           \
        }                                                       \
index 315ce2c7cb9dbc48b545329ee144c27e569d5c81..953d5c75e5de76bd23c2158babfcd491195064e9 100644 (file)
@@ -379,7 +379,7 @@ static void update_text(char *buf, size_t start, size_t end, void *_data)
                                data->targets[k] = pos->target;
                                k++;
                        } else {
-                               sprintf(header, "   ");
+                               strcpy(header, "   ");
                        }
 
                        memcpy(buf + pos->offset, header, sizeof(header) - 1);