summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/bitops.h
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2023-08-15 14:55:23 +0300
committerWilly Tarreau <w@1wt.eu>2023-08-23 06:17:07 +0300
commit556fb7131e03b0283672fb40f6dc2d151752aaa7 (patch)
tree9008c701a9255c194b874f35958c9f084c7debe8 /arch/x86/include/asm/bitops.h
parentfb01ff635efd0aba862c843587554167aacc4d2f (diff)
downloadlinux-556fb7131e03b0283672fb40f6dc2d151752aaa7.tar.xz
tools/nolibc: avoid undesired casts in the __sysret() macro
Having __sysret() as an inline function has the unfortunate effect of adding casts and large constants comparisons after the syscall returns that significantly inflate some light code that's otherwise syscall- heavy. Even nolibc-test grew by ~1%. Let's switch back to a macro for this, and use it only with signed arguments. Note that it is also possible to design a slightly more complex macro covering unsigned and pointers but we only have 3 such syscalls so it is pointless, and these were just addressed not to use this macro anymore. Now for the argument (the local variable containing the syscall return value), any negative value is an error, that results in -1 being returned and errno to be assigned the opposite value. This may be revisited again in the future if really needed but for now let's get back to something sane. Fixes: 428905da6ec4 ("tools/nolibc: sys.h: add a syscall return helper") Link: https://lore.kernel.org/lkml/20230806095846.GB10627@1wt.eu/ Link: https://lore.kernel.org/lkml/ZNKOJY+g66nkIyvv@1wt.eu/ Cc: Zhangjin Wu <falcon@tinylab.org> Cc: David Laight <David.Laight@ACULAB.COM> Cc: Thomas Weißschuh <thomas@t-8ch.de> Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'arch/x86/include/asm/bitops.h')
0 files changed, 0 insertions, 0 deletions