aboutsummaryrefslogtreecommitdiff
path: root/tools/coccinelle
Commit message (Collapse)AuthorAgeFilesLines
* pseudofs: return errors from pfs_create_*()Kyle Evans2025-09-041-0/+35
| | | | | | | | | | | | | | | | | | In D52038, we kind of guess at the reason that pfs_create_dir() failed, which isn't great: it could be EEXISTS, or it could even be ENOMEM. Change the pfs_create_*() interfaces to return an error and use a double pointer to return the new node as requested. Outside of the changes in sys/fs/pseudofs, this diff is the result of running the added coccinelle script against in-tree pseudofs and fixing all of the style(9) violations that spatch added. We set *opn to NULL in the failure cases to avoid breaking callers that did actually error-check their results, since the cocci patch does not attempt to handle that in any way. Reviewed by: des (previous version), kib Differential Revision: https://reviews.freebsd.org/D52157
* copystr(9): Move to deprecate (attempt #2)Conrad Meyer2020-05-251-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reapplies logical r360944 and r360946 (reverting r360955), with fixed copystr() stand-in replacement macro. Eventually the goal is to convert consumers and kill the macro, but for a first step it helps if the macro is correct. Prior commit message: Unlike the other copy*() functions, it does not serve to copy from one address space to another or protect against potential faults. It's just an older incarnation of the now-more-common strlcpy(). Add a coccinelle script to tools/ which can be used to mechanically convert existing instances where replacement with strlcpy is trivial. In the two cases which matched, fuse_vfsops.c and union_vfsops.c, the code was further refactored manually to simplify. Replace the declaration of copystr() in systm.h with a small macro wrapper around strlcpy (with correction from brooks@ -- thanks). Remove N redundant MI implementations of copystr. For MIPS, this entailed inlining the assembler copystr into the only consumer, copyinstr, and making the latter a leaf function. Reviewed by: jhb (earlier version) Discussed with: brooks (thanks!) Differential Revision: https://reviews.freebsd.org/D24672 Notes: svn path=/head/; revision=361466
* Revert r360944 and r360946 until reported issues can be resolvedConrad Meyer2020-05-121-39/+0
| | | | | | | Reported by: cy Notes: svn path=/head/; revision=360955
* copystr(9): Move to deprecate [2/2]Conrad Meyer2020-05-111-0/+39
Unlike the other copy*() functions, it does not serve to copy from one address space to another or protect against potential faults. It's just an older incarnation of the now-more-common strlcpy(). Add a coccinelle script to tools/ which can be used to mechanically convert existing instances where replacement with strlcpy is trivial. In the two cases which matched, fuse_vfsops.c and union_vfsops.c, the code was further refactored manually to simplify. Replace the declaration of copystr() in systm.h with a small macro wrapper around strlcpy. Remove N redundant MI implementations of copystr. For MIPS, this entailed inlining the assembler copystr into the only consumer, copyinstr, and making the latter a leaf function. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D24672 Notes: svn path=/head/; revision=360944