Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753152AbdC2Q7l (ORCPT ); Wed, 29 Mar 2017 12:59:41 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:38148 "EHLO mail-it0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752256AbdC2Q7k (ORCPT ); Wed, 29 Mar 2017 12:59:40 -0400 MIME-Version: 1.0 In-Reply-To: <20170329165554.GA24250@redhat.com> References: <20170328145413.GA3164@redhat.com> <20170329163335.GA23977@redhat.com> <20170329165554.GA24250@redhat.com> From: Linus Torvalds Date: Wed, 29 Mar 2017 09:59:38 -0700 X-Google-Sender-Auth: o5WDMQ-Lh1SajAY5tw7CUGRTGL0 Message-ID: Subject: Re: syscall_get_error() && TS_ checks To: Oleg Nesterov Cc: Andrew Morton , Andy Lutomirski , Denys Vlasenko , "H. Peter Anvin" , Ingo Molnar , Jan Kratochvil , Pedro Alves , Thomas Gleixner , "the arch/x86 maintainers" , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 711 Lines: 16 On Wed, Mar 29, 2017 at 9:55 AM, Oleg Nesterov 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