[PATCH] mtd: spi-nor: core: Set mtd->eraseregions for non-uniform erase map

Michael Walle michael at walle.cc
Fri Jan 12 04:28:22 PST 2024


>>>> +    struct mtd_erase_region_info *mtd_region;
>>>> +    u32 erase_size;
>>>> +    u8 erase_mask;
>>> 
>>> put the u8 last to avoid stack padding
>> 
>> I don't think that is a thing. Even if it were, it might clash
>> with the RCT.
> 
> RCT as in reverse Christmas tree?

yes

> if we put u8 at the end we'll respect RCT and without padding holes
> in the stack.

It might clash, not in this particular example.

>> I couldn't find anything about how automatic variables are placed
>> in memory. I'd say its not specified in the standard and the compiler
>> is free to do optimizations here or just keep the contents in
>> registers (?!).
>> 
> 
> I can't tell.
> 
>> Any stytle recommendations for spi-nor? I prefer RCT, but if we want
>> to say declaration order doesn't matter, I'm fine with that too.
> 
> RCT or CT with stack padding in mind :). But that's just common sense, 
> I
> guess.

Again, that's not a thing. So IMHO order doesn't matter so we should 
just
say RCT, i.e. the same as netdev.

-michael



More information about the linux-mtd mailing list