NIOS2 updates for v6.5

- Convert pgtable constructor/destructors to ptdesc
 - Replace strlcpy with strscpy
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEoHhMeiyk5VmwVMwNGZQEC4GjKPQFAmSI7XEACgkQGZQEC4Gj
 KPRD8BAAqRXerqCyKILCABWmB2UTZPaQmHbaek8lpt/KJku2YpHW855+SmfRoQzX
 rdNvUup4sc7Vf0FbKrn4a1JGv6ON0cs3GOd+ZSXUvdoVNM8X0W4xZ6oR6GgfQ3N6
 zN3hQ1Cm8oyaPNeKXX0uWWjkLOlmzLQaYMnM9yVzWZPL5uBmCVewST6nvvjROWS8
 76u/1gyWH6nf1z7pQeGLypxwnNKNMA+NoZkF07J5SUwJUnbIxlvp2pKJYpZSqXmO
 cxcScPMHaTFHpxtn5Rp3Iyv2E6caHGbehWh2/1TCoL+qeMfUX3N4T5WGUb0bNgO3
 vEnisjUciQda9nKJ2WfwfL2ldV6qj+rmRAVJ7h5yBvevSgugGUERamDIWBPChyUr
 B3WSqy7ka1rWaMvUVsMGtdqmmucFho6oqKg2muUuUmMw0Gx3YYKIkDG2z4Le8S8p
 eLJHF/gLSsZsUg84NP2AG7HyJ81R1ShQsX6OwoBCFW21GGu0cXb/qa0zt4wRsez9
 ubo0DVgXEAkNNcdBmoo0pdNnUJommAakPlkGy6Ecbsi1r0wffoU5tvBcOKCklN2M
 K0WHoX9zgml3PNlABECwijbND35tP9O5cdTBE4CNg92ZvkKKq1uy1HpytkRr6zhX
 Fw/68lvr7VIYO4rILTew44ZrNsBM5TddjWgjQGQBOYV4OEJVy74=
 =8nRX
 -----END PGP SIGNATURE-----

Merge tag 'nios2_updates_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux

Pull nios2 updates from Dinh Nguyen:

 - Convert pgtable constructor/destructors to ptdesc

 - Replace strlcpy with strscpy

* tag 'nios2_updates_for_v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux:
  nios2: Replace all non-returning strlcpy with strscpy
  nios2: Convert __pte_free_tlb() to use ptdescs
This commit is contained in:
Linus Torvalds 2023-06-26 09:25:45 -07:00
commit be5b52dc14
3 changed files with 8 additions and 8 deletions

View File

@ -28,10 +28,10 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
extern pgd_t *pgd_alloc(struct mm_struct *mm);
#define __pte_free_tlb(tlb, pte, addr) \
do { \
pgtable_pte_page_dtor(pte); \
tlb_remove_page((tlb), (pte)); \
#define __pte_free_tlb(tlb, pte, addr) \
do { \
pagetable_pte_dtor(page_ptdesc(pte)); \
tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); \
} while (0)
#endif /* _ASM_NIOS2_PGALLOC_H */

View File

@ -47,7 +47,7 @@ void __init setup_cpuinfo(void)
str = of_get_property(cpu, "altr,implementation", &len);
if (str)
strlcpy(cpuinfo.cpu_impl, str, sizeof(cpuinfo.cpu_impl));
strscpy(cpuinfo.cpu_impl, str, sizeof(cpuinfo.cpu_impl));
else
strcpy(cpuinfo.cpu_impl, "<unknown>");

View File

@ -121,7 +121,7 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6,
dtb_passed = r6;
if (r7)
strlcpy(cmdline_passed, (char *)r7, COMMAND_LINE_SIZE);
strscpy(cmdline_passed, (char *)r7, COMMAND_LINE_SIZE);
}
#endif
@ -129,10 +129,10 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6,
#ifndef CONFIG_CMDLINE_FORCE
if (cmdline_passed[0])
strlcpy(boot_command_line, cmdline_passed, COMMAND_LINE_SIZE);
strscpy(boot_command_line, cmdline_passed, COMMAND_LINE_SIZE);
#ifdef CONFIG_NIOS2_CMDLINE_IGNORE_DTB
else
strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
strscpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
#endif
#endif