Re: [PATCH V2 1/7] m68k/mm: Change pmd_val()

From: David Hildenbrand
Date: Tue Sep 17 2024 - 06:30:28 EST



 #if !defined(CONFIG_MMU) || CONFIG_PGTABLE_LEVELS == 3
-typedef struct { unsigned long pmd[16]; } pmd_t;
-#define pmd_val(x)     ((&x)->pmd[0])
-#define __pmd(x)       ((pmd_t) { { (x) }, })
+typedef struct { unsigned long pmd; } pmd_t;
+#define pmd_val(x)     ((&x)->pmd)
+#define __pmd(x)       ((pmd_t) { (x) } )
 #endif

So I assume this should be fine

I think you're implying that taking the address then using arrow operator was
needed when pmd was an array? I don't really understand that if so? Surely:

((x).pmd[0])

would have worked too?

I think your right, I guess one suspects that there is more magic to it than there actually is ... :)

--
Cheers,

David / dhildenb