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]
Message-ID: <CAJZ5v0jYx2ssJ4JtzA7EdRUrXJCNVr4=FjnWbHUDB1ZX-NpN5Q@mail.gmail.com>
Date:   Tue, 28 Nov 2023 13:57:50 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Lukasz Luba <lukasz.luba@....com>
Cc:     "Rafael J. Wysocki" <rjw@...ysocki.net>,
        LKML <linux-kernel@...r.kernel.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
        Zhang Rui <rui.zhang@...el.com>
Subject: Re: [PATCH v1] thermal: trip: Rework thermal_zone_set_trip() and its callers

On Tue, Nov 28, 2023 at 1:53 PM Rafael J. Wysocki <rafael@...nel.org> wrote:
>
> Hi Lukasz,
>
> On Tue, Nov 28, 2023 at 9:16 AM Lukasz Luba <lukasz.luba@....com> wrote:
> >
> > Hi Rafael,
> >
> > On 11/27/23 19:59, Rafael J. Wysocki wrote:
> > > From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> > >

[cut]

> > > Index: linux-pm/drivers/thermal/thermal_trip.c
> > > ===================================================================
> > > --- linux-pm.orig/drivers/thermal/thermal_trip.c
> > > +++ linux-pm/drivers/thermal/thermal_trip.c
> > > @@ -148,42 +148,61 @@ int thermal_zone_get_trip(struct thermal
> > >   EXPORT_SYMBOL_GPL(thermal_zone_get_trip);
> > >
> > >   int thermal_zone_set_trip(struct thermal_zone_device *tz, int trip_id,
> > > -                       const struct thermal_trip *trip)
> > > +                       enum thermal_set_trip_target what, const char *buf)
> > >   {
> > > -     struct thermal_trip t;
> > > -     int ret;
> > > +     struct thermal_trip *trip;
> > > +     int val, ret = 0;
> > >
> > > -     if (!tz->ops->set_trip_temp && !tz->ops->set_trip_hyst && !tz->trips)
> > > -             return -EINVAL;
> >
> > Here we could bail out when there are no callbacks.
>
> Not really, because the trip is updated regardless.

Actually, the condition above is always false after recent changes,
because tz->trips[] is always present, so the if () statement is
redundant.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ