Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp663390pxt; Fri, 6 Aug 2021 10:35:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6G9qgz7tJU9f9TtE1yfk1sZ9ow0mIPQ0SdQDEE6EQlkfbb5P1Qv8tkz0YEUudDLUY1Osj X-Received: by 2002:a02:7348:: with SMTP id a8mr10962070jae.116.1628271339977; Fri, 06 Aug 2021 10:35:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628271339; cv=none; d=google.com; s=arc-20160816; b=yLq956UOmoVqczbm+WELXb7lFRCJigMCttsz2Rcg08HvHpRcyyPLIiXbhmbnHmWV39 1zij3CTuSTZkQmBhEXlaXXzIC+9chbaG1Cr+yM2AVPH492h89YytxzkbVmQdHzcCYqVk Hih5UW+orzl+vb9YvTahXybOBC2sbFGFZ9h33QAhwpR2z0ejGXeycqoiwNY/+Zm3LGPO UHDqfDtdC/QrdCdJycIpHBtHHjLnXZkgiGxxtXKkuKnkRrMOBowerLRVKGnwpEQA3rt6 wghRPMs4RJZcWcPJYd3Hmud7L0+T74NRP08DwTCGNBlG16tEz49AIEcMqNSEXKBb1Loq Q/EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=vzyMFndyXBCwrsVhhGaUUhUMdwq4Ek9T61kJwoKWWmg=; b=Se83hSbNxGoLYe5va7p0WDEdlZizQtCyf0qzxpuZhqu6YSBIdY0M/N6fWy/0K841WK LlMr4AcWO7PZr/1becghqjfEzijxKzB+SR6d+O3vxnM5QIQ2+ZSKBIO0NxPjnsoZTDJ0 mbtdJ9IQvCqa4R3ZuKgp0BxKelrXWW8/riT/QBDN3XQBhMzjZ9Yer+woEwJnkP9+e9hV AObVdKaiJ5UVMHkfnKptQR57h02GZ9N+UOZg6tOwnq6GZHH/hrf0n0od0HPxjBDTxz7l T0eJPGthdcYt7w4G3ps22l/Hwog1Lt89/fCOfHjdg4Xzaqg5Dw3UJqoa0QFmlMPG7yXx EsZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b24si9042786jar.119.2021.08.06.10.35.26; Fri, 06 Aug 2021 10:35:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245385AbhHFLSe (ORCPT + 99 others); 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