Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4251524ybi; Mon, 15 Jul 2019 06:14:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwW5v2Tppn76rrzDJJe6q7djSn6SGXzpnogR/ofyo9eqAgqBSnFL9QOIa6rk7vHQjAUFPTW X-Received: by 2002:a17:902:61:: with SMTP id 88mr26985143pla.50.1563196464286; Mon, 15 Jul 2019 06:14:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563196464; cv=none; d=google.com; s=arc-20160816; b=W9WgfgjD0/Xg2hxi6YFxCEAPxTtsVAfXCqz7ICTb4p35FsN3BcfMS1fpGWPbfiXttf Ju1Lj+UIvKDUrQKY3H08NCz5vFuWakf6TtIKl1uQ6+xlC1kvv57tezysWItBtgkL0A03 7vDn6D231/GyHgj7osXgwl6BOrgsKKRllthJvZRWlg0m9dTlOcNbT1sYExgOd8rg1X4F JesToZrxPNXctL9USNSFGiRgg+qrfNdtDC8U2/sTzaOcQwKzpHm2jTX7pjNGS079fsi/ 4kBOgiE4WdoesK+9tiVVntYfhK+LHf/l9uhfIJ19pyQ+FOSRF0HlMwX8oQ3XP21wNtTh sBIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=bFciuwRNJvKJfDESsU8pAi/mfWsocePG9tI24bi8nB4=; b=PpEyZHHqZ4eIdDxiyqt+4dWa3Dj7HKXFcFTy4lls5vx9O3Ys35qG1cMqWe9MuhedEe iktI2078hvHbZwukVMNfKia/7OyQ94XcXI3oHize3cYoebwvFLsXpVcYG0A6LVpidjOX CEvi/Z1xOSChLL8VSVg5PJWtml3QHYt65vueiOPCQ2w+nuYsxhtKqnIhkFAIUMyjo/dU cMPu+IC8lyuBdSHKbCBDvZO2I9MnXZV+PuSmQoZg2sMN+agelt0yRlmLNFrqdKkYHTAU 3PR92Msim3i9cZF0eroHyFvI0SrTCaFNgjpkO2MFvOIt9Pecwlb/xTI5fMeywkXr9bPb n1PA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cj14si15438971plb.141.2019.07.15.06.14.05; Mon, 15 Jul 2019 06:14:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730137AbfGONNg (ORCPT + 99 others); Mon, 15 Jul 2019 09:13:36 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:47662 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730071AbfGONNf (ORCPT ); Mon, 15 Jul 2019 09:13:35 -0400 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hn0nN-0006W2-9L; Mon, 15 Jul 2019 15:13:33 +0200 Date: Mon, 15 Jul 2019 15:13:32 +0200 (CEST) From: Thomas Gleixner To: Vasily Averin cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Ingo Molnar , Arnd Bergmann Subject: Re: [PATCH] generic arch_futex_atomic_op_inuser() cleanup In-Reply-To: <7b963f9a-21b1-4c6d-3ece-556d018508b4@virtuozzo.com> Message-ID: References: <7b963f9a-21b1-4c6d-3ece-556d018508b4@virtuozzo.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 15 Jul 2019, Vasily Averin wrote: > Access to 'op' variable does not require pagefault_disable(), > 'ret' variable should be initialized before using, > 'oldval' variable can be replaced by constant. > > Signed-off-by: Vasily Averin > --- > include/asm-generic/futex.h | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/include/asm-generic/futex.h b/include/asm-generic/futex.h > index 8666fe7f35d7..e9a9655d786d 100644 > --- a/include/asm-generic/futex.h > +++ b/include/asm-generic/futex.h > @@ -118,9 +118,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, > static inline int > arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user *uaddr) > { > - int oldval = 0, ret; > - > - pagefault_disable(); > + int ret = 0; The variable is clearly initialized before using in 'default:', but the whole function is pretty useless. It's guaranteed to return -ENOSYS and does nothing else than disabling/enabling pagefaults for no reason. Thanks, tglx