Skip to content

Commit 3d8d459

Browse files
ConchuODpalmer-dabbelt
authored andcommitted
RISC-V: hwprobe: sort EXT_KEY()s in hwprobe_isa_ext0() alphabetically
Currently the entries appear to be in a random order (although according to Palmer he has tried to sort them by key value) which makes it harder to find entries in a growing list, and more likely to have conflicts as all patches are adding to the end of the list. Sort them alphabetically instead. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Clément Léger <cleger@rivosinc.com> Link: https://lore.kernel.org/r/20240717-dedicate-squeamish-7e4ab54df58f@spud Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 6a4aa4c commit 3d8d459

1 file changed

Lines changed: 21 additions & 22 deletions

File tree

arch/riscv/kernel/sys_hwprobe.c

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -93,44 +93,45 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
9393
* regardless of the kernel's configuration, as no other checks, besides
9494
* presence in the hart_isa bitmap, are made.
9595
*/
96+
EXT_KEY(ZACAS);
97+
EXT_KEY(ZAWRS);
9698
EXT_KEY(ZBA);
9799
EXT_KEY(ZBB);
98-
EXT_KEY(ZBS);
99-
EXT_KEY(ZICBOZ);
100100
EXT_KEY(ZBC);
101-
102101
EXT_KEY(ZBKB);
103102
EXT_KEY(ZBKC);
104103
EXT_KEY(ZBKX);
104+
EXT_KEY(ZBS);
105+
EXT_KEY(ZCA);
106+
EXT_KEY(ZCB);
107+
EXT_KEY(ZCMOP);
108+
EXT_KEY(ZICBOZ);
109+
EXT_KEY(ZICOND);
110+
EXT_KEY(ZIHINTNTL);
111+
EXT_KEY(ZIHINTPAUSE);
112+
EXT_KEY(ZIMOP);
105113
EXT_KEY(ZKND);
106114
EXT_KEY(ZKNE);
107115
EXT_KEY(ZKNH);
108116
EXT_KEY(ZKSED);
109117
EXT_KEY(ZKSH);
110118
EXT_KEY(ZKT);
111-
EXT_KEY(ZIHINTNTL);
112119
EXT_KEY(ZTSO);
113-
EXT_KEY(ZACAS);
114-
EXT_KEY(ZICOND);
115-
EXT_KEY(ZIHINTPAUSE);
116-
EXT_KEY(ZIMOP);
117-
EXT_KEY(ZCA);
118-
EXT_KEY(ZCB);
119-
EXT_KEY(ZCMOP);
120-
EXT_KEY(ZAWRS);
121120

122121
/*
123122
* All the following extensions must depend on the kernel
124123
* support of V.
125124
*/
126125
if (has_vector()) {
127-
EXT_KEY(ZVE32X);
128-
EXT_KEY(ZVE32F);
129-
EXT_KEY(ZVE64X);
130-
EXT_KEY(ZVE64F);
131-
EXT_KEY(ZVE64D);
132126
EXT_KEY(ZVBB);
133127
EXT_KEY(ZVBC);
128+
EXT_KEY(ZVE32F);
129+
EXT_KEY(ZVE32X);
130+
EXT_KEY(ZVE64D);
131+
EXT_KEY(ZVE64F);
132+
EXT_KEY(ZVE64X);
133+
EXT_KEY(ZVFH);
134+
EXT_KEY(ZVFHMIN);
134135
EXT_KEY(ZVKB);
135136
EXT_KEY(ZVKG);
136137
EXT_KEY(ZVKNED);
@@ -139,16 +140,14 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
139140
EXT_KEY(ZVKSED);
140141
EXT_KEY(ZVKSH);
141142
EXT_KEY(ZVKT);
142-
EXT_KEY(ZVFH);
143-
EXT_KEY(ZVFHMIN);
144143
}
145144

146145
if (has_fpu()) {
147-
EXT_KEY(ZFH);
148-
EXT_KEY(ZFHMIN);
149-
EXT_KEY(ZFA);
150146
EXT_KEY(ZCD);
151147
EXT_KEY(ZCF);
148+
EXT_KEY(ZFA);
149+
EXT_KEY(ZFH);
150+
EXT_KEY(ZFHMIN);
152151
}
153152
#undef EXT_KEY
154153
}

0 commit comments

Comments
 (0)