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.

> +{
> +     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.lahti...@linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to