[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK7LNARJdgxKaP_Pg90LA4GR8gHUYSppdXDqYz8fYDPHKu9_Wg@mail.gmail.com>
Date: Wed, 9 Dec 2015 12:56:43 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: arm@...nel.org, Mark Rutland <mark.rutland@....com>,
devicetree@...r.kernel.org, Kumar Gala <galak@...eaurora.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Ian Campbell <ijc+devicetree@...lion.org.uk>,
Rob Herring <robh+dt@...nel.org>,
Pawel Moll <pawel.moll@....com>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v3] bus: uniphier-system-bus: add UniPhier System Bus driver
Hi Arnd,
2015-12-09 1:59 GMT+09:00 Arnd Bergmann <arnd@...db.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists