From patchwork Fri Jan 6 10:48:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 40090 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp756867wrt; Fri, 6 Jan 2023 02:50:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXu8CoD+ptY1W4lP/EVw8nUSsdfh1Z+CUKI34wJRHd5xtl0Kp7wXGnwFZ/I1p6RL+RJzfIxk X-Received: by 2002:a05:6a20:7d95:b0:b0:1051:30a0 with SMTP id v21-20020a056a207d9500b000b0105130a0mr86654709pzj.51.1673002228786; Fri, 06 Jan 2023 02:50:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673002228; cv=none; d=google.com; s=arc-20160816; b=sRWMLt30OOxmtcPZ6qUpm/0o9Ucoq3lpfdE/uIeDhtZuGt83YVrJrB0//9fypD1H3i 6i8flW6i44BXsynvibSOKqRZ60Hvkm8Ovm5Kqnd7PjjlyjgBX4VuuKfGPO1SZh/4sTTT hDy+S1q9uZDPuRHBVwXo2WMaMb9jGGyh2LrvFk9LIH+LTTOgAkAoubcAfZWaPpG+HDoW r5nOs7okxjJJ59IpPKSy/3mXdQ62A9ySnv+OhAs8AEvvBXNviJZiBmru5C9Cqp3zblu+ Yhgb7SW0itP4lO07imQo+jrU8e1OMtl23yTaBOqrDSQQwbvzRswbOJ7XZld9yxLpmGGL 8NpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=/hxCtPufFtZ5al9rbAfK0+sKz8sTOiY727C5yei9u9k=; b=GkMYQf4g+pewT3Y6V/v9TuKKYfehYkJwn+f9Exg0xqzjvdQMC3znx/DYqAc2pHKPnk 08I3klww+ii4R0ezZbd/nChII12XJSyKVkwlbxAt4qQMMZvJsv+5X1ErzGJUm7DC2HsL RExYK9MmCNOUt7Ol3AHkIp19tq57hN9YNfK+SzkeCqVCLavpyvFPtlfgiTziH0oi0RaI Q9opqY41ke6iqgiQu0MhzKFcmkSrIovV2R32XRwSQMnOQ7IFKIDPqQ+ITfNsjM+v/aYl pzhxhemqOZ7yd4dSUvyfs1rlr7EG23XxhXcINvryavSDWYkkjBRBs1vUmWxwLHvJoYVZ OPAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=t1MiUaHu; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 141-20020a630393000000b0049206a74135si1118605pgd.275.2023.01.06.02.50.16; Fri, 06 Jan 2023 02:50:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=t1MiUaHu; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231741AbjAFKsL (ORCPT + 99 others); Fri, 6 Jan 2023 05:48:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232243AbjAFKsG (ORCPT ); Fri, 6 Jan 2023 05:48:06 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 458D66CFDF; Fri, 6 Jan 2023 02:48:05 -0800 (PST) Date: Fri, 06 Jan 2023 10:48:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673002083; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/hxCtPufFtZ5al9rbAfK0+sKz8sTOiY727C5yei9u9k=; b=t1MiUaHuRMCwIAF88dKGsbhsvmMLn/iopIFfDEWrJfWvT2+4gfJXlx7Fa3DQUUvdRwM1EW l/nh5ReZ3ZFJJj5ByIzcUxJ0n2UfJeH3MPb3ID1gbN6V8LtuV/F5fP5h1i4MmdNSS/br9W XGodTzOTdYA/ZcOUtz/TUAX2x0STSkCZEj3lvJPIHv+swBxLKPSilNmgxuAgi6qF/51rJi RQr6qgdes0IHuJgx0xMgaVmVxobf/K+mAcAxK1k0jGusqFLNZNbPacnwHF1ZA9C1KWTPaC s5kf108Ja1KBjufC02i0ytSRpCNP/vPxF0nl78cEnkeCPCWfF8ykYQ/y+c6Dsw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673002083; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/hxCtPufFtZ5al9rbAfK0+sKz8sTOiY727C5yei9u9k=; b=REJk9c4Jvqc7Zar4ycE2QFX2GuxLQF7FH8SBRwNK/arsg7SwLc7m/5y1FAAkS6gnRp+KJg urGE9lT/BckJ5WBA== From: "tip-bot2 for Hans de Goede" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/platform] x86/rtc: Simplify PNP ids check Cc: Hans de Goede , Ingo Molnar , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, x86@kernel.org MIME-Version: 1.0 Message-ID: <167300208315.4906.17267307487336474723.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754269985270902266?= X-GMAIL-MSGID: =?utf-8?q?1754269985270902266?= The following commit has been merged into the x86/platform branch of tip: Commit-ID: bd4edba2653aeef0119b7a945f07e58711343bf9 Gitweb: https://git.kernel.org/tip/bd4edba2653aeef0119b7a945f07e58711343bf9 Author: Hans de Goede AuthorDate: Wed, 14 Dec 2022 22:24:47 +01:00 Committer: Ingo Molnar CommitterDate: Fri, 06 Jan 2023 04:22:34 +01:00 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 Signed-off-by: Ingo Molnar Acked-by: Rafael J. Wysocki Cc: linux-kernel@vger.kernel.org --- arch/x86/kernel/rtc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/rtc.c b/arch/x86/kernel/rtc.c index 3490464..1309b9b 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