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=-5.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INVALID_DATE_TZ_ABSURD, 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 47993C4338F for ; Fri, 6 Aug 2021 10:56:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 27D0261181 for ; Fri, 6 Aug 2021 10:56:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245086AbhHFK5C (ORCPT ); Fri, 6 Aug 2021 06:57:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231700AbhHFK47 (ORCPT ); Fri, 6 Aug 2021 06:56:59 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C037CC061798 for ; Fri, 6 Aug 2021 03:56:43 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1628247401; 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=C03BkgqLQ9ruY//c0rzNTOJoKiptzTsTimQnhDnEo40=; b=FMiU0j+YGqYaWcVDgoHhfo024/sOltzqJh7K+3Hl81SoE8wMQv7b3fQjoq+bRweQdbpJ3C vI5dx41nxFhchrq9yDnpR3cnd6YPhmAMSuIPAbEc6GwdimUxj5lnFgbToUT5mWBEH+CJhv qhPQ3faEWEDr9ThE0MlEboBuI2om7jJ/cmg/Z4b9izqjVxMTI0SukOmpa2RfHtrpWlzTlY 1tc7ZZa/4tT4liKj/4sgIcmq2DzCK3TVUX+p3reI/GayF0EUbo+mc9DhIVO+AWPkswFrvm YL9Avwj82Mq4iPXkS3HJogm5bjrMziaLZ3u/b4hSxvmvlDFV4Ob+cS0eww1s2Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1628247401; 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=C03BkgqLQ9ruY//c0rzNTOJoKiptzTsTimQnhDnEo40=; b=FyGc/FkcK9Xej8O9sJISb/NRjecamjdh5SRFVWyE/ewQb6+PmhVX6093fIf0dYmZnRpXSx 9z+NR4J/8pM8eBCg== To: Andy Shevchenko 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 In-Reply-To: References: <20210803131301.5588-1-john.ogness@linutronix.de> <20210803131301.5588-8-john.ogness@linutronix.de> Date: Fri, 06 Aug 2021 13:02:40 +0206 Message-ID: <87tuk2j0yf.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-08-03, Andy Shevchenko wrote: >> #include >> #include >> +#include > > Ordered? Agreed. v2 will include printk.h first. >> + 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? Thanks. John Ogness