# Re: \[RFC PATCH 4/8\] mm: Separate fault info out of 'struct vm\_fault'

- From: Linus Torvalds \<torvalds@linux-foundation.org\>
- Date: 2021-01-14 19:10:14 
- List: linux-arm-kernel
- Page: https://ratatoskr.run/linux-arm-kernel/2021/01/6235189
- Thread: https://ratatoskr.run/linux-mm/2021/01/6235067/t.md

```text
On Thu, Jan 14, 2021 at 11:00 AM Will Deacon [ref] wrote:
>
> I tried that initially, but I found that I had to make all of the
> members const to get it to work, at which point the anonymous struct
> wasn't really adding anything. Did I just botch the syntax?

I'm not sure what you tried. But this stupid test-case sure works for me:

    struct hello {
        const struct {
                unsigned long address;
        };
        unsigned int flags;
    };

    extern int fn(struct hello *);

    int test(void)
    {
        struct hello a = {
                .address = 1,
        };
        a.flags = 0;
        return fn(&a);
    }

and because "address" is in that unnamed constant struct, you can only
set it within that initializer, and cannot do

        a.address = 0;

without an error (the way you _can_ do "a.flags = 0").

I don't see naming the struct making a difference - apart from forcing
that big rename patch, of course.

But maybe we're talking about different issues?

            Linus

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
```
