Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4035433rwl; Tue, 28 Mar 2023 01:24:45 -0700 (PDT) X-Google-Smtp-Source: AKy350bGl9sq/mAuUs05+6dZytdZxXBqbGDoyQ9j28L7Oxgmnd/n7Iyk8e/mtqpxaAlKD36W7lj4 X-Received: by 2002:a17:906:fc2:b0:923:c199:dab1 with SMTP id c2-20020a1709060fc200b00923c199dab1mr17038043ejk.55.1679991884984; Tue, 28 Mar 2023 01:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679991884; cv=none; d=google.com; s=arc-20160816; b=jjwEJ++zrMyRshvlTMUj3PneOFhBWwXLI/F+qtQ0P7au9oFQYRd0CNhHQ+UHFSFlD8 8MRzsWCNOzu2WPxaGzWwaQNBGTwxKS6J2zrwQqzCMn15+l0lZlk07d4c5Wh+AsVsSXWs VtJhuIpshrjEYfDEIl534J7HtjvWWXU21kUW2IsAR5R9AMbcy/aarqDW/7o1OfIyQPjo l7NaGyDsQYI2KdBK2yxkdPjf3JnYfEJDGgES7QF2S4bz8JUwxMSd7wDfyVmuQ3ceC3xF Xyg3UgGHjnzGg/Ufc7Yb9J+F2F11MUQY1iZN6XsZH0oabRv8+/o+zk6wr8e93lmBTnHO J7yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HRcn8tarDsWg3kdLklqiCIWLcIN+nPnBDYzbSZWYh8Y=; b=LLgd5mJujhFeLVro7VP3mg3w3+wydhXR8OftHUcT7LoQjvUwtSCqGrtjBXhGPWXPEq aiFyihfuDLqCoM4pWY7JJh8qyY/1CZ52EeIU5x8Cvyhe8DBdRhrAZgy5P/+MgvQ1DfWv 4oeFRdXzhSb+3Vf4uQonC70xn/t7lnx+qtfP6u1amjQUd6d6gPmi/iKeyT6sLCWvKhjm YCnnWPuZg9pIYMAtWcEHp2iEXaqnaohbRecdY+b4wHQujUPa6hdtVPjK3PqIo6qYy5W8 xHL2NyAzJHM5XnQYDqU1ITamc85J80XHlhMOhkjYCn1nR4MTgC9agvOyKQLXKXLbEyp+ oOsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=gZupk3ti; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kt22-20020a170906aad600b0092522b9937dsi32876418ejb.320.2023.03.28.01.24.21; Tue, 28 Mar 2023 01:24:44 -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=@suse.com header.s=susede1 header.b=gZupk3ti; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230381AbjC1IVB (ORCPT + 99 others); Tue, 28 Mar 2023 04:21:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229647AbjC1IUy (ORCPT ); Tue, 28 Mar 2023 04:20:54 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 820D644A7; Tue, 28 Mar 2023 01:20:29 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 1807D1FD81; Tue, 28 Mar 2023 08:20:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1679991628; h=from:from:reply-to: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=HRcn8tarDsWg3kdLklqiCIWLcIN+nPnBDYzbSZWYh8Y=; b=gZupk3tipjwAsFo6fQqtftzCaAwarwag9hpdUBGeMueBBBkNzMbWNCjWCUdWc+umQ3pGjm 1hELF15qK4IdF7Gl+WNc1bWAD3sHlRQo0MeNCbEAhN5pnGXnf4Gj6gNC85BA2HMNrqjocL rtI67tDECoZrGzT+v6QPY+HRTVhKnDM= Received: from suse.cz (unknown [10.100.208.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id ACFC22C142; Tue, 28 Mar 2023 08:20:27 +0000 (UTC) Date: Tue, 28 Mar 2023 10:20:26 +0200 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , linux-fsdevel@vger.kernel.org Subject: Re: union: was: Re: [PATCH printk v1 05/18] printk: Add non-BKL console basic infrastructure Message-ID: References: <20230302195618.156940-1-john.ogness@linutronix.de> <20230302195618.156940-6-john.ogness@linutronix.de> <87y1nip3a1.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y1nip3a1.fsf@jogness.linutronix.de> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Mon 2023-03-27 18:34:22, John Ogness wrote: > On 2023-03-21, Petr Mladek wrote: > > It is not completely clear that that this struct is stored > > as atomic_long_t atomic_state[2] in struct console. > > > > What about adding? > > > > atomic_long_t atomic; > > The struct is used to simplify interpretting and creating values to be > stored in the atomic state variable. I do not think it makes sense that > the atomic variable type itself is part of it. It was just an idea. Feel free to keep it as is (not to add the atomic into the union). > > Anyway, we should at least add a comment into struct console > > about that atomic_state[2] is used to store and access > > struct cons_state an atomic way. Also add a compilation > > check that the size is the same. > > A compilation check would be nice. Is that possible? I think the following might do the trick: static_assert(sizeof(struct cons_state) == sizeof(atomic_long_t)); > I am renaming the struct to nbcon_state. Also the variable will be > called nbcon_state. With the description updated, I think it makes it > clearer that "struct nbcon_state" is used to interpret/create values of > console->nbcon_state. Sounds good. Best Regards, Petr