Re: [PATCH] riscv: mpfs: Read and store FPGA design information on MPFS hardware.
Nathan Whitehorn <[email protected]>
| Newsgroups | gmane.comp.boot-loaders.u-boot |
|---|---|
| Message-ID | <1f83d1e5-bced-4fe2-8afd-1ad5e215ad1b__20784.4031204999$1786990652$gmane$org@pa.msu.edu> |
On 8/16/26 06:25, Tim Ouyang wrote:
> On Fri, Jul 24, 2026 at 01:33:50PM -0400, Nathan Whitehorn wrote:
>> + designid[32] = 0;
>> + for (idx = 0; idx < 16; idx++)
>> + sprintf(&serialstring[2*idx], "%02x", device_serial_number[idx]);
> The variable serialstring may not be properly null‑terminated.
>
>> + if (env_get("pf_design_ver") != NULL)
>> + fdt_setprop(blob, node, "fpga-design-version", env_get("pf_design_ver"), strlen(env_get("pf_design_id")) + 1);
> I think it should be strlen(env_get("pf_design_ver")) here.
> Please ensure any long lines are wrapped properly also.
Thank you for the review and for spotting those frankly embarassing
bugs. I will send a v2 shortly, including the style changes.
One question I wanted to ask before sending v2: I somewhat arbitrarily
named the created environment variables "pf_*" for "Polarfire_". Would
you prefer they be "mpfs_*" instead?
Thanks,
Nathan
> --
> Best regards,
> Tim Ouyang
--
Nathan Whitehorn (he/him)
Associate Professor
Department of Physics and Astronomy
Michigan State University
Biomedical and Physical Sciences 3225
East Lansing, MI 48824
(517) 884-5563