Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4590026rdh; Wed, 29 Nov 2023 05:53:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IELxhLpXF67Q8P5Yu5BM2eKlceJQGlg7VM9uyM/mCrzDumUoYoCgxHxO0ah1DJCOHfKdMNP X-Received: by 2002:a17:902:efd4:b0:1cf:b547:19f1 with SMTP id ja20-20020a170902efd400b001cfb54719f1mr13104213plb.43.1701265996565; Wed, 29 Nov 2023 05:53:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701265996; cv=none; d=google.com; s=arc-20160816; b=jXHBYBfFS+PgUjP3cFPj+6AAWfX+htqp269V7fLhTs+pxdh8Y9DSfthKkz6agsq16/ uf1Cu777KHqJUw9ROSCPpZpyKUi3L8c7xj4YHIYJVrYyP4/Qw3iBFFZlW/gvkY4LeGMN N7mJHdVrynHp5jxm/tu1gWT2QKpQokS6TxZ271drdkxHNlSJWaSDpsBHtKFkJIh2f4Ty H/UGm344WGSLpLbaveaFvZOR8LgnKXxxPc49qlMW2jkOCzBPmmIFTq7IkXV2Y50hLkqb Xn0js37KifhVMq+m09lJJsFgUy9mZFANJWKBQrjJ34uvZ2diuhYoZrMcuGjQsk33f7Y/ PmGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9ca4brxODmtmZzocsEeYaHJ9aFPo81Ojhfx+hC0qNAA=; fh=Xy56yUsN7dnS9aJqFVOKrydaYiEvkn2fuPmAP6j6D88=; b=uhKO5K0NzzqfpZNIWUCzjQS5clK2QQpKvsg+DsxVm8l17RqlipMZfZWK+9u3eQBoIg ltm9Y0NdhghoEiQKTePzURMyx4KVfMw6pr770l+B+rrDuL8m6GCIlkH+TzUSX0ZH1QKo VGu2IGTBNAbLG44vfg+H0Z0IUWf9mXUC/0nbnxk1JpkiGCyfs1ybMuI+ljDxhen10ppc ySx1u6H2dcTNzk2LL/J7YWbOUp8Nnc4YkCmFDOSTDaK/UaYjL5A/J7JxelVR/vt5PTbU fkquZ1STdIfxpnPhDe/kNAgcJ9Xmc+EvKW2emOOnBX9/CZs4toFvDFJwvntp4UJVWMif WdyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id d12-20020a170902654c00b001cf63d5130csi14370597pln.160.2023.11.29.05.53.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 05:53:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id CE1A281F3232; Wed, 29 Nov 2023 05:53:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234464AbjK2Nws (ORCPT + 99 others); Wed, 29 Nov 2023 08:52:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234426AbjK2Nwq (ORCPT ); Wed, 29 Nov 2023 08:52:46 -0500 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09E85CE; Wed, 29 Nov 2023 05:52:51 -0800 (PST) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.4.0) id 21be0937861611c0; Wed, 29 Nov 2023 14:52:50 +0100 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cloudserver094114.home.pl (Postfix) with ESMTPSA id 0D2A16685F3; Wed, 29 Nov 2023 14:52:50 +0100 (CET) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Zhang Rui , Srinivas Pandruvada , Michal Wilczynski , Hans de Goede , Andy Shevchenko , Mika Westerberg , Heikki Krogerus , Mario Limonciello Subject: [PATCH v1 2/4] ACPI: OSL: Rearrange workqueue selection in acpi_os_execute() Date: Wed, 29 Nov 2023 14:48:22 +0100 Message-ID: <2267180.iZASKD2KPV@kreacher> In-Reply-To: <3281896.aeNJFYEL58@kreacher> References: <3281896.aeNJFYEL58@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrudeihedgheehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepuddtpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhuihdriihhrghnghesihhnthgvlhdrtghomhdprhgtphhtthhopehsrhhinhhivhgrshdrphgrnhgurhhuvhgruggrsehlihhnuhigrdhinhhtvghlrdgt ohhmpdhrtghpthhtohepmhhitghhrghlrdifihhltgiihihnshhkihesihhnthgvlhdrtghomhdprhgtphhtthhopehhuggvghhovgguvgesrhgvughhrghtrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=10 Fuz1=10 Fuz2=10 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 29 Nov 2023 05:53:14 -0800 (PST) From: Rafael J. Wysocki Replace the 3-branch if () statement used for selecting the target workqueue in acpi_os_execute() with a switch () one that is more suitable for this purpose and carry out the work item initialization before it to avoid code duplication. No intentional functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/osl.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) Index: linux-pm/drivers/acpi/osl.c =================================================================== --- linux-pm.orig/drivers/acpi/osl.c +++ linux-pm/drivers/acpi/osl.c @@ -1092,19 +1092,21 @@ acpi_status acpi_os_execute(acpi_execute dpc->function = function; dpc->context = context; + INIT_WORK(&dpc->work, acpi_os_execute_deferred); /* * To prevent lockdep from complaining unnecessarily, make sure that * there is a different static lockdep key for each workqueue by using * INIT_WORK() for each of them separately. */ - if (type == OSL_NOTIFY_HANDLER) { + switch (type) { + case OSL_NOTIFY_HANDLER: queue = kacpi_notify_wq; - INIT_WORK(&dpc->work, acpi_os_execute_deferred); - } else if (type == OSL_GPE_HANDLER) { + break; + case OSL_GPE_HANDLER: queue = kacpid_wq; - INIT_WORK(&dpc->work, acpi_os_execute_deferred); - } else { + break; + default: pr_err("Unsupported os_execute type %d.\n", type); goto err; }