Commit 2dc99ea
Paul Walmsley
riscv: cpufeature: avoid uninitialized variable in has_thead_homogeneous_vlenb()
In has_thead_homogeneous_vlenb(), smatch detected that the vlenb variable
could be used while uninitialized. It appears that this could happen if
no CPUs described in DT have the "thead,vlenb" property.
Fix by initializing vlenb to 0, which will keep thead_vlenb_of set to 0
(as it was statically initialized). This in turn will cause
riscv_v_setup_vsize() to fall back to CSR probing - the desired result if
thead,vlenb isn't provided in the DT data.
While here, fix a nearby comment typo.
Cc: [email protected]
Cc: Charlie Jenkins <[email protected]>
Fixes: 377be47 ("riscv: vector: Use vlenb from DT for thead")
Signed-off-by: Paul Walmsley <[email protected]>
Link: https://lore.kernel.org/r/[email protected]1 parent 5d15d2a commit 2dc99ea
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
932 | 932 | | |
933 | 933 | | |
934 | 934 | | |
935 | | - | |
| 935 | + | |
936 | 936 | | |
937 | | - | |
| 937 | + | |
938 | 938 | | |
939 | 939 | | |
940 | 940 | | |
| |||
0 commit comments