OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b80308
)
net: fec: replace snprintf() with strlcpy() in fec_ptp_init()
author
Sergey Organov
<sorganov@gmail.com>
Wed, 15 Jul 2020 15:43:00 +0000
(18:43 +0300)
committer
Jakub Kicinski
<kuba@kernel.org>
Thu, 16 Jul 2020 18:32:03 +0000
(11:32 -0700)
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>
drivers/net/ethernet/freescale/fec_ptp.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/freescale/fec_ptp.c
b/drivers/net/ethernet/freescale/fec_ptp.c
index
0c8c56b
..
93a8655
100644
(file)
--- 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;
- s
nprintf(fep->ptp_caps.name, 16, "fec ptp"
);
+ s
trlcpy(fep->ptp_caps.name, "fec ptp", sizeof(fep->ptp_caps.name)
);
fep->ptp_caps.max_adj = 250000000;
fep->ptp_caps.n_alarm = 0;