From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f170.google.com ([209.85.212.170]:41000 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753504AbbAET03 (ORCPT ); Mon, 5 Jan 2015 14:26:29 -0500 MIME-Version: 1.0 In-Reply-To: <20150105184821.GA703@rhlx01.hs-esslingen.de> References: <1420424374-32412-1-git-send-email-robh@kernel.org> <20150105184821.GA703@rhlx01.hs-esslingen.de> From: Rob Herring Date: Mon, 5 Jan 2015 13:26:07 -0600 Message-ID: Subject: Re: [PATCH] pci: introduce common pci config space accessors To: Andreas Mohr Cc: "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Bjorn Helgaas , Will Deacon , Arnd Bergmann Content-Type: text/plain; charset=UTF-8 Sender: linux-pci-owner@vger.kernel.org List-ID: On Mon, Jan 5, 2015 at 12:48 PM, Andreas Mohr wrote: > Hi, > >> + if (size == 1) >> + *val = readb(addr); >> + else if (size == 2) >> + *val = readw(addr); >> + else >> + *val = readl(addr); > (pci_generic_config_read() and pci_generic_config_write()) > > switch() > default: WARN_ON(1); > ? If you look at PCI_OP_READ/PCI_OP_WRITE defines, the caller can only have size of 1, 2 or 4. AFAIK, config accesses don't go thru any other caller. Rob