Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752896AbbETMDw (ORCPT ); Wed, 20 May 2015 08:03:52 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:61008 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751849AbbETMDt (ORCPT ); Wed, 20 May 2015 08:03:49 -0400 From: Arnd Bergmann To: linaro-acpi@lists.linaro.org Cc: Suravee Suthikulanit , Catalin Marinas , herbert@gondor.apana.org.au, netdev@vger.kernel.org, will.deacon@arm.com, linux-kernel@vger.kernel.org, Rob Herring , davem@davemloft.net, linux-acpi@vger.kernel.org, Murali Karicheri , "Rafael J. Wysocki" , lenb@kernel.org, bhelgaas@google.com, David Woodhouse , linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org Subject: Re: [Linaro-acpi] [V4 PATCH 3/6] pci: Generic function for setting up PCI device DMA coherency Date: Wed, 20 May 2015 14:02:40 +0200 Message-ID: <2673003.mTFjFBS7Ob@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <555C7759.3040304@amd.com> References: <1431724994-21601-1-git-send-email-Suravee.Suthikulpanit@amd.com> <20150520093401.GC25313@e104818-lin.cambridge.arm.com> <555C7759.3040304@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:9vhO8wss3wunv9RCtItljneABpokXMAN/nQqHMkwUxFzWv65Qq5 PkA1GXz5iztAHhO0PNp7UFgA0ICGrMocEOJo09hsW6MKi4PBbNRp+BaKkWrqQ9Hb9Ok+6Nl F8v3IeLyWjxT0rvezL1hdPzgVqwTmhgX8tj7t6MHhy3mFlIJ8oqjEoHG9PrBe3SuNXVnKCa /Y1B3H+PunePbKTfodXVA== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 747 Lines: 25 On Wednesday 20 May 2015 07:00:25 Suravee Suthikulanit wrote: > It seems that there are several places that have similar check. Would it > be good to convert this into a macro? Something like: > > #define OF_NODE_ENABLED(dev) (IS_ENABLED(CONFIG_OF) && dev->of_node) > > Thanks all for the review feedback. > Better make that an inline function that returns the node: struct device_node *dev_of_node(struct device *) { if (IS_ENABLED(CONFIG_OF)) return dev->of_node; return NULL; } Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/