Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp919871rwi; Mon, 31 Oct 2022 09:04:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM69NdaTLAMn+BOE6PQt+AoMiR3J3p4anh5WzoxG3Wte6S1g06wUo9kVwoW7WBQ7RVGSn3ax X-Received: by 2002:a17:907:2c6b:b0:7ad:c587:bc5b with SMTP id ib11-20020a1709072c6b00b007adc587bc5bmr8328650ejc.425.1667232249180; Mon, 31 Oct 2022 09:04:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667232249; cv=none; d=google.com; s=arc-20160816; b=LAov2RJ26QODY0E2V/1llpWBWn74E+aJgypLGKv47YOobvoU98jpJOZ7pwHgjL3QS1 I7UdAPq0NsOGOFrWxsj7QXyo4FNrbowM++VWlu/3tHLV6lnD4j9cbnvM2U0ZYopXh35b hqKUs+EmCD4xukKVQKGSPIC/7YRJE4oD5kwZBNymfVbm8X1g8zXyInLTfNPFG1bew8eh wFP/XNEbHMmR89tFm6roNsEHaqXnP99P60iLh8eR2qVy6iBFK6Fb7Ys0CAgKcgm8Ex5n iEM1gYhaiwkCP5ggeEOUbyzZIhJKea/CSwcg4xLrTAJvCN1pXw0idDcYHAktcS28V6+v AMVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=yeubx61jFuBO+3wr4/Lz2VpcaM+NzZvGi1ThDvT7wNs=; b=rtOR+C+rNRcQd3jAWnn2eZROdcwxz7QeA4N6uw//x6wDtr4BUQmR0+54vrEOP84RKV kOGKSOL3l3tApwPSbZ+AOfcIEjnwFR+mN1FaqvyQ0+VEfAw+/6IeSMfZF1oMJ3lE9Zug fS9DeQnmocm35oqDJDbo7jAeswFHWGZA5isSeCj0XtkuT80BWAjTi8QHjzmT3bpR9hD3 q8wFAVbx2aWDXLD3S4Ktfnrzu/WXiQFWVmDuJe7mjGt6kX7IbEuJlNTw/CxAUx2+OhvE QdC7OCtx5kivop1kuXoD5foQOGFbD7nyrGunZ4pbM77+sB1q1YMeXRexBDvTiik1/Kyj 4rog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Mi0Hlkhu; dkim=neutral (no key) header.i=@linutronix.de header.b=oUMs3mkU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd23-20020a1709076e1700b0078e0e850902si8884215ejc.868.2022.10.31.09.03.42; Mon, 31 Oct 2022 09:04:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Mi0Hlkhu; dkim=neutral (no key) header.i=@linutronix.de header.b=oUMs3mkU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231153AbiJaP76 (ORCPT + 99 others); Mon, 31 Oct 2022 11:59:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229923AbiJaP75 (ORCPT ); Mon, 31 Oct 2022 11:59:57 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AED39EAA for ; Mon, 31 Oct 2022 08:59:56 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1667231995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yeubx61jFuBO+3wr4/Lz2VpcaM+NzZvGi1ThDvT7wNs=; b=Mi0HlkhuLZh9nD3YLX1Ke8+/NEKgPUy6CZpztxtr4D03gISEpGHk8tbLyR2UwNPWNZ373u QoHmNuShXx+IC2InrU44W7LXgBAwNEOIO5K1cnqii+1fo7hAQkov2D4c+hM988d7uyvk1H 6mFUtKcMc3JpCubu3gUSp+LJeRlSk7qgTkgRuur+rtFJFnGhBhgw/IsOJCytn2Z5Y39bfz UrnadmZXwnXNEPznrN0X+7drBfgnH9Pa75nyH/OEqoVF6fKxmloo0o0wVURIjDRMDSLSL2 zSL+JQQvR/8huAHm35QlRfviDrhaZKoQsptSb95uLzf+mFgilrBBN2letFih1Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667231995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yeubx61jFuBO+3wr4/Lz2VpcaM+NzZvGi1ThDvT7wNs=; b=oUMs3mkUZsw41oJd4DXxp7CK57tKyNBmDqa6f1T4XK1RLcCtyXvumzpLHjhrpN8GBXIaHa jnD2RcCjleuBggCg== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Geert Uytterhoeven , linux-m68k@lists.linux-m68k.org Subject: Re: [PATCH printk v2 06/38] tty: nfcon: use console_is_enabled() In-Reply-To: References: <20221019145600.1282823-1-john.ogness@linutronix.de> <20221019145600.1282823-7-john.ogness@linutronix.de> Date: Mon, 31 Oct 2022 17:05:54 +0106 Message-ID: <87fsf49e6d.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-10-21, Petr Mladek wrote: >> diff --git a/arch/m68k/emu/nfcon.c b/arch/m68k/emu/nfcon.c >> index 557d60867f98..c542fc2b121f 100644 >> --- a/arch/m68k/emu/nfcon.c >> +++ b/arch/m68k/emu/nfcon.c >> @@ -151,7 +151,7 @@ static int __init nfcon_init(void) >> >> nfcon_tty_driver = driver; >> >> - if (!(nf_console.flags & CON_ENABLED)) >> + if (!console_is_enabled(&nf_console)) > > Heh, the check of CON_ENABLED does not make much sense. IMHO, the > important thing is whether the console is in console_list or not. > > I would personally add a check at the beginning of register_console() > whether the console is already registered and enabled() and do > nothing when already done. Actually, register_console() already has this check, but it does a WARN(). If the debug setup is used for nfcon, this situation is normal. So probably to avoid the WARN, the CON_ENABLED code was added. > I would be nice to fix this. But it might be done later. I could add a console_is_registered() function that checks if the console is in the console list and use that instead. If we are going to touch this code, we might as well touch it correctly, right? John