Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4669720yba; Mon, 20 May 2019 01:26:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyekQApt1yqeyoxBeqLYQrt4f9RKp9g6qDtzo8/YhxZN3zAuC/SaMy2Q8tRoucAuoVvW4vI X-Received: by 2002:a63:d615:: with SMTP id q21mr73236943pgg.401.1558340764199; Mon, 20 May 2019 01:26:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558340764; cv=none; d=google.com; s=arc-20160816; b=EepH0bRRArtZeq/c+2paisYGnQ3SRBtv77oe3HWEOBki3+zaZqoEQ8bzT29BmUfKLL DCX3uUA6CNpnB1yDjSz4tjWaJ/UFneYwdEaqfE4pKESw18dTFKsSBrD+mTuOPjIbUmgU JdQ7vs7avJ2UXJ5FmP0JhOK0ikJdyHsWY7u00q8ke1bL2dOVYrUMiEtlYW1TPv2i9AT0 CyGQEaYKWqzcF3/YeQtNKrHoI8Ay6Cgz3zmm393PY/AIztKlZnLLQHWf+7ozeME6glhs +et+GsgaGnlTOBnXi3xqKWJx7tWU1w/j35QYSbgZo8ryjKWksUuMkdTzRL9qnVCRIGvn Jkzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lwFpKjbpcVfpxavAIzY2FLdOXjuwdFWEEdQZCv4IdjM=; b=n4aJ/xBeX/FMiqfmTZjAjzgjr0NYv7z2xu1n32uNzXSBZKJBdAG4gTEe+U7zjUrSI+ 7rE0Vmvd+K4F2+6ApNeYm3a92e8EKZZmchHaLZZ2YlSt63anQUrTlANG3+Jy0LCQFb9S u7yXD7vELg0fCW44wdGcpjzVknxIygMj+FKQUE5fcg4kU0sfrDnGpJHasP5sEBWhOzbb T9/PCYVeXljYanE7+R6O8w9t8rWL9tFYiuUxmS+VWLP+CldUhsmVP+Ittxtuc9FjuwF7 5BGbz3axlx4zl0RoUurrmooSv26rhyDUjDitOLUwIXljIuEZt3JLipUEbbSCGHCUYNhf aFCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=QsXk17pA; 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 y16si17464849plr.150.2019.05.20.01.25.49; Mon, 20 May 2019 01:26:04 -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; dkim=pass header.i=@ffwll.ch header.s=google header.b=QsXk17pA; 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 S1731330AbfETIWg (ORCPT + 99 others); Mon, 20 May 2019 04:22:36 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:34346 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731317AbfETIWf (ORCPT ); Mon, 20 May 2019 04:22:35 -0400 Received: by mail-ed1-f66.google.com with SMTP id p27so22585340eda.1 for ; Mon, 20 May 2019 01:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lwFpKjbpcVfpxavAIzY2FLdOXjuwdFWEEdQZCv4IdjM=; b=QsXk17pAjlKycoPZTOSaN4LlLR4asGEE0iqfcFpeJDjgVLyUgtaqMucm8pPF4Hh7y3 0P1ZDpsUiTukc91Jg9NYU0gTd9GISmiuhXHZUVXRAPCDq/c5hkdGY/fzuLrel8ZqClgJ DhGW8hIctQhq4oFsNDmF08WccwkWXo5yuibzM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lwFpKjbpcVfpxavAIzY2FLdOXjuwdFWEEdQZCv4IdjM=; b=hzsz514/uK3NolMvq3X72W4ZlkYwhCiB8T6GnV4mTaS3RM+kmuxCIpnnqcwFFz17iF tR8DycxdOQipycUq+3vGPzyU8+j6j9mBtsxf5thgpQeWlHl0c/Vmkzk4J0A7Y+6xdqJK O1dwV9exilX/1HOctHJ1t3XEE2cNii0NA/xqCMJapopBqVxDo53MpKhEru/bSicVsbPo 9nLct0PHhwg8ccPxy1VBZCg1H91JQE56SQCnMqFaE7WOf9z1Ew36pGY3Vuff/L10YfOn dKvezCMeDBPgJrXPuCiHtUpy0Naabm/P55W+45Xcg/igzAcVj6ELjbX9nV68Z2IbXnbX rE+w== X-Gm-Message-State: APjAAAU4+emd0SMCTpRVdgsQQJARtSzkahpDTJneXJyVgltkCyOh0arg F99k2c9drBX7dCGk+GRPu3fQJQ== X-Received: by 2002:a50:e705:: with SMTP id a5mr73800863edn.270.1558340553273; Mon, 20 May 2019 01:22:33 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id t25sm3021263ejx.8.2019.05.20.01.22.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 01:22:32 -0700 (PDT) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , LKML , Daniel Vetter , Daniel Vetter , Bartlomiej Zolnierkiewicz , Hans de Goede , =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= , Yisheng Xie , Konstantin Khorenko , Prarit Bhargava , Kees Cook Subject: [PATCH 09/33] fbcon: Remove fbcon_has_exited Date: Mon, 20 May 2019 10:21:52 +0200 Message-Id: <20190520082216.26273-10-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190520082216.26273-1-daniel.vetter@ffwll.ch> References: <20190520082216.26273-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is unused code since commit 6104c37094e729f3d4ce65797002112735d49cd1 Author: Daniel Vetter Date: Tue Aug 1 17:32:07 2017 +0200 fbcon: Make fbcon a built-time depency for fbdev when fbcon was made a compile-time static dependency of fbdev. We can't exit fbcon anymore without exiting fbdev first, which only works if all fbdev drivers have unloaded already. Hence this is all dead code. v2: I missed that fbcon_exit is also called from con_deinit stuff, and there fbcon_has_exited prevents double-cleanup. But we can fix that by properly resetting con2fb_map[] to all -1, which is used everywhere else to indicate "no fb_info allocate to this console". With that change the double-cleanup (which resulted in a module refcount underflow, among other things) is prevented. Aside: con2fb_map is a signed char, so don't register more than 128 fb_info or hilarity will ensue. Signed-off-by: Daniel Vetter Cc: Bartlomiej Zolnierkiewicz Cc: Daniel Vetter Cc: Hans de Goede Cc: "Noralf Trønnes" Cc: Yisheng Xie Cc: Konstantin Khorenko Cc: Prarit Bhargava Cc: Kees Cook --- drivers/video/fbdev/core/fbcon.c | 33 +------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index 2b2082615ca1..a1be589b692f 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -112,7 +112,6 @@ static int softback_lines; static int first_fb_vc; static int last_fb_vc = MAX_NR_CONSOLES - 1; static int fbcon_is_default = 1; -static int fbcon_has_exited; static int primary_device = -1; static int fbcon_has_console_bind; @@ -1050,7 +1049,6 @@ static const char *fbcon_startup(void) info->var.bits_per_pixel); fbcon_add_cursor_timer(info); - fbcon_has_exited = 0; return display_desc; } @@ -3336,14 +3334,6 @@ static int fbcon_event_notify(struct notifier_block *self, struct fb_blit_caps *caps; int idx, ret = 0; - /* - * ignore all events except driver registration and deregistration - * if fbcon is not active - */ - if (fbcon_has_exited && !(action == FB_EVENT_FB_REGISTERED || - action == FB_EVENT_FB_UNREGISTERED)) - goto done; - switch(action) { case FB_EVENT_SUSPEND: fbcon_suspended(info); @@ -3396,7 +3386,6 @@ static int fbcon_event_notify(struct notifier_block *self, fbcon_remap_all(idx); break; } -done: return ret; } @@ -3443,9 +3432,6 @@ static ssize_t store_rotate(struct device *device, int rotate, idx; char **last = NULL; - if (fbcon_has_exited) - return count; - console_lock(); idx = con2fb_map[fg_console]; @@ -3468,9 +3454,6 @@ static ssize_t store_rotate_all(struct device *device, int rotate, idx; char **last = NULL; - if (fbcon_has_exited) - return count; - console_lock(); idx = con2fb_map[fg_console]; @@ -3491,9 +3474,6 @@ static ssize_t show_rotate(struct device *device, struct fb_info *info; int rotate = 0, idx; - if (fbcon_has_exited) - return 0; - console_lock(); idx = con2fb_map[fg_console]; @@ -3514,9 +3494,6 @@ static ssize_t show_cursor_blink(struct device *device, struct fbcon_ops *ops; int idx, blink = -1; - if (fbcon_has_exited) - return 0; - console_lock(); idx = con2fb_map[fg_console]; @@ -3543,9 +3520,6 @@ static ssize_t store_cursor_blink(struct device *device, int blink, idx; char **last = NULL; - if (fbcon_has_exited) - return count; - console_lock(); idx = con2fb_map[fg_console]; @@ -3668,9 +3642,6 @@ static void fbcon_exit(void) struct fb_info *info; int i, j, mapped; - if (fbcon_has_exited) - return; - #ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER if (deferred_takeover) { dummycon_unregister_output_notifier(&fbcon_output_nb); @@ -3695,7 +3666,7 @@ static void fbcon_exit(void) for (j = first_fb_vc; j <= last_fb_vc; j++) { if (con2fb_map[j] == i) { mapped = 1; - break; + con2fb_map[j] = -1; } } @@ -3718,8 +3689,6 @@ static void fbcon_exit(void) info->queue.func = NULL; } } - - fbcon_has_exited = 1; } void __init fb_console_init(void) -- 2.20.1