Re: [PATCH v1 6/9] iwlwifi: mvm: Set THERMAL_TRIP_WRITABLE_TEMP directly

From: Johannes Berg
Date: Mon Feb 12 2024 - 05:31:52 EST


On Fri, 2024-02-09 at 17:15 +0100, Rafael J. Wysocki wrote:
> > > for (i = 0 ; i < IWL_MAX_DTS_TRIPS; i++) {
> > > mvm->tz_device.trips[i].temperature = THERMAL_TEMP_INVALID;
> > > mvm->tz_device.trips[i].type = THERMAL_TRIP_PASSIVE;
> > > + mvm->tz_device.trips[i].type = THERMAL_TRIP_WRITABLE_TEMP;
> >
> > mvm->tz_device.trips[i].flags = THERMAL_TRIP_WRITABLE_TEMP;
> >
> > Consider using diffrent prefix for constants to diffrenciate flags and types.
>
> Well, I can use THERMAL_TRIP_FLAG_RW_TEMP or similar, but is it really
> so confusing?
>
> I'm wondering what others think.
>

I'd tend to agree with Stanislaw. I did (eventually) notice the double
assignment to .type above, but had that not been visible in the context,
or you'd have removed the first one by accident, I'd really not have
thought about it twice.

The bug also makes it look like you even confused yourself ;-)

So having a clearer indication that it's a flag would make sense, I'd
say.

johannes