-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compile error #26
Comments
This only "appears" when |
It looks like this code is based on similar code in I am guessing that it's some kind of check for a correct value, specifically the "pointer"
This "works" (it compiles and doesn't crash my machine), but keep in mind that I have no idea what I'm doing :) static int sophgo_wdt_system_get_top_base(void *fdt,
int nodeoff, unsigned long *addr)
{
const fdt32_t *val;
int len, noff;
val = fdt_getprop(fdt, nodeoff, "subctrl-syscon", &len);
if (!val) {
return len;
}
if (len < sizeof(fdt32_t)) {
return SBI_EINVAL;
}
noff = fdt_node_offset_by_phandle(fdt, fdt32_to_cpu(*val));
if (noff < 0)
return noff;
return fdt_get_node_addr_size(fdt, noff, 0, addr, NULL);
} |
compile command: make PLATFORM=generic PLATFORM_RISCV_XLEN=64 CROSS_COMPILE=riscv64-linux-gnu-
error log is shown above:
/home/yangwang/official_opensbi/opensbi/lib/utils/reset/fdt_reset_sophgo_wdt.c: In function ‘mango_wdt_reset_init’:
/home/yangwang/official_opensbi/opensbi/lib/utils/reset/fdt_reset_sophgo_wdt.c:80:16: error: ‘noff’ may be used uninitialized in this function [be-uninitialized]
80 | return fdt_get_node_addr_size(fdt, noff, 0, addr, NULL);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/yangwang/official_opensbi/opensbi/lib/utils/reset/fdt_reset_sophgo_wdt.c:71:18: note: ‘noff’ was declared here
71 | int len, noff;
| ^~~~
The text was updated successfully, but these errors were encountered: