[PATCH v3] bus: uniphier-system-bus: add UniPhier System Bus driver

Masahiro Yamada yamada.masahiro at socionext.com
Tue Dec 8 19:56:43 PST 2015


Hi Arnd,

2015-12-09 1:59 GMT+09:00 Arnd Bergmann <arnd at arndb.de>:
>
> Just a little thought about one thing I found odd:
>
>> +static int uniphier_system_bus_check_overlap(
>> +                                     struct uniphier_system_bus_priv tmp)
>> +{
>
> Did you intentionally pass this by value?

Yes, I did not want to disturb the original one.

It is copied to a temporary storage, and sorted by the base address,
and discarded after the overlap checking.

But, you are right.   It is possible (and simpler)
to check the region overlap without sorting.


> Maybe do it explicitly using a pointer
> and memcpy to a local variable, which has a similar effect. Alternatively
> just check each newly probed child node for conflicts with any of the
> previous children. That is slightly more expensive at O(n^2) instead of O(n)
> but n is always small here and you can avoid sorting first.

Good idea.  I simplified this function in v4.



-- 
Best Regards
Masahiro Yamada



More information about the linux-arm-kernel mailing list