From patchwork Fri Aug 26 17:16:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 600590 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F279ECAAA6 for ; Fri, 26 Aug 2022 17:16:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231765AbiHZRQa (ORCPT ); Fri, 26 Aug 2022 13:16:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232757AbiHZRQ3 (ORCPT ); Fri, 26 Aug 2022 13:16:29 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6C574DB6A; Fri, 26 Aug 2022 10:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661534188; x=1693070188; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=FfFIK+JFW+0b6Ao4zVJ5GS+N8o3sRHua/8mxgsHvrCg=; b=lx0Q3EEF9HFiE3vT3PRUqBUx1Z9je10zqmER7r8bN/hfBKSqsax5nWk7 3Qjc84djbSSF0HCmi7ACKFGVoeToCA98ee5Kf18bZW2HxHJR34+U5ddh+ ttlYRRYuYI92xgLZ7fVsukqP1VOjQ67tkzgCfrx2hmrDiDj9lQM6VAChO JYA4qiwjZiUv+lOTuj4MIO4/WZHwmMV3qrJnoIQ3rTW9uGx4mL9o/W7dq HQHfu1Slf3fLIX+tQ6rIAQFkNEfdRu+TI2O6etVJyr1R6w25r+5Milz9j 16KELDUiAEod/vzhh9K/3Y5B3K/wpL3dzb2ytKshow0nxQ0BNOEdoVh5d A==; X-IronPort-AV: E=McAfee;i="6500,9779,10451"; a="292134231" X-IronPort-AV: E=Sophos;i="5.93,265,1654585200"; d="scan'208";a="292134231" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2022 10:16:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,265,1654585200"; d="scan'208";a="699914142" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 26 Aug 2022 10:16:26 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2C5E719D; Fri, 26 Aug 2022 20:16:41 +0300 (EEST) From: Andy Shevchenko To: "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown , Andy Shevchenko Subject: [PATCH v2 1/2] ACPI: bus: Drop kernel doc annotation from acpi_bus_notify() Date: Fri, 26 Aug 2022 20:16:34 +0300 Message-Id: <20220826171635.15652-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The description for acpi_bus_notify() is quite far from what kernel doc expects. It complains about this: Function parameter or member 'handle' not described in 'acpi_bus_notify' Function parameter or member 'type' not described in 'acpi_bus_notify' Function parameter or member 'data' not described in 'acpi_bus_notify' Fix this by dropping kernel doc annotation. Signed-off-by: Andy Shevchenko --- v2: no changes drivers/acpi/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index f60d4dc45c1f..f3e868d35144 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -456,7 +456,7 @@ static void acpi_bus_osc_negotiate_usb_control(void) Notification Handling -------------------------------------------------------------------------- */ -/** +/* * acpi_bus_notify * --------------- * Callback for all 'system-level' device notifications (values 0x00-0x7F). From patchwork Fri Aug 26 17:16:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 600357 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAAB6ECAAD7 for ; Fri, 26 Aug 2022 17:16:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232757AbiHZRQe (ORCPT ); Fri, 26 Aug 2022 13:16:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344450AbiHZRQd (ORCPT ); Fri, 26 Aug 2022 13:16:33 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DE6E6B8C6; Fri, 26 Aug 2022 10:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661534189; x=1693070189; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bYEvZrVYncsTx8f79csRdY+X+4yXs90ZO8FXGrSoPmk=; b=GTHRq7dsbpFI0lQBl4Dp+eUbQIA0bFWzkLNw6D1Lak1cZpsUwjE/eQgQ 45FaDUWDWR+VcIzM0jcYtWMeQIUhW7ahk19CDcDTtB8bMQExA9IjUrV2S wkTUGhTghoIodftyotKIiUMCkYHmOWrVv5ZbuEOnx58AdaSLEqYJlMCj+ mZs3AW2TfFr7Xmc2ct9857tJ5K/3rSiPiorB+q5pBnpzG0y+4uaDsV0dM DzcHmakxLSTNfI1ubuFYkWP8ReAESeG9G7P60iYdjFqosDC4528Fb11+V 7h55YOTi++EuEEjUm1u5/421exHTctjo15jDTL8OfZrTogsGFHCSV8owr A==; X-IronPort-AV: E=McAfee;i="6500,9779,10451"; a="295333128" X-IronPort-AV: E=Sophos;i="5.93,265,1654585200"; d="scan'208";a="295333128" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2022 10:16:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,265,1654585200"; d="scan'208";a="678932980" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 26 Aug 2022 10:16:26 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 37215174; Fri, 26 Aug 2022 20:16:41 +0300 (EEST) From: Andy Shevchenko To: "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown , Andy Shevchenko Subject: [PATCH v2 2/2] ACPI: bus: Refactor ACPI matching functions for better readability Date: Fri, 26 Aug 2022 20:16:35 +0300 Message-Id: <20220826171635.15652-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220826171635.15652-1-andriy.shevchenko@linux.intel.com> References: <20220826171635.15652-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org With temporary variables for OF and ACPI IDs, it's easier to read the code. No functional change intended. Signed-off-by: Andy Shevchenko --- v2: refactored another function (due to drop the rest of the series) drivers/acpi/bus.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index f3e868d35144..d466c8195314 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -925,12 +925,13 @@ static const void *acpi_of_device_get_match_data(const struct device *dev) const void *acpi_device_get_match_data(const struct device *dev) { + const struct acpi_device_id *acpi_ids = dev->driver->acpi_match_table; const struct acpi_device_id *match; - if (!dev->driver->acpi_match_table) + if (!acpi_ids) return acpi_of_device_get_match_data(dev); - match = acpi_match_device(dev->driver->acpi_match_table, dev); + match = acpi_match_device(acpi_ids, dev); if (!match) return NULL; @@ -948,14 +949,13 @@ EXPORT_SYMBOL(acpi_match_device_ids); bool acpi_driver_match_device(struct device *dev, const struct device_driver *drv) { - if (!drv->acpi_match_table) - return acpi_of_match_device(ACPI_COMPANION(dev), - drv->of_match_table, - NULL); - - return __acpi_match_device(acpi_companion_match(dev), - drv->acpi_match_table, drv->of_match_table, - NULL, NULL); + const struct acpi_device_id *acpi_ids = drv->acpi_match_table; + const struct of_device_id *of_ids = drv->of_match_table; + + if (!acpi_ids) + return acpi_of_match_device(ACPI_COMPANION(dev), of_ids, NULL); + + return __acpi_match_device(acpi_companion_match(dev), acpi_ids, of_ids, NULL, NULL); } EXPORT_SYMBOL_GPL(acpi_driver_match_device);