Re: [PATCH 04/14] drm/i915: Data driven register to forcewake domains lookup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> writes:

> On pe, 2016-09-30 at 18:48 +0100, Tvrtko Ursulin wrote:
>> 
>> +find_fw_domain(u32 offset, const struct intel_forcewake_range *ranges,
>> +	       unsigned int num_ranges)
>
> Gotta remind that generally "fw" is associated with firmware.
> "forcewake" might be appropriate word in function names too.
>

My reasoning originally was that these are static inside
intel_uncore.c thus the context is clear that these are not
about firmware.

Exposed ones have 'forcewake' in their name to avoid the
confusion.

-Mika

>> +{
>> +	unsigned int i;
>> +	struct intel_forcewake_range *entry =
>> +		(struct intel_forcewake_range *)ranges;
>> +
>> +	for (i = 0; i < num_ranges; i++, entry++) {
>> +		if (offset >= entry->start && offset <= entry->end)
>> +			return entry->domains;
>> +	}
>> +
>> +	return -1;
>> +}
>> 
>
> This could be a binary search, too, with some sorting.
>
> Already as is;
>
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
>
> Regards, Joonas
> -- 
> Joonas Lahtinen
> Open Source Technology Center
> Intel Corporation
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux