lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 26 Sep 2023 19:56:15 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Daniel Lezcano <daniel.lezcano@...aro.org>
Cc:     "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Linux PM <linux-pm@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Linux ACPI <linux-acpi@...r.kernel.org>,
        Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
        Zhang Rui <rui.zhang@...el.com>,
        Lukasz Luba <lukasz.luba@....com>,
        "Rafael J. Wysocki" <rafael@...nel.org>
Subject: Re: [PATCH v1 02/13] ACPI: thermal: Collapse trip devices update functions

On Tue, Sep 26, 2023 at 7:18 PM Daniel Lezcano
<daniel.lezcano@...aro.org> wrote:
>
> On 21/09/2023 19:49, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> >
> > In order to reduce code duplication, merge update_passive_devices() and
> > update_active_devices() into one function called update_trip_devices()
> > that will be used for updating both the passive and active trip points.
> >
> > No intentional functional impact.
> >
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> > ---
> >   drivers/acpi/thermal.c |   53 ++++++++++++++++++-------------------------------
> >   1 file changed, 20 insertions(+), 33 deletions(-)
> >
> > Index: linux-pm/drivers/acpi/thermal.c
> > ===================================================================
> > --- linux-pm.orig/drivers/acpi/thermal.c
> > +++ linux-pm/drivers/acpi/thermal.c
> > @@ -43,6 +43,8 @@
> >   #define ACPI_THERMAL_MAX_ACTIVE             10
> >   #define ACPI_THERMAL_MAX_LIMIT_STR_LEN      65
> >
> > +#define ACPI_THERMAL_TRIP_PASSIVE    (-1)
> > +
> >   /*
> >    * This exception is thrown out in two cases:
> >    * 1.An invalid trip point becomes invalid or a valid trip point becomes invalid
> > @@ -202,18 +204,25 @@ static void acpi_thermal_update_passive_
> >               ACPI_THERMAL_TRIPS_EXCEPTION(tz, "state");
> >   }
> >
> > -static bool update_passive_devices(struct acpi_thermal *tz, bool compare)
> > +static bool update_trip_devices(struct acpi_thermal *tz,
> > +                             struct acpi_thermal_trip *acpi_trip,
> > +                             int index, bool compare)
> >   {
> > -     struct acpi_thermal_trip *acpi_trip = &tz->trips.passive.trip;
> >       struct acpi_handle_list devices;
> > +     char method[] = "_PSL";
> >       acpi_status status;
> >
> > +     if (index != ACPI_THERMAL_TRIP_PASSIVE) {
> > +             method[1] = 'A';
> > +             method[2] = 'L';
> > +             method[3] = '0' + index;
> > +     }
>
> Could be index > 9 ?

I can add a check, but it will never be called with index > 9 anyway.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ