Add kvmemdup() as a variant of kmemdup().
This is used by an updated wireless driver.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Paths
| Differential D45181 Authored by bz on May 13 2024, 5:44 PM.
Details
Summary Add kvmemdup() as a variant of kmemdup(). Sponsored by: The FreeBSD Foundation
Diff Detail
Event TimelineHerald added subscribers: emaste, imp. · View Herald TranscriptMay 13 2024, 5:44 PM2024-05-13 17:44:41 (UTC+0) Harbormaster completed remote builds in B57688: Diff 138487.May 13 2024, 5:44 PM2024-05-13 17:44:41 (UTC+0) Comment Actions Do we have our approach documented somewhere? This looks acceptable given that we already #define kvfree(arg) kfree(arg) but it would be good to have that mentioned somewhere. This revision is now accepted and ready to land.May 14 2024, 1:03 AM2024-05-14 01:03:26 (UTC+0) Comment Actions
Other than the way we both looked probably not. kvfree() pre-dated me by a few years and given it is in slab.h I am not sure if there is a single place to document this well. In theory I should probablu duplicate kmemdup and use kvmalloc() so in case someone ever decided to re-define kvmalloc/kvfree we wouldn't notice? Comment Actions Duplicate the implmentation and add a comment for kvmalloc/kvfree in slab.h I'll update the proposed commit message locally. This revision now requires review to proceed.May 14 2024, 11:01 PM2024-05-14 23:01:06 (UTC+0) Harbormaster completed remote builds in B57707: Diff 138556.May 14 2024, 11:01 PM2024-05-14 23:01:12 (UTC+0) Comment Actions
Yeah that's better I think; I was thinking that a comment about us not having a distinction would be sufficient but this is future-proof against someone separating kmalloc from kvmalloc in the future. This revision is now accepted and ready to land.May 14 2024, 11:25 PM2024-05-14 23:25:41 (UTC+0) Closed by commit rG8e4b8e9d807a: LinuxKPI: add kvmemdup() (authored by bz). · Explain WhyMay 21 2024, 10:15 PM2024-05-21 22:15:46 (UTC+0) This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 138556 sys/compat/linuxkpi/common/include/linux/string.h
|
Nothing in mxge needs giant