|
|
Subscribe / Log in / New account

Re: syscall_get_error() && TS_ checks

From:  Linus Torvalds <torvalds-AT-linux-foundation.org>
To:  Oleg Nesterov <oleg-AT-redhat.com>
Subject:  Re: syscall_get_error() && TS_ checks
Date:  Wed, 29 Mar 2017 09:59:38 -0700
Message-ID:  <CA+55aFzbbLZaWvg+vTEKrfzZkwb=iAVUK5cZu2LxdbevZiGJ2g@mail.gmail.com>
Cc:  Andrew Morton <akpm-AT-linux-foundation.org>, Andy Lutomirski <luto-AT-kernel.org>, Denys Vlasenko <dvlasenk-AT-redhat.com>, "H. Peter Anvin" <hpa-AT-zytor.com>, Ingo Molnar <mingo-AT-redhat.com>, Jan Kratochvil <jan.kratochvil-AT-redhat.com>, Pedro Alves <palves-AT-redhat.com>, Thomas Gleixner <tglx-AT-linutronix.de>, "the arch/x86 maintainers" <x86-AT-kernel.org>, Linux Kernel Mailing List <linux-kernel-AT-vger.kernel.org>

On Wed, Mar 29, 2017 at 9:55 AM, Oleg Nesterov <oleg@redhat.com> wrote:
>
> Once again, it is only used in arch/x86/kernel/signal.c by do_signal() and
> handle_signal(). We do not care if mmap() returns a valid pointer with the
> high bit set, regs-ax can't be confused with -ERESTART code.

Immaterial. If the function is called "get_error()", it sure as hell
shouldn't return a random non-error value.

Code should make sense, otherwise it's not going to be maintainable.
Naming matters. If the code doesn't match the name of the function,
that's a bug regardless of whether it has semantic effects or not in
the end - because somebody will eventually depend on the _expected_
semantics.

              Linus



to post comments


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds