Commit 486dbb2
committed
Constify error_desc and perror
The error_desc array and the perror pointer are never modified after
initialization. Marking them as const moves the data to the read-only
section, improving safety.
Before:
$ riscv-none-elf-size ./build/kernel/error.o
text data bss dec hex filename
398 172 0 570 23a ./build/kernel/error.o
After:
$ riscv-none-elf-size ./build/kernel/error.o
text data bss dec hex filename
570 0 0 570 23a ./build/kernel/error.o1 parent 6bccb72 commit 486dbb2
2 files changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
0 commit comments