aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <[email protected]>2022-12-14 22:24:47 +0100
committerIngo Molnar <[email protected]>2023-01-06 04:22:34 +0100
commitbd4edba2653aeef0119b7a945f07e58711343bf9 (patch)
treeb3d76bb31942e9a80311dd8c93e0c5a2d92fe190
parent41c03ba9beea760bd2d2ac9250b09a2e192da2dc (diff)
x86/rtc: Simplify PNP ids check
compare_pnp_id() already iterates over the single linked pnp_ids list starting with the id past to it. So there is no need for add_rtc_cmos() to call compare_pnp_id() for each id on the list. No change in functionality intended. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Cc: [email protected]
-rw-r--r--arch/x86/kernel/rtc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/x86/kernel/rtc.c b/arch/x86/kernel/rtc.c
index 349046434513..1309b9b05338 100644
--- a/arch/x86/kernel/rtc.c
+++ b/arch/x86/kernel/rtc.c
@@ -138,15 +138,12 @@ static __init int add_rtc_cmos(void)
static const char * const ids[] __initconst =
{ "PNP0b00", "PNP0b01", "PNP0b02", };
struct pnp_dev *dev;
- struct pnp_id *id;
int i;
pnp_for_each_dev(dev) {
- for (id = dev->id; id; id = id->next) {
- for (i = 0; i < ARRAY_SIZE(ids); i++) {
- if (compare_pnp_id(id, ids[i]) != 0)
- return 0;
- }
+ for (i = 0; i < ARRAY_SIZE(ids); i++) {
+ if (compare_pnp_id(dev->id, ids[i]) != 0)
+ return 0;
}
}
#endif