From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Walleij Subject: Re: [PATCH V2 1/2] gpiolib: improve overlap check of range of gpio Date: Tue, 17 Nov 2015 15:14:57 +0100 Message-ID: References: <1447650167-29070-1-git-send-email-bamvor.zhangjian@linaro.org> <1447650167-29070-2-git-send-email-bamvor.zhangjian@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-oi0-f43.google.com ([209.85.218.43]:34934 "EHLO mail-oi0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752315AbbKQOO5 (ORCPT ); Tue, 17 Nov 2015 09:14:57 -0500 Received: by oige206 with SMTP id e206so5328000oig.2 for ; Tue, 17 Nov 2015 06:14:57 -0800 (PST) In-Reply-To: <1447650167-29070-2-git-send-email-bamvor.zhangjian@linaro.org> Sender: linux-gpio-owner@vger.kernel.org List-Id: linux-gpio@vger.kernel.org To: Bamvor Jian Zhang Cc: "linux-gpio@vger.kernel.org" , Mark Brown On Mon, Nov 16, 2015 at 6:02 AM, Bamvor Jian Zhang wrote: > There are limitations for the current checker: > 1. Could not check the overlap if the new gpiochip is the secondly > gpiochip. > 2. Could not check the overlap if the new gpiochip is overlap > with the left of gpiochip. E.g. if we insert [c, d] between > [a,b] and [e, f], and e >= c + d, it will successful even if > c < a + b. > 3. Allow overlap of base of different gpiochip. > > This patch fix these issues by checking the overlap of both right and > left gpiochip in the same loop statement. > > Signed-off-by: Bamvor Jian Zhang Patch applied with some tweaks. Had to rebase it because I renamed ->dev to ->parent in the GPIO tree, then I found it possible to get rid of the ret variable altogether. Yours, Linus Walleij