Messages in this thread | | | From | John Ogness <> | Subject | Re: union: was: Re: [PATCH printk v1 05/18] printk: Add non-BKL console basic infrastructure | Date | Mon, 27 Mar 2023 18:34:22 +0206 |
| |
On 2023-03-21, Petr Mladek <pmladek@suse.com> 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.
> 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 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.
John Ogness
| |