Paul Cercueil 5f5ed0ebcf MIPS: cpu-probe: ingenic: Fix broken BUG_ON
The previous code was doing:
BUG_ON(!__builtin_constant_p(cpu_has_counter) || cpu_has_counter);

This only worked as the "cpu_has_counter" macro was overridden in
<cpu-feature-overrides.h>. The default "cpu_has_counter" macro is
non-constant, which triggered the BUG_ON() independently of the value
returned by the macro.

What we want to check here, is that *if* the macro was overridden to a
compile-time constant, then must be defined to zero, otherwise it's a
bug.

So the correct check is:
BUG_ON(__builtin_constant_p(cpu_has_counter) && cpu_has_counter);

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2020-09-18 16:27:32 +02:00
..
2020-05-07 11:55:47 +02:00
2018-10-31 08:54:16 -07:00
2020-05-22 09:09:01 +02:00
2020-05-07 11:55:47 +02:00
2020-05-22 09:09:01 +02:00
2020-07-27 14:31:08 -04:00
2020-05-22 09:09:01 +02:00
2018-08-31 11:49:20 -07:00
2020-03-31 08:51:45 -07:00
2020-05-15 14:53:19 +02:00
2020-05-22 09:13:32 +02:00
2020-07-26 10:18:35 +02:00
2020-08-06 10:54:07 -07:00
2020-05-07 11:55:47 +02:00