git: a2ad70923f59 - main - Add branch prediction hints to getsock_cap
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 10 Sep 2022 19:51:36 UTC
The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a2ad70923f591a2e6f1ca7766ae7d1aa14e70d11 commit a2ad70923f591a2e6f1ca7766ae7d1aa14e70d11 Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2022-09-10 19:41:34 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2022-09-10 19:41:52 +0000 Add branch prediction hints to getsock_cap --- sys/kern/uipc_syscalls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 4be1c9aa6a59..e77475992d0b 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -96,9 +96,9 @@ getsock_cap(struct thread *td, int fd, cap_rights_t *rightsp, int error; error = fget_cap(td, fd, rightsp, &fp, havecapsp); - if (error != 0) + if (__predict_false(error != 0)) return (error); - if (fp->f_type != DTYPE_SOCKET) { + if (__predict_false(fp->f_type != DTYPE_SOCKET)) { fdrop(fp, td); if (havecapsp != NULL) filecaps_free(havecapsp);