Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp745862pxb; Wed, 25 Aug 2021 14:06:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqMPKg5g4z0UZVUSS0E5pNkwdAI3v1WrenboKzCsOz+ZRwD2Cc/XACXfhwkCNAz0EU9aR7 X-Received: by 2002:a05:6638:338a:: with SMTP id h10mr413410jav.8.1629925604808; Wed, 25 Aug 2021 14:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629925604; cv=none; d=google.com; s=arc-20160816; b=tRiVki86d1rXDNW/uG5r6nSpSJ4Rc8C1M8ylG9zNqA+O45XBANtE6j/MQkATRE1bCG FCrhSnSFqTZ03iGxmSWocYlofUjqH9QEH16hZNACPrsHF/LszOUY1lWDmU1i3B1O2Ity 9+zSIChJ7SBDvUHHBESA+tBApUKlZ/Uxgjxmmk5OfqXgOeTifdLxwbP4TomBYB8RkrXj t3zVOynb3hazNqVxzAGEh+IkOy27W48ikD8oPdwInzWQRL4t/gloLhQNTvLPeaykWvMp M3Ih8X4VDBUjur2WZQCR8ycGx0x+22LiaenX1SrmiuJMVUMlt4660lfhzuLG7ZkegiGY nYwQ== 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 :message-id:date:subject:cc:to:from; bh=MqdFRU3TI6JvYxsLTIGQfZivgcUSIqPNu19hhpDd19o=; b=nhyGjY4thZvAukynPYVQ8PWPC3/YlUa5McevaGV2kPeZOVHFdQ1DS/tzEDl21O0z84 u4GEGuaGW/vpm8gbtVm6MPpPBVtmNZwaU1awyg4EKCWF24W7AvW1p/FVKOQeFPGRjvyl 0OoX+EbodEhkkpARtE/OnZFbggAQn/tvlQFyXVNDQV/bvzgWfJU8//EkQeiAbNcat4iD 4GDX64C5lUKtxaooqfnGjMDKC/IUtv2ixdLPuvYpRUjIJD6obI3O5dTz4Ic7b7eFpGrZ rmVjCyXLp3BgNNZAouq5dYkG2Xd+t897sF3A1XLEXitAKhfzwslL/WETmAqV8IqZ35vN R2wA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b9si817577ion.34.2021.08.25.14.06.31; Wed, 25 Aug 2021 14:06:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237350AbhHYSeP (ORCPT + 99 others); Wed, 25 Aug 2021 14:34:15 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:56878 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237633AbhHYScI (ORCPT ); Wed, 25 Aug 2021 14:32:08 -0400 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 3.0.0) id bd8eaabcade34f46; Wed, 25 Aug 2021 20:31:12 +0200 Received: from kreacher.localnet (unknown [213.134.181.157]) (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 v370.home.net.pl (Postfix) with ESMTPSA id 899F566A28D; Wed, 25 Aug 2021 20:31:11 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: Linux PM , LKML Subject: [PATCH] ACPI: power: Drop name from struct acpi_power_resource Date: Wed, 25 Aug 2021 20:31:10 +0200 Message-ID: <2616419.mvXUDI8C0e@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.181.157 X-CLIENT-HOSTNAME: 213.134.181.157 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddruddtledguddvjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhephfegtdffjeehkeegleejveevtdeugfffieeijeduuddtkefgjedvheeujeejtedvnecukfhppedvudefrddufeegrddukedurdduheejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudekuddrudehjedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-DCC--Metrics: v370.home.net.pl 1024; Body=3 Fuz1=3 Fuz2=3 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Drop the name field (that only is used in diagnostic messages) from struct acpi_power_resource and use the name of the power resource device object instead of it. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/power.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) Index: linux-pm/drivers/acpi/power.c =================================================================== --- linux-pm.orig/drivers/acpi/power.c +++ linux-pm/drivers/acpi/power.c @@ -48,7 +48,6 @@ struct acpi_power_dependent_device { struct acpi_power_resource { struct acpi_device device; struct list_head list_node; - char *name; u32 system_level; u32 order; unsigned int ref_count; @@ -70,6 +69,11 @@ static DEFINE_MUTEX(power_resource_list_ Power Resource Management -------------------------------------------------------------------------- */ +static inline const char *resource_dev_name(struct acpi_power_resource *pr) +{ + return dev_name(&pr->device.dev); +} + static inline struct acpi_power_resource *to_power_resource(struct acpi_device *device) { @@ -264,7 +268,8 @@ acpi_power_resource_add_dependent(struct dep->dev = dev; list_add_tail(&dep->node, &resource->dependents); - dev_dbg(dev, "added power dependency to [%s]\n", resource->name); + dev_dbg(dev, "added power dependency to [%s]\n", + resource_dev_name(resource)); unlock: mutex_unlock(&resource->resource_lock); @@ -283,7 +288,7 @@ acpi_power_resource_remove_dependent(str list_del(&dep->node); kfree(dep); dev_dbg(dev, "removed power dependency to [%s]\n", - resource->name); + resource_dev_name(resource)); break; } } @@ -381,7 +386,7 @@ static int __acpi_power_on(struct acpi_p list_for_each_entry(dep, &resource->dependents, node) { dev_dbg(dep->dev, "runtime resuming because [%s] turned on\n", - resource->name); + resource_dev_name(resource)); pm_request_resume(dep->dev); } @@ -953,7 +958,6 @@ struct acpi_device *acpi_add_power_resou mutex_init(&resource->resource_lock); INIT_LIST_HEAD(&resource->list_node); INIT_LIST_HEAD(&resource->dependents); - resource->name = device->pnp.bus_id; strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_POWER_CLASS); device->power.state = ACPI_STATE_UNKNOWN;