From patchwork Fri Jun 27 14:59:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 4435761 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D9B759F2C8 for ; Fri, 27 Jun 2014 14:59:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D110020320 for ; Fri, 27 Jun 2014 14:59:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E156B20263 for ; Fri, 27 Jun 2014 14:59:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753831AbaF0O7D (ORCPT ); Fri, 27 Jun 2014 10:59:03 -0400 Received: from mail-la0-f50.google.com ([209.85.215.50]:63468 "EHLO mail-la0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753649AbaF0O7D (ORCPT ); Fri, 27 Jun 2014 10:59:03 -0400 Received: by mail-la0-f50.google.com with SMTP id pv20so3031445lab.37 for ; Fri, 27 Jun 2014 07:59:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:organization:to:subject:date:user-agent:cc :mime-version:content-type:content-transfer-encoding:message-id; bh=K9dgbvDeBM2ltml4trhuI3g7N6Z61fb/wz5DsX0AgUc=; b=nIPMISpTebvG4XGd+lfoIO1sfixhvT+bQbVb32etFyGENQ3ooUvMORAsm+zqzycTlZ lns8ZjBj2zJuG6501v0+TZCa8+8uNKNr4eMM07IeLaqZYO5kHY07+lG+2VjzcEqS4+WZ BPlUz/B6lU/r1z6jZujKHx5S226xYNk3OV/lOpc0C4n2yOgc//nGapvCQL8nDgSiU9n9 OvutLdFomG4JOfXEGxaVcPxkG1amzpdSPdDjd73kjjsSGbNJFJIjArb6m0i2E6dUe9tx /mCeEXGDvF9mYm65wJUPdP33Ejh9udQF267VLxHYeWPOyDd79hf4utuWJDG7WYMff3cs PZ6w== X-Gm-Message-State: ALoCoQmgFuBQA6MFXxv3wiZNjCPR9w+UIAZBTVDybQphPWIyHNsjM34d4B+7iWfC5No4bN5MqZOV X-Received: by 10.153.4.42 with SMTP id cb10mr1679644lad.83.1403881140777; Fri, 27 Jun 2014 07:59:00 -0700 (PDT) Received: from wasted.cogentembedded.com (ppp83-237-253-65.pppoe.mtu-net.ru. [83.237.253.65]) by mx.google.com with ESMTPSA id s15sm11813501lbp.42.2014.06.27.07.58.59 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 27 Jun 2014 07:59:00 -0700 (PDT) From: Sergei Shtylyov Organization: Cogent Embedded To: horms@verge.net.au, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-sh@vger.kernel.org Subject: [PATCH] pcie-rcar: kill duplicate checks Date: Fri, 27 Jun 2014 18:59:13 +0400 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.i686.PAE; KDE/4.4.5; i686; ; ) Cc: phil.edworthy@renesas.com MIME-Version: 1.0 Message-Id: <201406271859.13626.sergei.shtylyov@cogentembedded.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The PCI core will have already checked the configuration register address before calling the {read|write}() methods, no need to check it again in these methods. Signed-off-by: Sergei Shtylyov Acked-by: Phil Edworthy Acked-by: Simon Horman --- The patch is against the 'next' branch of Bjorn Helgaas' 'pci.git' repo. drivers/pci/host/pcie-rcar.c | 10 ---------- 1 file changed, 10 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: pci/drivers/pci/host/pcie-rcar.c =================================================================== --- pci.orig/drivers/pci/host/pcie-rcar.c +++ pci/drivers/pci/host/pcie-rcar.c @@ -260,11 +260,6 @@ static int rcar_pcie_read_conf(struct pc struct rcar_pcie *pcie = sys_to_pcie(bus->sysdata); int ret; - if ((size == 2) && (where & 1)) - return PCIBIOS_BAD_REGISTER_NUMBER; - else if ((size == 4) && (where & 3)) - return PCIBIOS_BAD_REGISTER_NUMBER; - ret = rcar_pcie_config_access(pcie, PCI_ACCESS_READ, bus, devfn, where, val); if (ret != PCIBIOS_SUCCESSFUL) { @@ -291,11 +286,6 @@ static int rcar_pcie_write_conf(struct p int shift, ret; u32 data; - if ((size == 2) && (where & 1)) - return PCIBIOS_BAD_REGISTER_NUMBER; - else if ((size == 4) && (where & 3)) - return PCIBIOS_BAD_REGISTER_NUMBER; - ret = rcar_pcie_config_access(pcie, PCI_ACCESS_READ, bus, devfn, where, &data); if (ret != PCIBIOS_SUCCESSFUL)