diff options
author | Sergey Organov <sorganov@gmail.com> | 2020-07-15 18:43:00 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-07-16 11:32:03 -0700 |
commit | 31bb1a560b2996f9953cfc232f6349d043aaab49 (patch) | |
tree | 22e323bdd9a13987d359133b4c2ff5546068b43b /drivers/net | |
parent | 2b803088865e459beffa1d153ad59db72d1c726a (diff) |
net: fec: replace snprintf() with strlcpy() in fec_ptp_init()
No need to use snprintf() on a constant string, nor using magic
constant in the fixed code was a good idea.
Signed-off-by: Sergey Organov <sorganov@gmail.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_ptp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c index 0c8c56bdd7ac..93a86553147c 100644 --- a/drivers/net/ethernet/freescale/fec_ptp.c +++ b/drivers/net/ethernet/freescale/fec_ptp.c @@ -570,7 +570,7 @@ void fec_ptp_init(struct platform_device *pdev, int irq_idx) int ret; fep->ptp_caps.owner = THIS_MODULE; - snprintf(fep->ptp_caps.name, 16, "fec ptp"); + strlcpy(fep->ptp_caps.name, "fec ptp", sizeof(fep->ptp_caps.name)); fep->ptp_caps.max_adj = 250000000; fep->ptp_caps.n_alarm = 0; |