diff mbox series

[1/2] ACPI: CPPC: Replace ternary operator with max() in cppc_find_dmi_mhz

Message ID 20240626111446.1445111-2-prabhakar.pujeri@gmail.com (mailing list archive)
State New, archived
Headers show
Series ACPI: Replace Ternary Operations with min()/max() Macros | expand

Commit Message

Prabhakar Pujeri June 26, 2024, 11:14 a.m. UTC
Signed-off-by: Prabhakar Pujeri <prabhakar.pujeri@gmail.com>
---
 drivers/acpi/cppc_acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rafael J. Wysocki July 2, 2024, 7:04 p.m. UTC | #1
On Wed, Jun 26, 2024 at 1:15 PM Prabhakar Pujeri
<prabhakar.pujeri@gmail.com> wrote:
>
> Signed-off-by: Prabhakar Pujeri <prabhakar.pujeri@gmail.com>
> ---
>  drivers/acpi/cppc_acpi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
> index 1d857978f5f4..a2591e1677f5 100644
> --- a/drivers/acpi/cppc_acpi.c
> +++ b/drivers/acpi/cppc_acpi.c
> @@ -1837,7 +1837,7 @@ static void cppc_find_dmi_mhz(const struct dmi_header *dm, void *private)
>             dm->length >= DMI_ENTRY_PROCESSOR_MIN_LENGTH) {
>                 u16 val = (u16)get_unaligned((const u16 *)
>                                 (dmi_data + DMI_PROCESSOR_MAX_SPEED));
> -               *mhz = val > *mhz ? val : *mhz;
> +               *mhz = max(val, *mhz);
>         }
>  }
>
> --

Applied as 6.11 material with some edits in the subject and changelog, thanks!
diff mbox series

Patch

diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index 1d857978f5f4..a2591e1677f5 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -1837,7 +1837,7 @@  static void cppc_find_dmi_mhz(const struct dmi_header *dm, void *private)
 	    dm->length >= DMI_ENTRY_PROCESSOR_MIN_LENGTH) {
 		u16 val = (u16)get_unaligned((const u16 *)
 				(dmi_data + DMI_PROCESSOR_MAX_SPEED));
-		*mhz = val > *mhz ? val : *mhz;
+		*mhz = max(val, *mhz);
 	}
 }