From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B452DC4338F for ; Fri, 6 Aug 2021 11:18:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94B9A61176 for ; Fri, 6 Aug 2021 11:18:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245397AbhHFLSe (ORCPT ); Fri, 6 Aug 2021 07:18:34 -0400 Received: from mga11.intel.com ([192.55.52.93]:4615 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242720AbhHFLSd (ORCPT ); Fri, 6 Aug 2021 07:18:33 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10067"; a="211248743" X-IronPort-AV: E=Sophos;i="5.84,300,1620716400"; d="scan'208";a="211248743" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2021 04:18:18 -0700 X-IronPort-AV: E=Sophos;i="5.84,300,1620716400"; d="scan'208";a="420700416" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2021 04:18:12 -0700 Received: from andy by smile with local (Exim 4.94.2) (envelope-from ) id 1mBxrZ-005o8h-7h; Fri, 06 Aug 2021 14:18:05 +0300 Date: Fri, 6 Aug 2021 14:18:05 +0300 From: Andy Shevchenko To: John Ogness Cc: Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Andrew Morton , Masahiro Yamada , Peter Zijlstra , Nick Desaulniers , "Paul E. McKenney" , Tetsuo Handa , Vitor Massaru Iha , Sedat Dilek , Changbin Du Subject: Re: [PATCH printk v1 07/10] console: add write_atomic interface Message-ID: References: <20210803131301.5588-1-john.ogness@linutronix.de> <20210803131301.5588-8-john.ogness@linutronix.de> <87tuk2j0yf.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87tuk2j0yf.fsf@jogness.linutronix.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 06, 2021 at 01:02:40PM +0206, John Ogness wrote: > On 2021-08-03, Andy Shevchenko wrote: ... > >> + if (!(con->flags & CON_ENABLED)) \ > >> + continue; \ > > > > What about > > > > #define console_is_enabled(con) (!!(con->flags & CON_ENABLED)) > > > > or inliner equivalent > > > > static inline bool console_is_enabled(struct console *con) > > { > > return !!(con->flags & CON_ENABLED); > > } > > Generally kernel code uses the console flags directly. A quick check for > CON_ENABLED shows direct flag queries all over: > > $ git grep -l -e 'flags.*& .*CON_ENABLED' | wc -c > 16 > > Are you suggesting I replace this usage in all of these files? Or just > the one macro in console.h for now? And since there are 6 more console > flags, they should probably also have equivalent wrappers? Introduce it now and reuse in new code, but somebody may clean up the rest in the future. -- With Best Regards, Andy Shevchenko