retire bcmp, a redundant wrapper around memcmp
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | x86/callthunks: s/bcmp/memcmp/arch/ | +3 | 0 replies | |
| 2/2 | string: retire bcmp()arch/ arch/ include/ +2 more | +1 | 4 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] retire bcmp, a redundant wrapper around memcmp
Reasoning copied from patch 2:
Quoted 11 lines
While architectures could override it thanks to
__HAVE_ARCH_BCMP, none of them did. Instead it was implemented as a call tomemcmp().These routines differ in the API contract: memcmp()'s result indicates which way the difference goes (making it usable for sorting), whereas bcmp()'s result merely states whether the buffers differ in any way.
This means that a dedicated optimized
bcmp()is cheaper to execute thanmemcmp()for differing buffers as there is no need to compute the return value.
Quoted 5 lines
However, per the above nobody bothered to write one and it is unclear if it makes sense to do it.
Users which really want to compare stuff may want to handle it differently (like e.g., the path lookup).
Mateusz Guzik (2):
x86/callthunks: s/bcmp/memcmp/
string: retire bcmp()
arch/x86/boot/string.c | 8 -------- arch/x86/boot/string.h | 1 - arch/x86/kernel/callthunks.c | 6 +++--- include/linux/string.h | 3 --- lib/Makefile | 3 +-- lib/string.c | 19 ------------------- 6 files changed, 4 insertions(+), 36 deletions(-)
Signature · 1 line
2.43.0