Message ID | 20230430203153.5587-3-W_Armin@gmx.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2319257vqo; Sun, 30 Apr 2023 13:44:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6xJKaoqAykuQtCnR5ii3J2HANrnNa0MFBZY/aWK35LQlaX5Lo0JcZDk0QbXp9N7Cw2tNB9 X-Received: by 2002:a17:902:e742:b0:1a6:5fdf:6555 with SMTP id p2-20020a170902e74200b001a65fdf6555mr14003275plf.50.1682887465675; Sun, 30 Apr 2023 13:44:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682887465; cv=none; d=google.com; s=arc-20160816; b=Fg+tDFX6ihrDYJ3BQh5EJnfctrT0V6uWtm06aJ/AQ0HxV9fUNMCuD/IYHRyz3pg7Un N/Jcm3L+93ohvT28X765p8YANAPhQT2qrLdqqCHZjre3qnm+ELPCvLnlVFJyaIkkelaM R/2fOXfibIaD+f7tyjhqoEuG1lPVB91ZbEBhg893wO95xw+AnmNc2OIab9M4fAiY/adl b9aF1wkJJ09GnO/fGd8QZv9bZS40zosYKYuAgo8UEWvt5F8dtaWFNJbOxZKILk5tovtA D479J+EHTUp4D6YdTnVU9mgAsf4vR0nTFcP2KTn+9R1JwmfE2gDSfy3X95lkHmk7XJoM EOQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CNqf+f5zPBZWFdmnoftG1VLGnEP2nTg13y+gdrs0vKg=; b=AQ3cruB/QoeA1k8ZWYeL69lesqNRwcGJYbx//+uXdqqNEQZFk+3HHmMFKOcYMFJ7XC MKfi7kJLbH6fnX00QsXrGjNYz7kS4GNpoDsMfJY1B0w2f0oqdJ/jBg6OPBMd6L59zicc fyEGpfq3HETJe7q6c7BXy6Inr0AD6Got9k0fh7JETGJlHkZnVlNMuCcjC4c1tqr1T5Ye ZzCnS8kYfjJ9sbCiK4bDHl5sBW6j0aKyy6EOhL871S8/IGgAumw/2mrXBH804kimL3mb vjZRZKyhs1kryNTF+WACe+/MRTnzHNu3u2RTysR4peUhvycS6b+QKXuv2OZb5mlbAgG1 ptCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=U33PiAca; 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=NONE dis=NONE) header.from=gmx.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kb14-20020a170903338e00b001a8096ef2bfsi25045146plb.34.2023.04.30.13.44.11; Sun, 30 Apr 2023 13:44:25 -0700 (PDT) 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=@gmx.de header.s=s31663417 header.b=U33PiAca; 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=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232140AbjD3Uc1 (ORCPT <rfc822;rbbytesnap@gmail.com> + 99 others); Sun, 30 Apr 2023 16:32:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232076AbjD3UcW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 30 Apr 2023 16:32:22 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89870E65; Sun, 30 Apr 2023 13:32:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1682886721; i=w_armin@gmx.de; bh=EDo2jyGRTWwJyIb6T+IdrYD2Dz8qhCqNBIDZC2iaYVA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=U33PiAca2JeFTgN/u/vb5rZINcXOpDlaWODV6mwUxBp3Bghm46CUkJIzz549t68Zc 2X4LxGE1841PwxFs7/Audbqa7Lre8/PQUQ6REiY5R92TgrqSV7rj6CQmV75BFh21k0 6rXWpcPItLQF1mKwsM39WbVZgTZ+Gm/fbrylVPQzSaqFesUrQEHDINURcqWBrAlHEE c+FJPtf4PZICB7LnmnD+Wh9FvFkPZpgDUxnNpV5Hq0n2mP7hjp8TQuOIVFky3g/XQu xMEeMEJ13fb+3uu2BS4WVIAaYSRKA2njj3WaXYpjpUZd/Yw+89EJoRE+q7VSaqN6Vx X+HoyxqQBn29A== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from esprimo-mx.users.agdsn.de ([141.30.226.129]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mr9Bu-1qdr0x0mnO-00oEk4; Sun, 30 Apr 2023 22:32:01 +0200 From: Armin Wolf <W_Armin@gmx.de> To: hdegoede@redhat.com, markgross@kernel.org Cc: Mario.Limonciello@amd.com, prasanth.ksr@dell.com, jorgealtxwork@gmail.com, james@equiv.tech, Dell.Client.Kernel@dell.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] platform/x86: dell-sysman: Improve instance detection Date: Sun, 30 Apr 2023 22:31:53 +0200 Message-Id: <20230430203153.5587-3-W_Armin@gmx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230430203153.5587-1-W_Armin@gmx.de> References: <20230430203153.5587-1-W_Armin@gmx.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:xDqp28RbQ9gdl4+mJCz5HykoBlx+oHBru64jsoI2K989qzfUX6u TVZuwVGgu8V9Gf/2OJFqfm2qenYVplNYJHsk99o/1JwE/ghBU+7YcaU66GkD426iwau1sVV xZJX425K1HlmbMlj8c0kmhWWYRC44ETCQ6XjlhR6olzCjgx9U2cOmYZkbUmx3FOrXE9sSzm hJ2LO4ypu0goV/vIzCjxA== UI-OutboundReport: notjunk:1;M01:P0:flWVw255Rho=;ocnIOdG05yZ4JIgUC1FC1PPaiIi yDNshtyeph1fXo3vCfA1VO0BLLlsypYWdYgrYPlNUtR+x3kl1dIiU2zgCy3WFjJk2vBW355o7 /lD4ZMrOIl/Tj9N5w538Un06g375fk89Wsi23i02zDCaJ02EdChe87OzSVPFr1ER9D4+bmgc1 oUV3HTTSHTEuJwrmBKUCTyyZ7hmAtehRqOtLJG/1nE8OeqblpUdRiczM52utVK+GSgVkaeqMX Kyy52k+6sChGjldbztS2t80DYCfPrNbDzSAX9F6k5PaPWO3ThXQF3CRKZ2aAPm45oZRe78nfq 2mriSfVm2RnkQrAo284DsBN7Q+BIu8swgPPqpBT2CDTk+0uQBrMS0ZqIuGJP42h3Mh4+hp5hb vR5BkdVVySZZh/C8g8JiEZRKhFK+K2xJkFqKeCCoBByKUx+GzJxZ940zkrhFuUWejepgj3VGI JNWEvM0bpDAneMfSWEAALmEwszjcOECUgC/7MjnnA3OSJ0HGhi+3gsZnIYYoi9Cde/TlDVNN9 YxBPRCcBVXbONRIbuCxyyw0Mxknz+RR4P3JA2hvKblW0hR1nbiFmTy/aCO0i92nT1Kq0DN5K3 8MPr2oQ72C3szHUf06bVFIfxDHP3xsogJSIQ3DvxfBvRXokwLNpMrWU5YJ7z2peWuohsuwhKK IuePyb3bAo1Ae2sT6dGiJlL7nawfoZ2Y3aMPpRJ8frjQDRWJfPk0LsJEytBmV8KKJvsXbQ3Fb ZqF31h/lpERyNzlBgbAq9gP511Iw0cw14+NBeT+k/cXqbZtrEsbw0cf6OWfbl91Lbf0+5A+z2 zovcX9pO4pjxhaY8gkrA4HtcvhDF5gSis/F8BN28Y3GHPoGh0y/C+pjeibs0hfomBRSI1SE/6 gFqENXFT5Atcp9u34n/duA0FlhEHoMV0N3XbqRE/bAR1zlC7fCgR2kMbygYNseaVuBgWJzQcO hF6HZp/uwoR+6jGLzgFnQsTt3MM= X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764635407098572058?= X-GMAIL-MSGID: =?utf-8?q?1764635407098572058?= |
Series |
platform/x86: Allow retrieving the number of WMI object instances
|
|
Commit Message
Armin Wolf
April 30, 2023, 8:31 p.m. UTC
The WMI driver core already knows how many WMI object instances
are available, use this information instead of probing the WMI object
manually.
Compile-tested only.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
drivers/platform/x86/dell/dell-wmi-sysman/sysman.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
--
2.30.2
diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c index 0285b47d99d1..b68dd11cb892 100644 --- a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c +++ b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c @@ -303,16 +303,13 @@ union acpi_object *get_wmiobj_pointer(int instance_id, const char *guid_string) */ int get_instance_count(const char *guid_string) { - union acpi_object *wmi_obj = NULL; - int i = 0; + int ret; - do { - kfree(wmi_obj); - wmi_obj = get_wmiobj_pointer(i, guid_string); - i++; - } while (wmi_obj); + ret = wmi_instance_count(guid_string); + if (ret < 0) + return 0; - return (i-1); + return ret; } /**