From: Michael Walle <michael@walle.cc>
To: Tudor Ambarus <tudor.ambarus@linaro.org>
Cc: tkuw584924@gmail.com, linux-mtd@lists.infradead.org,
pratyush@kernel.org, miquel.raynal@bootlin.com, richard@nod.at,
vigneshr@ti.com, Bacem.Daassi@infineon.com,
Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Subject: Re: [PATCH] mtd: spi-nor: core: Set mtd->eraseregions for non-uniform erase map
Date: Fri, 12 Jan 2024 13:01:06 +0100 [thread overview]
Message-ID: <2e781c2efd663fea6d4a75fac36f144a@walle.cc> (raw)
In-Reply-To: <bb98a601-5c76-4273-820e-2b1c9b449820@linaro.org>
>> + 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.
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 (?!).
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.
>> +
>> + for (i = 0; !spi_nor_region_is_last(®ion[i]); i++)
>> + ;
>> +
>> + n_regions = i + 1;
>
> all this just to get the number of regions? how about saving the number
> of regions somewhere and use it everywhere?
This whole region thing should be rewritten to not store these magic
bits in the offset.
-michael
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2024-01-12 12:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-25 8:03 [PATCH] mtd: spi-nor: core: Set mtd->eraseregions for non-uniform erase map tkuw584924
2024-01-05 12:23 ` Michael Walle
2024-01-12 7:14 ` Takahiro Kuwano
2024-01-12 9:22 ` Tudor Ambarus
2024-01-19 6:29 ` Takahiro Kuwano
2024-01-19 6:55 ` Tudor Ambarus
2024-01-19 8:35 ` Takahiro Kuwano
2024-01-19 12:49 ` Michael Walle
2024-01-12 9:43 ` Tudor Ambarus
2024-01-12 10:12 ` Tudor Ambarus
2024-01-12 12:01 ` Michael Walle [this message]
2024-01-12 12:22 ` Tudor Ambarus
2024-01-12 12:28 ` Michael Walle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2e781c2efd663fea6d4a75fac36f144a@walle.cc \
--to=michael@walle.cc \
--cc=Bacem.Daassi@infineon.com \
--cc=Takahiro.Kuwano@infineon.com \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=pratyush@kernel.org \
--cc=richard@nod.at \
--cc=tkuw584924@gmail.com \
--cc=tudor.ambarus@linaro.org \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox