From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932641AbbCRBdm (ORCPT ); Tue, 17 Mar 2015 21:33:42 -0400 Received: from mail-oi0-f46.google.com ([209.85.218.46]:33260 "EHLO mail-oi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932387AbbCRBdc (ORCPT ); Tue, 17 Mar 2015 21:33:32 -0400 MIME-Version: 1.0 In-Reply-To: <1829371.gDPkhnsp25@vostro.rjw.lan> References: <4032246.STUT1iRmIk@vostro.rjw.lan> <1829371.gDPkhnsp25@vostro.rjw.lan> Date: Wed, 18 Mar 2015 02:33:31 +0100 Message-ID: Subject: Re: [PATCH 1/2] gpio / ACPI: Avoid unnecessary checks in __gpiod_get_index() From: Linus Walleij To: "Rafael J. Wysocki" Cc: Alexandre Courbot , "linux-gpio@vger.kernel.org" , Linux Kernel Mailing List , ACPI Devel Maling List , Mika Westerberg Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 10, 2015 at 11:08 PM, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > If dev is NULL in __gpiod_get_index() and both ACPI and OF are > enabled, it will be checked twice before the code decides to give > up with DT/ACPI lookup, so avoid that. > > Also use the observation that ACPI_COMPANION() is much more efficient > than ACPI_HANDLE(), because the latter uses the former and carries out > a check and a pointer dereference on top of it, so replace the > ACPI_HANDLE() check with an ACPI_COMPANION() one which does not > require the additional IS_ENABLED(CONFIG_ACPI) check too. > > Signed-off-by: Rafael J. Wysocki Patch applied with review and ACK tags. Yours, Linus Walleij