From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:40594 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753844Ab3JXLjn (ORCPT ); Thu, 24 Oct 2013 07:39:43 -0400 Date: Thu, 24 Oct 2013 13:41:33 +0200 From: Alexander Gordeev To: David Laight Cc: Tejun Heo , linux-kernel@vger.kernel.org, Bjorn Helgaas , Michael Ellerman , Benjamin Herrenschmidt , Ben Hutchings , Mark Lord , "H. Peter Anvin" , linux-pci@vger.kernel.org Subject: Re: [PATCH RFC v2 12/29] PCI/MSI: Introduce pcim_enable_msi*() family helpers Message-ID: <20131024114133.GA26610@dhcp-26-207.brq.redhat.com> References: <6bc575621ef70f72b206e4aa944acd32f1a75718.1382103786.git.agordeev@redhat.com> <20131024105158.GB13159@mtj.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: Sender: linux-pci-owner@vger.kernel.org List-ID: On Thu, Oct 24, 2013 at 11:57:40AM +0100, David Laight wrote: > The one case it doesn't work is where the driver either > wants the full number or the minimum number - but not > a value in between. > > Might be worth adding an extra parameter so that this > (and maybe other) odd requirements can be met. IMHO its not worth it, since it is not possible to generalize all odd requirements out there. I do not think we should blow the API in this case. Having said that, the min-or-max interface is probably the only worth considering. But again, I would prefer to put its semantics to function name rather than to extra parameters, i.e. pcim_enable_msix_min_max(struct pci_dev *dev, struct msix_entry *entries, unsigned int minvec, unsigned int maxvec); > Some static inline functions could be used for the common cases. > > David -- Regards, Alexander Gordeev agordeev@redhat.com