Add kvmemdup() as a variant of kmemdup().
This is used by an updated wireless driver.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential D45181
LinuxKPI: add kvmemdup() bz on May 13 2024, 5:44 PM. Authored by Tags None Referenced Files
Details
Add kvmemdup() as a variant of kmemdup(). Sponsored by: The FreeBSD Foundation
Diff Detail
Event TimelineComment 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. 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. 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. |