From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755619Ab3BERVK (ORCPT ); Tue, 5 Feb 2013 12:21:10 -0500 Received: from mail-ie0-f175.google.com ([209.85.223.175]:35310 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751437Ab3BERVI (ORCPT ); Tue, 5 Feb 2013 12:21:08 -0500 MIME-Version: 1.0 In-Reply-To: <1359822572-26009-7-git-send-email-acourbot@nvidia.com> References: <1359822572-26009-1-git-send-email-acourbot@nvidia.com> <1359822572-26009-7-git-send-email-acourbot@nvidia.com> Date: Tue, 5 Feb 2013 18:21:06 +0100 Message-ID: Subject: Re: [PATCH 5/9] gpiolib: use gpio_chips list in gpiochip_find_base From: Linus Walleij To: Alexandre Courbot , Haojian Zhuang Cc: Grant Likely , Arnd Bergmann , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, gnurou@gmail.com Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 2, 2013 at 5:29 PM, Alexandre Courbot wrote: > Re-implement gpiochip_find_base using the list of chips instead of the > global gpio_desc[] array. This makes it both simpler and more efficient, > and is needed to remove the global descriptors array. > > Signed-off-by: Alexandre Courbot So Haojian just submitted a different patch to the same piece of code staring to search for GPIO number in ascending order instead, but I NACKed it. This looks like it is preserving this userspace-sensitive semantic so that dynamically added chips will still get the same assigned numbers. But I want some guarantees, so state clearly in the commit that any dynamically assigned chip will get the same base address after this change as it got before it, and please take this opportunity to add a comment stating that this search method is vital for userspace ABIs, and must be preserved. Yours, Linus Walleij