From patchwork Thu Jul 14 10:47:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 9229551 X-Patchwork-Delegate: deller@gmx.de Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6041B60574 for ; Thu, 14 Jul 2016 10:47:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5125C27FB6 for ; Thu, 14 Jul 2016 10:47:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45E302808C; Thu, 14 Jul 2016 10:47:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DE9527FB6 for ; Thu, 14 Jul 2016 10:47:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751088AbcGNKrU (ORCPT ); Thu, 14 Jul 2016 06:47:20 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:32443 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750967AbcGNKrT (ORCPT ); Thu, 14 Jul 2016 06:47:19 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u6EAlCBx010070 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 14 Jul 2016 10:47:13 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u6EAlCQ0030426 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 14 Jul 2016 10:47:12 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u6EAl8HT030286; Thu, 14 Jul 2016 10:47:12 GMT Received: from mwanda (/154.0.139.178) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 14 Jul 2016 03:47:07 -0700 Date: Thu, 14 Jul 2016 13:47:01 +0300 From: Dan Carpenter To: "James E.J. Bottomley" Cc: Helge Deller , linux-parisc@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] parisc: delete some unused functions from firmware.c Message-ID: <20160714104700.GH18175@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.6.0 (2016-04-01) X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The pdc_pat_io_pci_cfg_read() is problematic because it's missing some break statements so it copies 4 bytes regardless of whether you asked for only 1 or 2. But since neither this nor the write function are used, it means we can just delete the code. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/parisc/include/asm/pdcpat.h b/arch/parisc/include/asm/pdcpat.h index 47539f1..c89d8c0 100644 --- a/arch/parisc/include/asm/pdcpat.h +++ b/arch/parisc/include/asm/pdcpat.h @@ -293,11 +293,6 @@ extern int pdc_pat_cpu_get_number(struct pdc_pat_cpu_num *cpu_info, void *hpa); extern int pdc_pat_pd_get_addr_map(unsigned long *actual_len, void *mem_addr, unsigned long count, unsigned long offset); - -extern int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *val); -extern int pdc_pat_io_pci_cfg_write(unsigned long pci_addr, int pci_size, u32 val); - - /* Flag to indicate this is a PAT box...don't use this unless you ** really have to...it might go away some day. */ diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c index 2239590..12545a2 100644 --- a/arch/parisc/kernel/firmware.c +++ b/arch/parisc/kernel/firmware.c @@ -1338,51 +1338,6 @@ int pdc_pat_pd_get_addr_map(unsigned long *actual_len, void *mem_addr, return retval; } -/** - * pdc_pat_io_pci_cfg_read - Read PCI configuration space. - * @pci_addr: PCI configuration space address for which the read request is being made. - * @pci_size: Size of read in bytes. Valid values are 1, 2, and 4. - * @mem_addr: Pointer to return memory buffer. - * - */ -int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *mem_addr) -{ - int retval; - unsigned long flags; - - spin_lock_irqsave(&pdc_lock, flags); - retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_PCI_CONFIG_READ, - __pa(pdc_result), pci_addr, pci_size); - switch(pci_size) { - case 1: *(u8 *) mem_addr = (u8) pdc_result[0]; - case 2: *(u16 *)mem_addr = (u16) pdc_result[0]; - case 4: *(u32 *)mem_addr = (u32) pdc_result[0]; - } - spin_unlock_irqrestore(&pdc_lock, flags); - - return retval; -} - -/** - * pdc_pat_io_pci_cfg_write - Retrieve information about memory address ranges. - * @pci_addr: PCI configuration space address for which the write request is being made. - * @pci_size: Size of write in bytes. Valid values are 1, 2, and 4. - * @value: Pointer to 1, 2, or 4 byte value in low order end of argument to be - * written to PCI Config space. - * - */ -int pdc_pat_io_pci_cfg_write(unsigned long pci_addr, int pci_size, u32 val) -{ - int retval; - unsigned long flags; - - spin_lock_irqsave(&pdc_lock, flags); - retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_PCI_CONFIG_WRITE, - pci_addr, pci_size, val); - spin_unlock_irqrestore(&pdc_lock, flags); - - return retval; -} #endif /* CONFIG_64BIT */