From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757357AbcFAH6A (ORCPT ); Wed, 1 Jun 2016 03:58:00 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:45791 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753621AbcFAH57 (ORCPT ); Wed, 1 Jun 2016 03:57:59 -0400 Date: Wed, 1 Jun 2016 00:57:57 -0700 From: Christoph Hellwig To: Johannes Thumshirn Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] PCI: Add helpers to request/release memory and I/O regions Message-ID: <20160601075757.GA11923@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 31, 2016 at 02:05:09PM +0200, Johannes Thumshirn wrote: > Add helpers to request and release a device's memory or I/O regions. > > With these helpers in place, one does not need to select a device's memory or > I/O regions with pci_select_bars() prior to requesting or releasing them. > > Suggested-by: Christoph Hellwig > Signed-off-by: Johannes Thumshirn > --- > include/linux/pci.h | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/include/linux/pci.h b/include/linux/pci.h > index 932ec74..846f4cf 100644 > --- a/include/linux/pci.h > +++ b/include/linux/pci.h > @@ -2007,6 +2007,35 @@ static inline bool pci_is_dev_assigned(struct pci_dev *pdev) > return (pdev->dev_flags & PCI_DEV_FLAGS_ASSIGNED) == PCI_DEV_FLAGS_ASSIGNED; > } > > +static inline int > +pci_request_io_regions(struct pci_dev *pdev, const char *name) > +{ > + return pci_request_selected_regions(pdev, > + pci_select_bars(pdev, IORESOURCE_IO), name); Needs a little indentation tweak to not spill over 80 characters. Two tabs should be plenty indentation for the continuation of function arguments. Ditto for the other functions, Otherwise looks fine: Reviewed-by: Christoph Hellwig