提交 31bb1a56 编写于 作者: S Sergey Organov 提交者: Jakub Kicinski

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: NSergey Organov <sorganov@gmail.com>
Acked-by: NFugang Duan <fugang.duan@nxp.com>
Signed-off-by: NJakub Kicinski <kuba@kernel.org>
上级 2b803088
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册