From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757171AbcCaOZk (ORCPT ); Thu, 31 Mar 2016 10:25:40 -0400 Received: from lxorguk.ukuu.org.uk ([81.2.110.251]:48922 "EHLO lxorguk.ukuu.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757037AbcCaOZh (ORCPT ); Thu, 31 Mar 2016 10:25:37 -0400 Date: Thu, 31 Mar 2016 15:25:27 +0100 From: One Thousand Gnomes To: Jiri Slaby Cc: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] tty: vt, remove reduntant check Message-ID: <20160331152527.4beefda9@lxorguk.ukuu.org.uk> In-Reply-To: <1459411697-26019-1-git-send-email-jslaby@suse.cz> References: <1459411697-26019-1-git-send-email-jslaby@suse.cz> Organization: Intel Corporation X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 31 Mar 2016 10:08:14 +0200 Jiri Slaby wrote: > MAX_NR_CONSOLES and MAX_NR_USER_CONSOLES are both 63 since they were > introduced in 1.1.54. And since vc_allocate does: > > if (currcons >= MAX_NR_CONSOLES) > return -ENXIO; > > if (!vc_cons[currcons].d) { > if (currcons >= MAX_NR_USER_CONSOLES && !capable(CAP_SYS_RESOURCE)) > return -EPERM; > } > > the second check is pointless. Remove both the check and the macro > MAX_NR_USER_CONSOLES. Actually going back over that ignore the NAK - they change both MAX_NR and MAX_NR_USER so the assertion is still true. Alan