From patchwork Mon Jun 26 11:00:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 112854 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7395336vqr; Mon, 26 Jun 2023 04:05:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5I7m4ZVXKa+F347cbLTwUeaKG3iVhI11jI4P8Lt1COo1Y0Y18VnLxyQSXgD5fodYeFSlhx X-Received: by 2002:a05:6402:494:b0:51b:dfb7:8200 with SMTP id k20-20020a056402049400b0051bdfb78200mr11107041edv.0.1687777533558; Mon, 26 Jun 2023 04:05:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687777533; cv=none; d=google.com; s=arc-20160816; b=Gi2cw4yaTSuXGRRsi/ErKMaqmrPjGbVgFkErtjsJrQeJuLKRzgjGPGagI2ewy96pLP BoLdxecZKTQvQcbZY+l6QuWbOGKdSi7GIEt6zWUZ0uMJWUcaFIJpKV02oaYbDXONhkLP v3ocsjOyOsO4BEvlEktLyLtM1AjuJR46lyroNCf76ALN6+VOnqHoxMvpC2Hg/HgvyYPx ysdSbyVKfkzl93QhaUZ0jZm2IxN4IymESYPhGN7MBcUUk5UZ1dAeGZgSslLqhVYYDC+w j3DbcPADCIteB6HesvTJJK6vt+RC3tU8FQCPoCUKB2dskze0IUKRZqHfK0Jv1UBbUfgI apgg== 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 :dkim-signature; bh=zlrwwhYEvkjxWvwPlTkLoA/QEUXhfaFllqa9lvtPrjw=; fh=YLPw3QnAgtYwSsGR7bXzDTb3Qi4Z0gTtWmJMk1JxRoE=; b=DLY3O9qlG6oCn89nRPNHvBqb/okseNebM0f/m3Q2ZF1/w6YkhqlSZh6QFxMSgGEWPO zzSpaB6N4dPswOz3KZAI5eXHR1ViMXve4FAY6L/G8nhAYmsSqUbNVB3973d2C7Vd2fR0 D7VZnKTReegIxOcXSZw9emG/2GNbRc5EvZ8nZiA8fe34waU58WU7DppTjRbJycahKqwx 5+mK6XkLwEVA543GH+m/33zbadboWgnWGqcswE9WwRHOik5qajNeivknC8V3dbiNTcC1 Uq2oZ34wdScU8+BGRnhRQd4PwOQUu6On87Fc0ByCv1nOtAk5awQbA9Mn+HUqkrXD7NWN sR1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=S2iGQ3P3; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u24-20020aa7d898000000b0051d91692643si1838773edq.536.2023.06.26.04.05.08; Mon, 26 Jun 2023 04:05:33 -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=@intel.com header.s=Intel header.b=S2iGQ3P3; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230288AbjFZLBG (ORCPT + 99 others); Mon, 26 Jun 2023 07:01:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230240AbjFZLAx (ORCPT ); Mon, 26 Jun 2023 07:00:53 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79B2710EA; Mon, 26 Jun 2023 04:00:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687777231; x=1719313231; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bhqeMcnIeLHiERhCVntd9eCy5M/ovDNlECDlMUUEH0Y=; b=S2iGQ3P3BXTyJWs8HIfWm1qP/Ayu9NZtY2sh3+b5v8J+nSud43Nrsyxn MOtnosfOKKtJihjK5dmG4sz0se3UpNmVWeXpDOkLE3gQXRROFpDFnDJtU 0SDUP08kgUYRjVKJOr/4AO0L195feEADnc/bjyDd7hyR3r8kQVHa649dW 2LoeA67zqs3yYQl4INZUmu6QEdfItHiXb2180sGuVnJN4Q8sDH9dZa/8M D03Q5xznXF/3zs1FVUqtKVPcm7fXeV4WBSrAR85sVOUCxc6egu4ZFwTA/ VmcF8vGmR/SKSH/V6B535yxLcVbL4zUaAWZNIYF2VSJBU8Z6Zfv1xz1vV A==; X-IronPort-AV: E=McAfee;i="6600,9927,10752"; a="351010844" X-IronPort-AV: E=Sophos;i="6.01,159,1684825200"; d="scan'208";a="351010844" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2023 04:00:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10752"; a="781391001" X-IronPort-AV: E=Sophos;i="6.01,159,1684825200"; d="scan'208";a="781391001" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 26 Jun 2023 04:00:17 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id F0E3378; Mon, 26 Jun 2023 14:00:27 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, acpica-devel@lists.linuxfoundation.org Cc: "Rafael J. Wysocki" , Len Brown , Andi Shyti , Robert Moore , Michael Walle Subject: [PATCH v3 1/4] ACPI: bus: Constify acpi_companion_match() returned value Date: Mon, 26 Jun 2023 14:00:23 +0300 Message-Id: <20230626110026.65825-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230626110026.65825-1-andriy.shevchenko@linux.intel.com> References: <20230626110026.65825-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769763015184102365?= X-GMAIL-MSGID: =?utf-8?q?1769763015184102365?= acpi_companion_match() doesn't alter the contents of the passed parameter, so we don't expect that returned value can be altered either. So constify it. Signed-off-by: Andy Shevchenko Reviewed-by: Andi Shyti --- drivers/acpi/bus.c | 6 +++--- drivers/acpi/device_sysfs.c | 2 +- drivers/acpi/internal.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index e3e0bd0c5a50..20cdfb37da79 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -682,7 +682,7 @@ bool acpi_device_is_first_physical_node(struct acpi_device *adev, * resources available from it but they will be matched normally using functions * provided by their bus types (and analogously for their modalias). */ -struct acpi_device *acpi_companion_match(const struct device *dev) +const struct acpi_device *acpi_companion_match(const struct device *dev) { struct acpi_device *adev; @@ -706,7 +706,7 @@ struct acpi_device *acpi_companion_match(const struct device *dev) * identifiers and a _DSD object with the "compatible" property, use that * property to match against the given list of identifiers. */ -static bool acpi_of_match_device(struct acpi_device *adev, +static bool acpi_of_match_device(const struct acpi_device *adev, const struct of_device_id *of_match_table, const struct of_device_id **of_id) { @@ -808,7 +808,7 @@ static bool __acpi_match_device_cls(const struct acpi_device_id *id, return true; } -static bool __acpi_match_device(struct acpi_device *device, +static bool __acpi_match_device(const struct acpi_device *device, const struct acpi_device_id *acpi_ids, const struct of_device_id *of_ids, const struct acpi_device_id **acpi_id, diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c index 0fbfbaa8d8e3..b9bbf0746199 100644 --- a/drivers/acpi/device_sysfs.c +++ b/drivers/acpi/device_sysfs.c @@ -283,7 +283,7 @@ int acpi_device_uevent_modalias(const struct device *dev, struct kobj_uevent_env } EXPORT_SYMBOL_GPL(acpi_device_uevent_modalias); -static int __acpi_device_modalias(struct acpi_device *adev, char *buf, int size) +static int __acpi_device_modalias(const struct acpi_device *adev, char *buf, int size) { int len, count; diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index 50dcb35c9965..f4148dc50b9c 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h @@ -121,7 +121,7 @@ int acpi_bus_register_early_device(int type); /* -------------------------------------------------------------------------- Device Matching and Notification -------------------------------------------------------------------------- */ -struct acpi_device *acpi_companion_match(const struct device *dev); +const struct acpi_device *acpi_companion_match(const struct device *dev); int __acpi_device_uevent_modalias(const struct acpi_device *adev, struct kobj_uevent_env *env);