diff mbox series

ACPI: thermal: drop an always true check

Message ID 20211115173208.57911-1-kilobyte@angband.pl (mailing list archive)
State Mainlined, archived
Headers show
Series ACPI: thermal: drop an always true check | expand

Commit Message

Adam Borowski Nov. 15, 2021, 5:32 p.m. UTC
Address of a field inside a struct can't possibly be null; gcc-12 warns
about this.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
---
 drivers/acpi/thermal.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Rafael J. Wysocki Nov. 16, 2021, 7:33 p.m. UTC | #1
On Mon, Nov 15, 2021 at 6:55 PM Adam Borowski <kilobyte@angband.pl> wrote:
>
> Address of a field inside a struct can't possibly be null; gcc-12 warns
> about this.
>
> Signed-off-by: Adam Borowski <kilobyte@angband.pl>
> ---
>  drivers/acpi/thermal.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
> index 95105db642b9..155bbabcc6f5 100644
> --- a/drivers/acpi/thermal.c
> +++ b/drivers/acpi/thermal.c
> @@ -1098,8 +1098,6 @@ static int acpi_thermal_resume(struct device *dev)
>                 return -EINVAL;
>
>         for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
> -               if (!(&tz->trips.active[i]))
> -                       break;
>                 if (!tz->trips.active[i].flags.valid)
>                         break;
>                 tz->trips.active[i].flags.enabled = 1;
> --

Applied as 5.16-rc material, thanks!
diff mbox series

Patch

diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 95105db642b9..155bbabcc6f5 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -1098,8 +1098,6 @@  static int acpi_thermal_resume(struct device *dev)
 		return -EINVAL;
 
 	for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
-		if (!(&tz->trips.active[i]))
-			break;
 		if (!tz->trips.active[i].flags.valid)
 			break;
 		tz->trips.active[i].flags.enabled = 1;