RTEMS | bsps/shared/dev/nor: Add SFDP and CFI parsers (!823)
Aaron Nyholm (@eagleirony)
gitlab at rtems.org
Thu Dec 4 01:16:57 UTC 2025
Aaron Nyholm commented on a discussion on bsps/shared/dev/nor/config-parser.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/823#note_136641
> + }
> +
> + if (version >= 5) {
> + int page_info_dword_offset = 10;
> + int page_info_offset = 4 * page_info_dword_offset;
> + if (read_config_byte(tdata, tlen, datalen, page_info_offset, &bufbyte)) {
> + return -1;
> + }
> + bufbyte >>= 4;
> + bufbyte &= 0xF;
> + local.PageSize = 1U << bufbyte;
> + }
> +
> + /* Apply local parse data now that parsing has succeeded */
> + *data = local;
> + return 0;
I think the format of the data being parsed lends itself to longer functions. While I agree that the functions are long, looking at them I'm not sure how to break them up without affecting the readability of the code. It's useful to be able to track the format in the function and all repeated actions are already pulled out into static functions. Happy for any suggestions though :))
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/823#note_136641
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20251204/96fd849f/attachment-0001.htm>
More information about the bugs
mailing list