[v1,1/5] ACPI: thermal: Use BIT() macro for defining flags

Message ID 3229381.aeNJFYEL58@kreacher
State New
Headers
Series ACPI: thermal: Assorted cleanups |

Commit Message

Rafael J. Wysocki May 30, 2023, 3:44 p.m. UTC
  From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Use the BIT() macro for defining flag symbols in the ACPI thermal driver
instead of using "raw" values for the flags.

No functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/thermal.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Comments

Wilczynski, Michal May 31, 2023, 7:33 a.m. UTC | #1
On 5/30/2023 5:44 PM, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Use the BIT() macro for defining flag symbols in the ACPI thermal driver
> instead of using "raw" values for the flags.
>
> No functional impact.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  drivers/acpi/thermal.c |   10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> Index: linux-pm/drivers/acpi/thermal.c
> ===================================================================
> --- linux-pm.orig/drivers/acpi/thermal.c
> +++ linux-pm/drivers/acpi/thermal.c
> @@ -232,11 +232,11 @@ static int acpi_thermal_set_cooling_mode
>  	return 0;
>  }
>  
> -#define ACPI_TRIPS_CRITICAL	0x01
> -#define ACPI_TRIPS_HOT		0x02
> -#define ACPI_TRIPS_PASSIVE	0x04
> -#define ACPI_TRIPS_ACTIVE	0x08
> -#define ACPI_TRIPS_DEVICES	0x10
> +#define ACPI_TRIPS_CRITICAL	BIT(0)
> +#define ACPI_TRIPS_HOT		BIT(1)
> +#define ACPI_TRIPS_PASSIVE	BIT(2)
> +#define ACPI_TRIPS_ACTIVE	BIT(3)
> +#define ACPI_TRIPS_DEVICES	BIT(4)
>  
>  #define ACPI_TRIPS_REFRESH_THRESHOLDS	(ACPI_TRIPS_PASSIVE | ACPI_TRIPS_ACTIVE)
>  #define ACPI_TRIPS_REFRESH_DEVICES	ACPI_TRIPS_DEVICES

Looks good to me,

Reviewed-by: Michal Wilczynski <michal.wilczynski@intel.com>

>
>
  

Patch

Index: linux-pm/drivers/acpi/thermal.c
===================================================================
--- linux-pm.orig/drivers/acpi/thermal.c
+++ linux-pm/drivers/acpi/thermal.c
@@ -232,11 +232,11 @@  static int acpi_thermal_set_cooling_mode
 	return 0;
 }
 
-#define ACPI_TRIPS_CRITICAL	0x01
-#define ACPI_TRIPS_HOT		0x02
-#define ACPI_TRIPS_PASSIVE	0x04
-#define ACPI_TRIPS_ACTIVE	0x08
-#define ACPI_TRIPS_DEVICES	0x10
+#define ACPI_TRIPS_CRITICAL	BIT(0)
+#define ACPI_TRIPS_HOT		BIT(1)
+#define ACPI_TRIPS_PASSIVE	BIT(2)
+#define ACPI_TRIPS_ACTIVE	BIT(3)
+#define ACPI_TRIPS_DEVICES	BIT(4)
 
 #define ACPI_TRIPS_REFRESH_THRESHOLDS	(ACPI_TRIPS_PASSIVE | ACPI_TRIPS_ACTIVE)
 #define ACPI_TRIPS_REFRESH_DEVICES	ACPI_TRIPS_DEVICES