Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934268AbbDIJQc (ORCPT ); Thu, 9 Apr 2015 05:16:32 -0400 Received: from gate.crashing.org ([63.228.1.57]:48758 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933539AbbDII5L (ORCPT ); Thu, 9 Apr 2015 04:57:11 -0400 Message-ID: <1428569815.18187.71.camel@kernel.crashing.org> Subject: Re: [PATCH 3/3] PCI: Set pref for mem64 resource of pcie device From: Benjamin Herrenschmidt To: Yinghai Lu Cc: Bjorn Helgaas , David Miller , David Ahern , "linux-pci@vger.kernel.org" , "sparclinux@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Date: Thu, 09 Apr 2015 18:56:55 +1000 In-Reply-To: References: <1427857069-6789-1-git-send-email-yinghai@kernel.org> <1427857069-6789-4-git-send-email-yinghai@kernel.org> <20150406220638.GH10892@google.com> <20150406.203533.1356187749826485194.davem@davemloft.net> <20150408154759.GN10892@google.com> <1428527527.18187.28.camel@kernel.crashing.org> <1428549459.18187.56.camel@kernel.crashing.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1008 Lines: 31 On Wed, 2015-04-08 at 21:11 -0700, Yinghai Lu wrote: > That way should be more intrusive to current code, as we are using > type_mask checking to share the code among > parent(pref)/child(pref), parent(no-pref)/child(pref), and > parent(no-pref)/child(pref) That's fine, as long as the helper knows which one is the parent and which one is the child. In fact, as "cute" as the mask trick is, I think it would generally make the code more self explanatory if it explicitly tested for the combinations that are supported, ie something like if (parent_is_pref && !child_is_pref && child->pcie_only) ... else if (!parent_is_pref) ... etc... The impact in performance would be in the noise and the logic of the algorithm a LOT more explicit. Cheers, Ben. -- 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/