On Fri, 2016-03-04 at 19:39 +0100, Bjørn Mork wrote:
> Emmanuel Grumbach <[email protected]> writes:
>
> > From: Chaya Rachel Ivgi <[email protected]>
> >
> > Register to thermal_zone interface and implement the
> > thermal ops.
>
> And there it was :)
Yes, I guess you knew it was coming. :)
> > +static void iwl_mvm_thermal_zone_register(struct iwl_mvm *mvm)
> > +{
> > + int i;
> > + char name[] = "iwlwifi";
> > +
> > + if (!iwl_mvm_is_tt_in_fw(mvm)) {
> > + mvm->tz_device.tzone = NULL;
> > +
> > + return;
> > + }
> > +
> > + BUILD_BUG_ON(ARRAY_SIZE(name) >= THERMAL_NAME_LENGTH);
> > +
> > + mvm->tz_device.tzone = thermal_zone_device_register(name,
>
>
> Why not simply
> mvm->tz_device.tzone = thermal_zone_device_register(DRV_NAME,
> ?
Good point, I guess we could have used DRV_NAME instead of defining the
same string again. The BUILD_BUG_ON() is just to be extra careful and
is probably a bit overkill now. We have debated a lot about this name,
if it would have to be dynamic (i.e. different names for each device),
but then we settled on simply using the driver name. Additionally, it
seems that most (if not all) other callers of this function pass their
own string instead of using DRV_NAME or whatever...
--
Cheers,
Luca.