From nobody Fri Oct 3 15:37:42 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29AC430DD11; Thu, 28 Aug 2025 11:03:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756378999; cv=none; b=uzlujb5HQ5FUxESW5Jm3IQEW6Ofl4sOOuvw4pZdNZeCe57i20PsCTjuwOMuVq9GEdpy19EyoFipqe5N51/MrKk5z5doWzXh1Nkc2dtnQuLPrvRszk40MudHmswZIkZ5v0T1mC3O76Z4EQzFQaJpCG7MzfbY+6HkjsOqS8LyISYQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756378999; c=relaxed/simple; bh=pjzAij7OpPaAmTNVqtQzbQpcumXq8d1CkhrUy4uidvo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=QkaYCquSMIW6/Y0YJbJuaLcNZjUeeZHNbm9CykDJBmsyTDktCfY65U9CqwQn/jnY7UHFUKdyvMoTnNvH3u92uc2kHNvlLCQYymcvNDrTmWo876lRe3/xbkN4gAJ6zmwVBsqpfpaie96+RMceTBnnc5Bf9HzZ9J+/qW8nNYagoso= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iJVbwR9E; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iJVbwR9E" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07FD0C4CEF6; Thu, 28 Aug 2025 11:03:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756378998; bh=pjzAij7OpPaAmTNVqtQzbQpcumXq8d1CkhrUy4uidvo=; h=From:To:Cc:Subject:Date:From; b=iJVbwR9Ey1vPlkNXduKN6HwFO8hqpA39J8h7gOCQX34bfvbjY1IXJU3fzrOxt5ziw QQ2pIEY3VzMcpcUtH6YoQMqRNIz+83+sWXN4L1tUjuj8YOwUMsC0TUJEOaJtrZEKaB atOtmQ59xeHFS5OCJdfaB/PGydTHHdLZXQv/nvxnh4xKiYhwVtllS1rCKjWoggX/SW no2IbAY6HdTfRhaeOizQS+hW2r7UYD/J6akhL6buCNrxtl51EcfntjWy3COHgmE3/2 Q7sWAQxDB1JYRrW77fzV8uCy3b3vgXz5r1XOx9SOSd0cYj5AKc9V4ZRiH8DyHS+wm8 SlEbbF4CHV2+Q== From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Linux PM , Zhang Rui , Armin Wolf Subject: [PATCH v1] ACPI: fan: Fold two simple functions into their only caller Date: Thu, 28 Aug 2025 13:03:13 +0200 Message-ID: <3386797.aeNJFYEL58@rafael.j.wysocki> Organization: Linux Kernel Development Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Rafael J. Wysocki Both acpi_fan_has_fst() and acpi_fan_is_acpi4() are called from one place only, so fold them both into there caller which yields slightly leaner code that is somewhat easier to follow. No intentional functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/fan_core.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) --- a/drivers/acpi/fan_core.c +++ b/drivers/acpi/fan_core.c @@ -203,18 +203,6 @@ * -----------------------------------------------------------------------= --- */ =20 -static bool acpi_fan_has_fst(struct acpi_device *device) -{ - return acpi_has_method(device->handle, "_FST"); -} - -static bool acpi_fan_is_acpi4(struct acpi_device *device) -{ - return acpi_has_method(device->handle, "_FIF") && - acpi_has_method(device->handle, "_FPS") && - acpi_has_method(device->handle, "_FSL"); -} - static int acpi_fan_get_fif(struct acpi_device *device) { struct acpi_buffer buffer =3D { ACPI_ALLOCATE_BUFFER, NULL }; @@ -331,9 +319,11 @@ device->driver_data =3D fan; platform_set_drvdata(pdev, fan); =20 - if (acpi_fan_has_fst(device)) { + if (acpi_has_method(device->handle, "_FST")) { fan->has_fst =3D true; - fan->acpi4 =3D acpi_fan_is_acpi4(device); + fan->acpi4 =3D acpi_has_method(device->handle, "_FIF") && + acpi_has_method(device->handle, "_FPS") && + acpi_has_method(device->handle, "_FSL"); } =20 if (fan->acpi4) {