From patchwork Mon Jul 13 12:22:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327960 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=DOSHDGVm; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54810Cfyz9sRW for ; Mon, 13 Jul 2020 23:22:41 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729722AbgGMNWj (ORCPT ); Mon, 13 Jul 2020 09:22:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729873AbgGMNWj (ORCPT ); Mon, 13 Jul 2020 09:22:39 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C43B5C061755; Mon, 13 Jul 2020 06:22:38 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id p20so17105650ejd.13; Mon, 13 Jul 2020 06:22:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=z4DbCQASJpB18XYS7ktJTNc93Wbe31Dke4XqE2e1oq0=; b=DOSHDGVmk30fZFiz3WKd7zMCSK69f3jEL1u8AsUJjxB2mBuvUr1qBHCx969bF8n9Q2 KtbdMAJyAt3EFUnpKPSIMJbXHWkN6pnl/9Tnrb3Gl0n+kYXCTO2h5BNyruT2BHFjgl+g wH9iQCx1EI7m7ZrVqhRyZdNkYPv0uZXHNRXI4H3ZgM4nssEF6Z4+vhCyAINKoOna9COA 2vQ/UXMl3YhqVXxT1k4grDXlx/GMqUZZFWedx8icvuVMGE/cnpL+73qZzJoFpLnQEXqM kKNEdCxwfmXyA7RuYT4PGHN4OQXUHW+RCFO60LXxoSfPzZmiOAwLoId6GJoDAnwMnMXf 6VkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z4DbCQASJpB18XYS7ktJTNc93Wbe31Dke4XqE2e1oq0=; b=VGODV6+w8pm3BED+mlkJTkLoiPiT2PQOix909FzobWVuQPJ/ckL+JClUhHHZrN/4Ng JKXWFn8iUjL812r/K8SreK1/U8CtRqXLEpQpT9ZEg5CVKuHg4wVRpfoxaxe7ArX/rqtd NbAD+iJr8dxnIgRDHrCieUZ0/Xjqabn4AU1NIqdP2bRFwSJeqDiO+9b16kth8JTImsiz sxIe9cqF92le73rQT0XeUO72vXpnG2UGw/OiSGJB/yY5gsJSRo7YXox+2JYuYhjlS8tu gc9lmSVwCd7kx22nfYBU2MRaA7q+EtNc1ORf5NJS5GxD0ERF1jclBxRgKXHAbypC5VbU e17w== X-Gm-Message-State: AOAM530vhEVApyA+HZEwVHGAue2wJSX3nrd/BFWsX7WoIEx2nZWQHA67 ITTBn0MuGPSTVEkaNbhCt3U= X-Google-Smtp-Source: ABdhPJyNJ+2A+7vhlimkJ5sh3qnTf4AmYHcIfFpOxzTngMqwIMgJRuRgZYpxdl6ypR4zISe0e31EHw== X-Received: by 2002:a17:906:4dd4:: with SMTP id f20mr77154689ejw.170.1594646557469; Mon, 13 Jul 2020 06:22:37 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:22:37 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Boris Ostrovsky , Juergen Gross , Stefano Stabellini Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [RFC PATCH 01/35] xen-pciback: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:13 +0200 Message-Id: <20200713122247.10985-2-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- drivers/xen/xen-pciback/conf_space.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/xen-pciback/conf_space.c b/drivers/xen/xen-pciback/conf_space.c index 059de92aea7d..0e7577f16f78 100644 --- a/drivers/xen/xen-pciback/conf_space.c +++ b/drivers/xen/xen-pciback/conf_space.c @@ -130,7 +130,7 @@ static inline u32 merge_value(u32 val, u32 new_val, u32 new_val_mask, static int xen_pcibios_err_to_errno(int err) { switch (err) { - case PCIBIOS_SUCCESSFUL: + case 0: return XEN_PCI_ERR_success; case PCIBIOS_DEVICE_NOT_FOUND: return XEN_PCI_ERR_dev_not_found; From patchwork Mon Jul 13 12:22:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1328003 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=aynnQr9y; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54CQ6zyZz9sR4 for ; Mon, 13 Jul 2020 23:25:38 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729869AbgGMNWm (ORCPT ); Mon, 13 Jul 2020 09:22:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729873AbgGMNWk (ORCPT ); Mon, 13 Jul 2020 09:22:40 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7206C061755; Mon, 13 Jul 2020 06:22:39 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id b15so13646400edy.7; Mon, 13 Jul 2020 06:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wIKAQlJ5EJGoiOmdek0QEY4ROpHfaSKBPeLwiXvsVhs=; b=aynnQr9yYe4ZZ1ZrHtzXBl8SSf7HblZmsshVDBYFj9NrSxrnGirktKY/HZ6DlVUMRo zNvyjcCe47FefuyS03sMQ0xLJU58XwtxM5ihWJNrNC2+oGFM0+m4u9grTzP5heNWjczx 46yKHiCd0qOYmibGFbP82US3V33mP0Qz0BbBs7sHjirydyTG/dP5i0Hb0YjsXuMO4BrB FQjDcLEEkoFdmrx7ZqmJHkTM8sy+pfx+sQgIDDFcPfSILhRS0uByhwHVIsHH5nCCoqc+ N7S6TcWUMbpn/D7sJPLW9GfWUJxg0hVocp07mU4YHB2kVH1+fvOOX+9UChqHzqBvN4sx oxcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wIKAQlJ5EJGoiOmdek0QEY4ROpHfaSKBPeLwiXvsVhs=; b=TMO7W0v4izcH8IU1teIvmLINxxWIHJMa/uS4KmSKTyCt5tIDMFJKNm9itwixb5PZjM 4hCTXbnRS7XqZl6esxnkr/yEfrEFU5fham745vJ4ln5jMOwE8d3lZDHKMFZboN2RaASE ck6xZF9bPCVJ7Dqau7XE/3DU4OaZdE61FpXfqc1ZJMUpvIDa2R9tbIgbiHhAyeKSoq6i 1XWl/MxmKMNJeqX9m0MjyGKSheyECrwYxITWCwJdFHHpPmAQGwuDE06VXv8ivpOuTSEU GKR3futvxf6y0n8HIlo7pWJEFCo6zPfjoecOH7vRVfHgndmzAjFL85IM4+j43/AnPNRm rx5Q== X-Gm-Message-State: AOAM531tMMnmPL7YrxpQWsDxg3kuh+7DW+sJ5+BF0818wvdB0HzWsZkX V9sveeXEek6WEDc8ahBPzludaHebV2RsBA== X-Google-Smtp-Source: ABdhPJwUad8FS77l0N6XR9hbRFDjoFcDuPDZlPtaI+ROx0M/Xa+ASTlCW28qVdgQnqcUOGj6m510DA== X-Received: by 2002:a05:6402:1ca6:: with SMTP id cz6mr70528395edb.171.1594646558717; Mon, 13 Jul 2020 06:22:38 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:22:38 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Michael Buesch Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org Subject: [RFC PATCH 02/35] ssb: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:14 +0200 Message-Id: <20200713122247.10985-3-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" Acked-by: Larry Finger --- drivers/ssb/driver_gige.c | 4 ++-- drivers/ssb/driver_pcicore.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ssb/driver_gige.c b/drivers/ssb/driver_gige.c index ebee6b0e3c34..ccb4a35715bf 100644 --- a/drivers/ssb/driver_gige.c +++ b/drivers/ssb/driver_gige.c @@ -134,7 +134,7 @@ static int ssb_gige_pci_read_config(struct pci_bus *bus, unsigned int devfn, } spin_unlock_irqrestore(&dev->lock, flags); - return PCIBIOS_SUCCESSFUL; + return 0; } static int ssb_gige_pci_write_config(struct pci_bus *bus, unsigned int devfn, @@ -164,7 +164,7 @@ static int ssb_gige_pci_write_config(struct pci_bus *bus, unsigned int devfn, } spin_unlock_irqrestore(&dev->lock, flags); - return PCIBIOS_SUCCESSFUL; + return 0; } static int ssb_gige_probe(struct ssb_device *sdev, diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c index c1186415896b..1b67af1097c8 100644 --- a/drivers/ssb/driver_pcicore.c +++ b/drivers/ssb/driver_pcicore.c @@ -212,7 +212,7 @@ static int ssb_pcicore_read_config(struct pci_bus *bus, unsigned int devfn, PCI_FUNC(devfn), reg, val, size); spin_unlock_irqrestore(&cfgspace_lock, flags); - return err ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; + return err ? PCIBIOS_DEVICE_NOT_FOUND : 0; } static int ssb_pcicore_write_config(struct pci_bus *bus, unsigned int devfn, @@ -226,7 +226,7 @@ static int ssb_pcicore_write_config(struct pci_bus *bus, unsigned int devfn, PCI_FUNC(devfn), reg, &val, size); spin_unlock_irqrestore(&cfgspace_lock, flags); - return err ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; + return err ? PCIBIOS_DEVICE_NOT_FOUND : 0; } static struct pci_ops ssb_pcicore_pciops = { From patchwork Mon Jul 13 12:22:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1328004 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=QFjmoNKL; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54CS101Sz9sTq for ; Mon, 13 Jul 2020 23:25:40 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729897AbgGMNZi (ORCPT ); Mon, 13 Jul 2020 09:25:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729833AbgGMNWl (ORCPT ); Mon, 13 Jul 2020 09:22:41 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BA28C061755; Mon, 13 Jul 2020 06:22:41 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id l12so17127960ejn.10; Mon, 13 Jul 2020 06:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kVHWYWvPcZhbbCSVf176+HxbB/imYoYR0qAJmfiByxM=; b=QFjmoNKLVNjf3U2P646R/7d2KQk03W7jh/TBjE8hGf6d/jlTCNbiJYpksALoO1lpbB c6jGZAv25Va9Vv/meTYwQnEFX+I6e4TriXoajmfjzFcQSGKGoE+apHWx+tgRorVGcYQF SFFr7QltezJy570u5Rz+xX65t01O5FRzMr+Q7ApZgfWoQcSBlD5Poi0oizwBwLff2/M9 4CSVY6TAhIj17xfVDFNCpNgApblJEBWUYePn62g9j5cmua23mA+L0W3MhA0LBFHCbnfm WpHPPKG6P6zKvD/p4Uftc8vQwXREU0foxzYAoSBJlS60kzuARgryaULGAdN3pGaa4pRD FjDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kVHWYWvPcZhbbCSVf176+HxbB/imYoYR0qAJmfiByxM=; b=lkjKRqzL1psaYgkfP8tmvYDpIvNcWplpv0iEp37Y9L3gHVJPf/r1A/CltEdwi75O83 h/ZZ6+4ZgHAH51o8ku41hzTrFMHRszZYSGkckP0VYSkJjRExgNVjnKzF5SsJqyzMUHuL 0huUo35erfDYxWZIh6DYZa8arhyQ8et3lEPIcpKK1VdnG/1liX7/IEZL0h/4Gob7tGAq zfA9ZHhvNuFtqEcyCBlhJ7uG87CDkPYy9c9E78k1v7dhUWqIYdUqR0ldN/iDX7gvUboP qMFmUqwla31Fb9mvb7u2P9SwYgcFLwDoxotCG/lmJAVDt5dR+52ggWhMBdEwmcIBulfa hKAQ== X-Gm-Message-State: AOAM530nB7AU4hCCRUfr/fkj1hyYC0IbYxu3dWxYJAn3I2gKIwCjQlI/ 5pms1rZmYDiZlXq8CmXBbr4= X-Google-Smtp-Source: ABdhPJzejmxGBjJ0fiS9zehGy/8XQ4P0gWhbmgIO8mnaoPpL56MEc2+mI7hVAr8MrmwimXgYioGUVA== X-Received: by 2002:a17:906:7f90:: with SMTP id f16mr72707884ejr.507.1594646560025; Mon, 13 Jul 2020 06:22:40 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:22:39 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Brian King , "James E.J. Bottomley" , "Martin K. Petersen" Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [RFC PATCH 03/35] scsi: ipr: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:15 +0200 Message-Id: <20200713122247.10985-4-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- drivers/scsi/ipr.c | 16 ++++++++-------- drivers/scsi/pmcraid.c | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 7d86f4ca266c..b6c52a04cf52 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -775,7 +775,7 @@ static int ipr_save_pcix_cmd_reg(struct ipr_ioa_cfg *ioa_cfg) return 0; if (pci_read_config_word(ioa_cfg->pdev, pcix_cmd_reg + PCI_X_CMD, - &ioa_cfg->saved_pcix_cmd_reg) != PCIBIOS_SUCCESSFUL) { + &ioa_cfg->saved_pcix_cmd_reg) != 0) { dev_err(&ioa_cfg->pdev->dev, "Failed to save PCI-X command register\n"); return -EIO; } @@ -797,7 +797,7 @@ static int ipr_set_pcix_cmd_reg(struct ipr_ioa_cfg *ioa_cfg) if (pcix_cmd_reg) { if (pci_write_config_word(ioa_cfg->pdev, pcix_cmd_reg + PCI_X_CMD, - ioa_cfg->saved_pcix_cmd_reg) != PCIBIOS_SUCCESSFUL) { + ioa_cfg->saved_pcix_cmd_reg) != 0) { dev_err(&ioa_cfg->pdev->dev, "Failed to setup PCI-X command register\n"); return -EIO; } @@ -8739,7 +8739,7 @@ static int ipr_reset_bist_done(struct ipr_cmnd *ipr_cmd) static int ipr_reset_start_bist(struct ipr_cmnd *ipr_cmd) { struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; - int rc = PCIBIOS_SUCCESSFUL; + int rc = 0; ENTER; if (ioa_cfg->ipr_chip->bist_method == IPR_MMIO) @@ -8748,7 +8748,7 @@ static int ipr_reset_start_bist(struct ipr_cmnd *ipr_cmd) else rc = pci_write_config_byte(ioa_cfg->pdev, PCI_BIST, PCI_BIST_START); - if (rc == PCIBIOS_SUCCESSFUL) { + if (rc == 0) { ipr_cmd->job_step = ipr_reset_bist_done; ipr_reset_start_timer(ipr_cmd, IPR_WAIT_FOR_BIST_TIMEOUT); rc = IPR_RC_JOB_RETURN; @@ -8946,7 +8946,7 @@ static int ipr_reset_alert(struct ipr_cmnd *ipr_cmd) ENTER; rc = pci_read_config_word(ioa_cfg->pdev, PCI_COMMAND, &cmd_reg); - if ((rc == PCIBIOS_SUCCESSFUL) && (cmd_reg & PCI_COMMAND_MEMORY)) { + if ((rc == 0) && (cmd_reg & PCI_COMMAND_MEMORY)) { ipr_mask_and_clear_interrupts(ioa_cfg, ~0); writel(IPR_UPROCI_RESET_ALERT, ioa_cfg->regs.set_uproc_interrupt_reg32); ipr_cmd->job_step = ipr_reset_wait_to_start_bist; @@ -10154,7 +10154,7 @@ static int ipr_probe_ioa(struct pci_dev *pdev, struct Scsi_Host *host; unsigned long ipr_regs_pci; void __iomem *ipr_regs; - int rc = PCIBIOS_SUCCESSFUL; + int rc = 0; volatile u32 mask, uproc, interrupts; unsigned long lock_flags, driver_lock_flags; unsigned int irq_flag; @@ -10256,7 +10256,7 @@ static int ipr_probe_ioa(struct pci_dev *pdev, rc = pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, ioa_cfg->chip_cfg->cache_line_size); - if (rc != PCIBIOS_SUCCESSFUL) { + if (rc != 0) { dev_err(&pdev->dev, "Write of cache line size failed\n"); ipr_wait_for_pci_err_recovery(ioa_cfg); rc = -EIO; @@ -10337,7 +10337,7 @@ static int ipr_probe_ioa(struct pci_dev *pdev, /* Save away PCI config space for use following IOA reset */ rc = pci_save_state(pdev); - if (rc != PCIBIOS_SUCCESSFUL) { + if (rc != 0) { dev_err(&pdev->dev, "Failed to save PCI config space\n"); rc = -EIO; goto cleanup_nolog; diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index aa9ae2ae8579..5f6e440f0dcd 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -553,7 +553,7 @@ static void pmcraid_bist_done(struct timer_list *t) rc = pci_read_config_word(pinstance->pdev, PCI_COMMAND, &pci_reg); /* If PCI config space can't be accessed wait for another two secs */ - if ((rc != PCIBIOS_SUCCESSFUL || (!(pci_reg & PCI_COMMAND_MEMORY))) && + if ((rc != 0 || (!(pci_reg & PCI_COMMAND_MEMORY))) && cmd->time_left > 0) { pmcraid_info("BIST not complete, waiting another 2 secs\n"); cmd->timer.expires = jiffies + cmd->time_left; @@ -649,7 +649,7 @@ static void pmcraid_reset_alert(struct pmcraid_cmd *cmd) * BIST or slot_reset */ rc = pci_read_config_word(pinstance->pdev, PCI_COMMAND, &pci_reg); - if ((rc == PCIBIOS_SUCCESSFUL) && (pci_reg & PCI_COMMAND_MEMORY)) { + if ((rc == 0) && (pci_reg & PCI_COMMAND_MEMORY)) { /* wait for IOA permission i.e until CRITICAL_OPERATION bit is * reset IOA doesn't generate any interrupts when CRITICAL @@ -5651,7 +5651,7 @@ static int pmcraid_probe(struct pci_dev *pdev, struct pmcraid_instance *pinstance; struct Scsi_Host *host; void __iomem *mapped_pci_addr; - int rc = PCIBIOS_SUCCESSFUL; + int rc = 0; if (atomic_read(&pmcraid_adapter_count) >= PMCRAID_MAX_ADAPTERS) { pmcraid_err From patchwork Mon Jul 13 12:22:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1328002 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=sio14PR2; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54CP4X0Vz9sTk for ; Mon, 13 Jul 2020 23:25:37 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729889AbgGMNWq (ORCPT ); Mon, 13 Jul 2020 09:22:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729881AbgGMNWm (ORCPT ); Mon, 13 Jul 2020 09:22:42 -0400 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85DA9C061755; Mon, 13 Jul 2020 06:22:42 -0700 (PDT) Received: by mail-ed1-x544.google.com with SMTP id a8so13694902edy.1; Mon, 13 Jul 2020 06:22:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cLqez7BSyfcefFRd7dwUFrtJ0GHfAxGAdp04dPgWsLE=; b=sio14PR2ZhNVYW5pRGQc2jglAo7nTdWWKSefc4gMs+wgVmGhec2a2fyBTfLZ6J14Qp coLl1eOLB8d5tKO9spI1RYxQiMgfsiKvvYaimdqIph4H23i9wUbc9MG280qJENvlajSw /VN2T/7nNcVFpitKVUM+s06FscbXZj7WUQDOgljFVatIS/RQoOWA14lTYbW+495xaTJy TaLylSHSuZwnAHDVc8I1k3YTYCGjgxetjP360T/El0/SU1JdisRR1pj7aP6wJUpLOce6 00lgSzAedeQA2Yqg4ZoShFqwzsBOfMVh/JcesPq/SiBokPUANb05LCj7qdrsjvlUOqbi FybA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cLqez7BSyfcefFRd7dwUFrtJ0GHfAxGAdp04dPgWsLE=; b=P6qEHBzZMZ88yAJjieoWRwL004ydfYd9SUREaE0hv7ZNArOSWYsSMd4B8dHhUFU39I 8j21Gob9JCIU+HuG/be1WY9q0oSBtzd+CNACHuQgI6crATgnhZ1s4Zsy3vExoCJnHfxT FXuBnGvaaIR0lZDJ46QZz5Jp1210Pd0Q3NZeWch2mq/aVfa72E0trEGjGSJ5a/Xx+q1C 2v9lKW4F5UEABTdnMQiwerBupsJPxFwm7PuLee82+3L1X0tqPEIoYYH+45vc3H5AXPkP B2769iYERimurF+73vQZJwN7Rg/rX22eUrX3fzRtvPkKaHgd5uTReRbIAbNzhSrMAY9w 5dKA== X-Gm-Message-State: AOAM531B/tvdErf8zerNxlCRtEd9YAYMGPXnquWb/9B6bQ4sN9nHkbDg 4Zccmkk2XXBPyup//hLITU5qXwk1NIU0dg== X-Google-Smtp-Source: ABdhPJw851ydCCL6n3xPVW+bl+icaHvx7ShHFlSz4LStRGij1QNNCQ6hE4bN7pmrcD8LYtZRUcTX8g== X-Received: by 2002:a05:6402:359:: with SMTP id r25mr66126290edw.177.1594646561310; Mon, 13 Jul 2020 06:22:41 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:22:40 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Brian King , "James E.J. Bottomley" , "Martin K. Petersen" Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [RFC PATCH 04/35] scsi: ipr: Tidy Success/Failure checks Date: Mon, 13 Jul 2020 14:22:16 +0200 Message-Id: <20200713122247.10985-5-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unnecessary check for 0. Signed-off-by: "Saheed O. Bolarinwa" --- This patch depends on PATCH 03/35 drivers/scsi/ipr.c | 12 ++++++------ drivers/scsi/pmcraid.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index b6c52a04cf52..e714f82769bc 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -775,7 +775,7 @@ static int ipr_save_pcix_cmd_reg(struct ipr_ioa_cfg *ioa_cfg) return 0; if (pci_read_config_word(ioa_cfg->pdev, pcix_cmd_reg + PCI_X_CMD, - &ioa_cfg->saved_pcix_cmd_reg) != 0) { + &ioa_cfg->saved_pcix_cmd_reg)) { dev_err(&ioa_cfg->pdev->dev, "Failed to save PCI-X command register\n"); return -EIO; } @@ -797,7 +797,7 @@ static int ipr_set_pcix_cmd_reg(struct ipr_ioa_cfg *ioa_cfg) if (pcix_cmd_reg) { if (pci_write_config_word(ioa_cfg->pdev, pcix_cmd_reg + PCI_X_CMD, - ioa_cfg->saved_pcix_cmd_reg) != 0) { + ioa_cfg->saved_pcix_cmd_reg)) { dev_err(&ioa_cfg->pdev->dev, "Failed to setup PCI-X command register\n"); return -EIO; } @@ -8748,7 +8748,7 @@ static int ipr_reset_start_bist(struct ipr_cmnd *ipr_cmd) else rc = pci_write_config_byte(ioa_cfg->pdev, PCI_BIST, PCI_BIST_START); - if (rc == 0) { + if (!rc) { ipr_cmd->job_step = ipr_reset_bist_done; ipr_reset_start_timer(ipr_cmd, IPR_WAIT_FOR_BIST_TIMEOUT); rc = IPR_RC_JOB_RETURN; @@ -8946,7 +8946,7 @@ static int ipr_reset_alert(struct ipr_cmnd *ipr_cmd) ENTER; rc = pci_read_config_word(ioa_cfg->pdev, PCI_COMMAND, &cmd_reg); - if ((rc == 0) && (cmd_reg & PCI_COMMAND_MEMORY)) { + if ((!rc) && (cmd_reg & PCI_COMMAND_MEMORY)) { ipr_mask_and_clear_interrupts(ioa_cfg, ~0); writel(IPR_UPROCI_RESET_ALERT, ioa_cfg->regs.set_uproc_interrupt_reg32); ipr_cmd->job_step = ipr_reset_wait_to_start_bist; @@ -10256,7 +10256,7 @@ static int ipr_probe_ioa(struct pci_dev *pdev, rc = pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, ioa_cfg->chip_cfg->cache_line_size); - if (rc != 0) { + if (rc) { dev_err(&pdev->dev, "Write of cache line size failed\n"); ipr_wait_for_pci_err_recovery(ioa_cfg); rc = -EIO; @@ -10337,7 +10337,7 @@ static int ipr_probe_ioa(struct pci_dev *pdev, /* Save away PCI config space for use following IOA reset */ rc = pci_save_state(pdev); - if (rc != 0) { + if (rc) { dev_err(&pdev->dev, "Failed to save PCI config space\n"); rc = -EIO; goto cleanup_nolog; diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index 5f6e440f0dcd..151aa61b674b 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -553,7 +553,7 @@ static void pmcraid_bist_done(struct timer_list *t) rc = pci_read_config_word(pinstance->pdev, PCI_COMMAND, &pci_reg); /* If PCI config space can't be accessed wait for another two secs */ - if ((rc != 0 || (!(pci_reg & PCI_COMMAND_MEMORY))) && + if ((rc || (!(pci_reg & PCI_COMMAND_MEMORY))) && cmd->time_left > 0) { pmcraid_info("BIST not complete, waiting another 2 secs\n"); cmd->timer.expires = jiffies + cmd->time_left; @@ -649,7 +649,7 @@ static void pmcraid_reset_alert(struct pmcraid_cmd *cmd) * BIST or slot_reset */ rc = pci_read_config_word(pinstance->pdev, PCI_COMMAND, &pci_reg); - if ((rc == 0) && (pci_reg & PCI_COMMAND_MEMORY)) { + if ((!rc) && (pci_reg & PCI_COMMAND_MEMORY)) { /* wait for IOA permission i.e until CRITICAL_OPERATION bit is * reset IOA doesn't generate any interrupts when CRITICAL From patchwork Mon Jul 13 12:22:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327999 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=GeKR1wwQ; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54CJ2q8rz9sR4 for ; Mon, 13 Jul 2020 23:25:32 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729893AbgGMNWq (ORCPT ); Mon, 13 Jul 2020 09:22:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729873AbgGMNWp (ORCPT ); Mon, 13 Jul 2020 09:22:45 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D40D5C061755; Mon, 13 Jul 2020 06:22:44 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id w6so17134671ejq.6; Mon, 13 Jul 2020 06:22:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=U+4fgAl092jtpf8p0sVznNDqJH6s4jt37g7dyTJMbT4=; b=GeKR1wwQG/K1n4qF9XFSlFSzkaVyPMkd8BinPHhutRMJlF6usPHfpDeFKpKWpdFEHC 0h95NiN2S2AmTQBzH80M78PHSIahI/tcCflBsQZpyaYkOuVh2yVYZ+UixlUJuMt+hPO6 na8XFN6usT0qNDW1S5C+z2EdEshbJVZKxMUpAMKkl0GucN4BQFdfgRt9KavWcs5Bug+j 9lc+xWBOwCBLZjjodCWx/Zx9F0a0UYWYivLHs1F2MMcYS/BALXoLjEZZHNdFO8AEOfOk x5jdjVAZYgPCY6D+ou6VAowrzYM4w1KwTh5T10OeLJdUZ6Zvcsen6kZWsgTyGnK5Gxi6 e/hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=U+4fgAl092jtpf8p0sVznNDqJH6s4jt37g7dyTJMbT4=; b=djfq2/0U+OysOuaURNQtkVB9YKp2i/6FVAcn1+gniVEiSORcZ2K8S+BLr9vCBJSiTA OQtHfAwmjr8ZJPI8BtjHbpZRdJpC3eGv9U+H1ogua/7U9LnSzf5xLBrawd6JpvNre633 TuTg59zN541mMvPLY7atAFSulHl5JYNFEukLjjam+H01c3fjijuIIw86GlnSU3tVXHZ0 6XmDNNvZCvq8mMky+meWEetJRPxEaFNGD11Ta5KZ1YWCkjmVu5Fx71HeFs7KER95h9Xu tU48IBWMdvbqJL5Yd1Z/EhInIXfBBQPLPay3sgiFQ1qgSUFpxVHt+fdZZmbeSX5jxfsd AkpQ== X-Gm-Message-State: AOAM531tteCnu6q/4p+Dq40ANN5Yx/ldZ7soxrbmAQuGslWSMuUN56ug 94sTGvKJWHbkw3+9ICyJj6czNTJSxJRWdA== X-Google-Smtp-Source: ABdhPJztyeurCQmHlxNniEhwD0qLqlX0SG+kgarnE5HX7VAl7vYbh07uZ079fvI7dqpSfYl6niKNmg== X-Received: by 2002:a17:906:9387:: with SMTP id l7mr70960800ejx.274.1594646563415; Mon, 13 Jul 2020 06:22:43 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:22:42 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Yue Wang , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Kevin Hilman , Philipp Zabel , Jingoo Han , Gustavo Pimentel , Toan Le , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Ley Foon Tan , Marek Vasut , Yoshihiro Shimoda Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, rfi@lists.rocketboards.org, linux-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 05/35] PCI: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:17 +0200 Message-Id: <20200713122247.10985-6-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- drivers/pci/controller/dwc/pci-meson.c | 4 +-- .../pci/controller/dwc/pcie-designware-host.c | 2 +- drivers/pci/controller/dwc/pcie-designware.c | 4 +-- drivers/pci/controller/dwc/pcie-hisi.c | 4 +-- drivers/pci/controller/dwc/pcie-tegra194.c | 4 +-- .../pci/controller/mobiveil/pcie-mobiveil.c | 4 +-- drivers/pci/controller/pci-aardvark.c | 4 +-- drivers/pci/controller/pci-ftpci100.c | 4 +-- drivers/pci/controller/pci-hyperv.c | 8 ++--- drivers/pci/controller/pci-mvebu.c | 4 +-- drivers/pci/controller/pci-thunder-ecam.c | 36 +++++++++---------- drivers/pci/controller/pci-thunder-pem.c | 4 +-- drivers/pci/controller/pci-xgene.c | 4 +-- drivers/pci/controller/pcie-altera.c | 16 ++++----- drivers/pci/controller/pcie-iproc.c | 10 +++--- drivers/pci/controller/pcie-mediatek.c | 4 +-- drivers/pci/controller/pcie-rcar-host.c | 8 ++--- drivers/pci/controller/pcie-rockchip-host.c | 10 +++--- 18 files changed, 67 insertions(+), 67 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c index ca59ba9e0ecd..58142f03d300 100644 --- a/drivers/pci/controller/dwc/pci-meson.c +++ b/drivers/pci/controller/dwc/pci-meson.c @@ -390,7 +390,7 @@ static int meson_pcie_rd_own_conf(struct pcie_port *pp, int where, int size, int ret; ret = dw_pcie_read(pci->dbi_base + where, size, val); - if (ret != PCIBIOS_SUCCESSFUL) + if (ret != 0) return ret; /* @@ -407,7 +407,7 @@ static int meson_pcie_rd_own_conf(struct pcie_port *pp, int where, int size, else if (where == PCI_CLASS_DEVICE + 1 && size == 1) *val = (PCI_CLASS_BRIDGE_PCI >> 8) & 0xff; - return PCIBIOS_SUCCESSFUL; + return 0; } static int meson_pcie_wr_own_conf(struct pcie_port *pp, int where, diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index 0a4a5aa6fe46..7c97c54f787c 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -459,7 +459,7 @@ int dw_pcie_host_init(struct pcie_port *pp) } ret = dw_pcie_rd_own_conf(pp, PCI_HEADER_TYPE, 1, &hdr_type); - if (ret != PCIBIOS_SUCCESSFUL) { + if (ret != 0) { dev_err(pci->dev, "Failed reading PCI_HEADER_TYPE cfg space reg (ret: 0x%x)\n", ret); ret = pcibios_err_to_errno(ret); diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index c92496e36fd5..2494e1be1f96 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -113,7 +113,7 @@ int dw_pcie_read(void __iomem *addr, int size, u32 *val) return PCIBIOS_BAD_REGISTER_NUMBER; } - return PCIBIOS_SUCCESSFUL; + return 0; } EXPORT_SYMBOL_GPL(dw_pcie_read); @@ -131,7 +131,7 @@ int dw_pcie_write(void __iomem *addr, int size, u32 val) else return PCIBIOS_BAD_REGISTER_NUMBER; - return PCIBIOS_SUCCESSFUL; + return 0; } EXPORT_SYMBOL_GPL(dw_pcie_write); diff --git a/drivers/pci/controller/dwc/pcie-hisi.c b/drivers/pci/controller/dwc/pcie-hisi.c index 0ad4e07dd4c2..10a46aded227 100644 --- a/drivers/pci/controller/dwc/pcie-hisi.c +++ b/drivers/pci/controller/dwc/pcie-hisi.c @@ -163,7 +163,7 @@ static int hisi_pcie_cfg_read(struct pcie_port *pp, int where, int size, else return PCIBIOS_BAD_REGISTER_NUMBER; - return PCIBIOS_SUCCESSFUL; + return 0; } /* HipXX PCIe host only supports 32-bit config access */ @@ -190,7 +190,7 @@ static int hisi_pcie_cfg_write(struct pcie_port *pp, int where, int size, } else return PCIBIOS_BAD_REGISTER_NUMBER; - return PCIBIOS_SUCCESSFUL; + return 0; } static int hisi_pcie_link_up_hip05(struct hisi_pcie *hisi_pcie) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index 92b77f7d8354..34fe0084a4d1 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -581,7 +581,7 @@ static int tegra_pcie_dw_rd_own_conf(struct pcie_port *pp, int where, int size, */ if (where == PORT_LOGIC_MSIX_DOORBELL) { *val = 0x00000000; - return PCIBIOS_SUCCESSFUL; + return 0; } return dw_pcie_read(pci->dbi_base + where, size, val); @@ -599,7 +599,7 @@ static int tegra_pcie_dw_wr_own_conf(struct pcie_port *pp, int where, int size, * So skip accessing it altogether */ if (where == PORT_LOGIC_MSIX_DOORBELL) - return PCIBIOS_SUCCESSFUL; + return 0; return dw_pcie_write(pci->dbi_base + where, size, val); } diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.c b/drivers/pci/controller/mobiveil/pcie-mobiveil.c index 62ecbaeb0a60..f9f03b022d0e 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.c +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.c @@ -71,7 +71,7 @@ static int mobiveil_pcie_read(void __iomem *addr, int size, u32 *val) return PCIBIOS_BAD_REGISTER_NUMBER; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int mobiveil_pcie_write(void __iomem *addr, int size, u32 val) @@ -93,7 +93,7 @@ static int mobiveil_pcie_write(void __iomem *addr, int size, u32 val) return PCIBIOS_BAD_REGISTER_NUMBER; } - return PCIBIOS_SUCCESSFUL; + return 0; } u32 mobiveil_csr_read(struct mobiveil_pcie *pcie, u32 off, size_t size) diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c index 90ff291c24f0..b9a2d3359317 100644 --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c @@ -700,7 +700,7 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn, else if (size == 2) *val = (*val >> (8 * (where & 3))) & 0xffff; - return PCIBIOS_SUCCESSFUL; + return 0; } static int advk_pcie_wr_conf(struct pci_bus *bus, u32 devfn, @@ -760,7 +760,7 @@ static int advk_pcie_wr_conf(struct pci_bus *bus, u32 devfn, advk_pcie_check_pio_status(pcie); - return PCIBIOS_SUCCESSFUL; + return 0; } static struct pci_ops advk_pcie_ops = { diff --git a/drivers/pci/controller/pci-ftpci100.c b/drivers/pci/controller/pci-ftpci100.c index 1b67564de7af..449187e8c298 100644 --- a/drivers/pci/controller/pci-ftpci100.c +++ b/drivers/pci/controller/pci-ftpci100.c @@ -204,7 +204,7 @@ static int faraday_raw_pci_read_config(struct faraday_pci *p, int bus_number, else if (size == 2) *value = (*value >> (8 * (config & 3))) & 0xFFFF; - return PCIBIOS_SUCCESSFUL; + return 0; } static int faraday_pci_read_config(struct pci_bus *bus, unsigned int fn, @@ -223,7 +223,7 @@ static int faraday_raw_pci_write_config(struct faraday_pci *p, int bus_number, unsigned int fn, int config, int size, u32 value) { - int ret = PCIBIOS_SUCCESSFUL; + int ret = 0; writel(PCI_CONF_BUS(bus_number) | PCI_CONF_DEVICE(PCI_SLOT(fn)) | diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index bf40ff09c99d..b1552394e2d6 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -807,7 +807,7 @@ static void _hv_pcifront_write_config(struct hv_pci_dev *hpdev, int where, * @size: Byte/word/dword * @val: Value to be read * - * Return: PCIBIOS_SUCCESSFUL on success + * Return: 0 on success * PCIBIOS_DEVICE_NOT_FOUND on failure */ static int hv_pcifront_read_config(struct pci_bus *bus, unsigned int devfn, @@ -824,7 +824,7 @@ static int hv_pcifront_read_config(struct pci_bus *bus, unsigned int devfn, _hv_pcifront_read_config(hpdev, where, size, val); put_pcichild(hpdev); - return PCIBIOS_SUCCESSFUL; + return 0; } /** @@ -835,7 +835,7 @@ static int hv_pcifront_read_config(struct pci_bus *bus, unsigned int devfn, * @size: Byte/word/dword * @val: Value to be written to device * - * Return: PCIBIOS_SUCCESSFUL on success + * Return: 0 on success * PCIBIOS_DEVICE_NOT_FOUND on failure */ static int hv_pcifront_write_config(struct pci_bus *bus, unsigned int devfn, @@ -852,7 +852,7 @@ static int hv_pcifront_write_config(struct pci_bus *bus, unsigned int devfn, _hv_pcifront_write_config(hpdev, where, size, val); put_pcichild(hpdev); - return PCIBIOS_SUCCESSFUL; + return 0; } /* PCIe operations */ diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c index 153a64676bc9..30ef5ece4a3b 100644 --- a/drivers/pci/controller/pci-mvebu.c +++ b/drivers/pci/controller/pci-mvebu.c @@ -246,7 +246,7 @@ static int mvebu_pcie_hw_rd_conf(struct mvebu_pcie_port *port, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int mvebu_pcie_hw_wr_conf(struct mvebu_pcie_port *port, @@ -272,7 +272,7 @@ static int mvebu_pcie_hw_wr_conf(struct mvebu_pcie_port *port, return PCIBIOS_BAD_REGISTER_NUMBER; } - return PCIBIOS_SUCCESSFUL; + return 0; } /* diff --git a/drivers/pci/controller/pci-thunder-ecam.c b/drivers/pci/controller/pci-thunder-ecam.c index 7e8835fee5f7..8e30e1f9622e 100644 --- a/drivers/pci/controller/pci-thunder-ecam.c +++ b/drivers/pci/controller/pci-thunder-ecam.c @@ -37,7 +37,7 @@ static int handle_ea_bar(u32 e0, int bar, struct pci_bus *bus, if (where_a == 0) { set_val(e0, where, size, val); - return PCIBIOS_SUCCESSFUL; + return 0; } if (where_a == 0x4) { addr = bus->ops->map_bus(bus, devfn, bar); /* BAR 0 */ @@ -49,7 +49,7 @@ static int handle_ea_bar(u32 e0, int bar, struct pci_bus *bus, v &= ~0xf; v |= 2; /* EA entry-1. Base-L */ set_val(v, where, size, val); - return PCIBIOS_SUCCESSFUL; + return 0; } if (where_a == 0x8) { u32 barl_orig; @@ -68,7 +68,7 @@ static int handle_ea_bar(u32 e0, int bar, struct pci_bus *bus, v = ~barl_rb & ~3; v |= 0xc; /* EA entry-2. Offset-L */ set_val(v, where, size, val); - return PCIBIOS_SUCCESSFUL; + return 0; } if (where_a == 0xc) { addr = bus->ops->map_bus(bus, devfn, bar + 4); /* BAR 1 */ @@ -78,7 +78,7 @@ static int handle_ea_bar(u32 e0, int bar, struct pci_bus *bus, } v = readl(addr); /* EA entry-3. Base-H */ set_val(v, where, size, val); - return PCIBIOS_SUCCESSFUL; + return 0; } return PCIBIOS_DEVICE_NOT_FOUND; } @@ -121,7 +121,7 @@ static int thunder_ecam_p2_config_read(struct pci_bus *bus, unsigned int devfn, v |= node_bits; set_val(v, where, size, val); - return PCIBIOS_SUCCESSFUL; + return 0; } static int thunder_ecam_config_read(struct pci_bus *bus, unsigned int devfn, @@ -172,7 +172,7 @@ static int thunder_ecam_config_read(struct pci_bus *bus, unsigned int devfn, (where >= 0x1a4 && where < 0x1bc))) { /* BAR or SR-IOV BAR */ *val = 0; - return PCIBIOS_SUCCESSFUL; + return 0; } addr = bus->ops->map_bus(bus, devfn, 0); @@ -207,7 +207,7 @@ static int thunder_ecam_config_read(struct pci_bus *bus, unsigned int devfn, if (!has_msix && where_a == 0x70) { v |= 0xbc00; /* next capability is EA at 0xbc */ set_val(v, where, size, val); - return PCIBIOS_SUCCESSFUL; + return 0; } if (where_a == 0xb0) { addr = bus->ops->map_bus(bus, devfn, where_a); @@ -220,7 +220,7 @@ static int thunder_ecam_config_read(struct pci_bus *bus, unsigned int devfn, pr_err("Bad MSIX cap header: %08x\n", v); v |= 0xbc00; /* next capability is EA at 0xbc */ set_val(v, where, size, val); - return PCIBIOS_SUCCESSFUL; + return 0; } if (where_a == 0xbc) { if (is_nic) @@ -232,7 +232,7 @@ static int thunder_ecam_config_read(struct pci_bus *bus, unsigned int devfn, else v = 0x10014; /* EA last in chain, 1 entry */ set_val(v, where, size, val); - return PCIBIOS_SUCCESSFUL; + return 0; } if (where_a >= 0xc0 && where_a < 0xd0) /* EA entry-0. PP=0, BAR0 Size:3 */ @@ -277,7 +277,7 @@ static int thunder_ecam_config_read(struct pci_bus *bus, unsigned int devfn, pr_err("Bad PCIe cap header: %08x\n", v); v |= 0xbc00; /* next capability is EA at 0xbc */ set_val(v, where, size, val); - return PCIBIOS_SUCCESSFUL; + return 0; } if (where_a == 0xbc) { if (is_nic_bridge) @@ -285,7 +285,7 @@ static int thunder_ecam_config_read(struct pci_bus *bus, unsigned int devfn, else v = 0x00014; /* EA last in chain, no entries */ set_val(v, where, size, val); - return PCIBIOS_SUCCESSFUL; + return 0; } if (where_a == 0xc0) { if (is_rsl_bridge || is_nic_bridge) @@ -297,33 +297,33 @@ static int thunder_ecam_config_read(struct pci_bus *bus, unsigned int devfn, else if (is_dfa_bridge) v = 0x0404; /* subordinate:secondary = 4:4 */ set_val(v, where, size, val); - return PCIBIOS_SUCCESSFUL; + return 0; } if (where_a == 0xc4 && is_nic_bridge) { /* Enabled, not-Write, SP=ff, PP=05, BEI=6, ES=4 */ v = 0x80ff0564; set_val(v, where, size, val); - return PCIBIOS_SUCCESSFUL; + return 0; } if (where_a == 0xc8 && is_nic_bridge) { v = 0x00000002; /* Base-L 64-bit */ set_val(v, where, size, val); - return PCIBIOS_SUCCESSFUL; + return 0; } if (where_a == 0xcc && is_nic_bridge) { v = 0xfffffffe; /* MaxOffset-L 64-bit */ set_val(v, where, size, val); - return PCIBIOS_SUCCESSFUL; + return 0; } if (where_a == 0xd0 && is_nic_bridge) { v = 0x00008430; /* NIC Base-H */ set_val(v, where, size, val); - return PCIBIOS_SUCCESSFUL; + return 0; } if (where_a == 0xd4 && is_nic_bridge) { v = 0x0000000f; /* MaxOffset-H */ set_val(v, where, size, val); - return PCIBIOS_SUCCESSFUL; + return 0; } } no_emulation: @@ -340,7 +340,7 @@ static int thunder_ecam_config_write(struct pci_bus *bus, unsigned int devfn, if ((where >= 0x10 && where < 0x2c) || (where >= 0x1a4 && where < 0x1bc)) /* BAR or SR-IOV BAR */ - return PCIBIOS_SUCCESSFUL; + return 0; return pci_generic_config_write(bus, devfn, where, size, val); } diff --git a/drivers/pci/controller/pci-thunder-pem.c b/drivers/pci/controller/pci-thunder-pem.c index 3f847969143e..ae747d203514 100644 --- a/drivers/pci/controller/pci-thunder-pem.c +++ b/drivers/pci/controller/pci-thunder-pem.c @@ -123,7 +123,7 @@ static int thunder_pem_bridge_read(struct pci_bus *bus, unsigned int devfn, break; } *val = read_val; - return PCIBIOS_SUCCESSFUL; + return 0; } static int thunder_pem_config_read(struct pci_bus *bus, unsigned int devfn, @@ -272,7 +272,7 @@ static int thunder_pem_bridge_write(struct pci_bus *bus, unsigned int devfn, */ write_val = (((u64)val) << 32) | where_aligned; writeq(write_val, pem_pci->pem_reg_base + PEM_CFG_WR); - return PCIBIOS_SUCCESSFUL; + return 0; } static int thunder_pem_config_write(struct pci_bus *bus, unsigned int devfn, diff --git a/drivers/pci/controller/pci-xgene.c b/drivers/pci/controller/pci-xgene.c index d1efa8ffbae1..bf74f0a8b451 100644 --- a/drivers/pci/controller/pci-xgene.c +++ b/drivers/pci/controller/pci-xgene.c @@ -168,7 +168,7 @@ static int xgene_pcie_config_read32(struct pci_bus *bus, unsigned int devfn, struct xgene_pcie_port *port = pcie_bus_to_port(bus); if (pci_generic_config_read32(bus, devfn, where & ~0x3, 4, val) != - PCIBIOS_SUCCESSFUL) + 0) return PCIBIOS_DEVICE_NOT_FOUND; /* @@ -187,7 +187,7 @@ static int xgene_pcie_config_read32(struct pci_bus *bus, unsigned int devfn, if (size <= 2) *val = (*val >> (8 * (where & 3))) & ((1 << (size * 8)) - 1); - return PCIBIOS_SUCCESSFUL; + return 0; } #endif diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c index 24cb1c331058..96f5bda32b58 100644 --- a/drivers/pci/controller/pcie-altera.c +++ b/drivers/pci/controller/pcie-altera.c @@ -226,7 +226,7 @@ static int tlp_read_packet(struct altera_pcie *pcie, u32 *value) if (value) *value = reg0; - return PCIBIOS_SUCCESSFUL; + return 0; } } udelay(5); @@ -273,7 +273,7 @@ static int s10_tlp_read_packet(struct altera_pcie *pcie, u32 *value) count == 4) *value = dw[3]; - return PCIBIOS_SUCCESSFUL; + return 0; } } @@ -367,7 +367,7 @@ static int tlp_cfg_dword_write(struct altera_pcie *pcie, u8 bus, u32 devfn, value, false); ret = pcie->pcie_data->ops->tlp_read_pkt(pcie, NULL); - if (ret != PCIBIOS_SUCCESSFUL) + if (ret != 0) return ret; /* @@ -377,7 +377,7 @@ static int tlp_cfg_dword_write(struct altera_pcie *pcie, u8 bus, u32 devfn, if ((bus == pcie->root_bus_nr) && (where == PCI_PRIMARY_BUS)) pcie->root_bus_nr = (u8)(value); - return PCIBIOS_SUCCESSFUL; + return 0; } static int s10_rp_read_cfg(struct altera_pcie *pcie, int where, @@ -397,7 +397,7 @@ static int s10_rp_read_cfg(struct altera_pcie *pcie, int where, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int s10_rp_write_cfg(struct altera_pcie *pcie, u8 busno, @@ -424,7 +424,7 @@ static int s10_rp_write_cfg(struct altera_pcie *pcie, u8 busno, if (busno == pcie->root_bus_nr && where == PCI_PRIMARY_BUS) pcie->root_bus_nr = value & 0xff; - return PCIBIOS_SUCCESSFUL; + return 0; } static int _altera_pcie_cfg_read(struct altera_pcie *pcie, u8 busno, @@ -453,7 +453,7 @@ static int _altera_pcie_cfg_read(struct altera_pcie *pcie, u8 busno, ret = tlp_cfg_dword_read(pcie, busno, devfn, (where & ~DWORD_MASK), byte_en, &data); - if (ret != PCIBIOS_SUCCESSFUL) + if (ret != 0) return ret; switch (size) { @@ -468,7 +468,7 @@ static int _altera_pcie_cfg_read(struct altera_pcie *pcie, u8 busno, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int _altera_pcie_cfg_write(struct altera_pcie *pcie, u8 busno, diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c index 8c7f875acf7f..dac9352c0cb2 100644 --- a/drivers/pci/controller/pcie-iproc.c +++ b/drivers/pci/controller/pcie-iproc.c @@ -584,7 +584,7 @@ static int iproc_pcie_config_read(struct pci_bus *bus, unsigned int devfn, /* root complex access */ if (busno == 0) { ret = pci_generic_config_read32(bus, devfn, where, size, val); - if (ret == PCIBIOS_SUCCESSFUL) + if (ret == 0) iproc_pcie_fix_cap(pcie, where, val); return ret; @@ -620,7 +620,7 @@ static int iproc_pcie_config_read(struct pci_bus *bus, unsigned int devfn, (PCI_DEVICE_ID_NX2_57810 << DEVICE_ID_SHIFT)) return PCIBIOS_FUNC_NOT_SUPPORTED; - return PCIBIOS_SUCCESSFUL; + return 0; } /** @@ -677,7 +677,7 @@ static int iproc_pci_raw_config_read32(struct iproc_pcie *pcie, if (size <= 2) *val = (*val >> (8 * (where & 3))) & ((1 << (size * 8)) - 1); - return PCIBIOS_SUCCESSFUL; + return 0; } static int iproc_pci_raw_config_write32(struct iproc_pcie *pcie, @@ -693,7 +693,7 @@ static int iproc_pci_raw_config_write32(struct iproc_pcie *pcie, if (size == 4) { writel(val, addr); - return PCIBIOS_SUCCESSFUL; + return 0; } mask = ~(((1 << (size * 8)) - 1) << ((where & 0x3) * 8)); @@ -701,7 +701,7 @@ static int iproc_pci_raw_config_write32(struct iproc_pcie *pcie, tmp |= val << ((where & 0x3) * 8); writel(tmp, addr); - return PCIBIOS_SUCCESSFUL; + return 0; } static int iproc_pcie_config_read32(struct pci_bus *bus, unsigned int devfn, diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c index ebfa7d5a4e2d..9e8adec04ac2 100644 --- a/drivers/pci/controller/pcie-mediatek.c +++ b/drivers/pci/controller/pcie-mediatek.c @@ -274,7 +274,7 @@ static int mtk_pcie_check_cfg_cpld(struct mtk_pcie_port *port) if (readl(port->base + PCIE_APP_TLP_REQ) & APP_CPL_STATUS) return PCIBIOS_SET_FAILED; - return PCIBIOS_SUCCESSFUL; + return 0; } static int mtk_pcie_hw_rd_cfg(struct mtk_pcie_port *port, u32 bus, u32 devfn, @@ -306,7 +306,7 @@ static int mtk_pcie_hw_rd_cfg(struct mtk_pcie_port *port, u32 bus, u32 devfn, else if (size == 2) *val = (*val >> (8 * (where & 3))) & 0xffff; - return PCIBIOS_SUCCESSFUL; + return 0; } static int mtk_pcie_hw_wr_cfg(struct mtk_pcie_port *port, u32 bus, u32 devfn, diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c index d210a36561be..363a8630de28 100644 --- a/drivers/pci/controller/pcie-rcar-host.c +++ b/drivers/pci/controller/pcie-rcar-host.c @@ -110,7 +110,7 @@ static int rcar_pcie_config_access(struct rcar_pcie_host *host, rcar_pci_write_reg(pcie, *data, PCICONF(index)); } - return PCIBIOS_SUCCESSFUL; + return 0; } if (host->root_bus_nr < 0) @@ -146,7 +146,7 @@ static int rcar_pcie_config_access(struct rcar_pcie_host *host, /* Disable the configuration access */ rcar_pci_write_reg(pcie, 0, PCIECCTLR); - return PCIBIOS_SUCCESSFUL; + return 0; } static int rcar_pcie_read_conf(struct pci_bus *bus, unsigned int devfn, @@ -157,7 +157,7 @@ static int rcar_pcie_read_conf(struct pci_bus *bus, unsigned int devfn, ret = rcar_pcie_config_access(host, RCAR_PCI_ACCESS_READ, bus, devfn, where, val); - if (ret != PCIBIOS_SUCCESSFUL) { + if (ret != 0) { *val = 0xffffffff; return ret; } @@ -184,7 +184,7 @@ static int rcar_pcie_write_conf(struct pci_bus *bus, unsigned int devfn, ret = rcar_pcie_config_access(host, RCAR_PCI_ACCESS_READ, bus, devfn, where, &data); - if (ret != PCIBIOS_SUCCESSFUL) + if (ret != 0) return ret; dev_dbg(&bus->dev, "pcie-config-write: bus=%3d devfn=0x%04x where=0x%04x size=%d val=0x%08x\n", diff --git a/drivers/pci/controller/pcie-rockchip-host.c b/drivers/pci/controller/pcie-rockchip-host.c index 94af6f5828a3..6455f48d4e9c 100644 --- a/drivers/pci/controller/pcie-rockchip-host.c +++ b/drivers/pci/controller/pcie-rockchip-host.c @@ -125,7 +125,7 @@ static int rockchip_pcie_rd_own_conf(struct rockchip_pcie *rockchip, *val = 0; return PCIBIOS_BAD_REGISTER_NUMBER; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int rockchip_pcie_wr_own_conf(struct rockchip_pcie *rockchip, @@ -139,7 +139,7 @@ static int rockchip_pcie_wr_own_conf(struct rockchip_pcie *rockchip, if (size == 4) { writel(val, addr); - return PCIBIOS_SUCCESSFUL; + return 0; } mask = ~(((1 << (size * 8)) - 1) << ((where & 0x3) * 8)); @@ -153,7 +153,7 @@ static int rockchip_pcie_wr_own_conf(struct rockchip_pcie *rockchip, tmp |= val << ((where & 0x3) * 8); writel(tmp, addr); - return PCIBIOS_SUCCESSFUL; + return 0; } static int rockchip_pcie_rd_other_conf(struct rockchip_pcie *rockchip, @@ -187,7 +187,7 @@ static int rockchip_pcie_rd_other_conf(struct rockchip_pcie *rockchip, *val = 0; return PCIBIOS_BAD_REGISTER_NUMBER; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int rockchip_pcie_wr_other_conf(struct rockchip_pcie *rockchip, @@ -217,7 +217,7 @@ static int rockchip_pcie_wr_other_conf(struct rockchip_pcie *rockchip, else return PCIBIOS_BAD_REGISTER_NUMBER; - return PCIBIOS_SUCCESSFUL; + return 0; } static int rockchip_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, From patchwork Mon Jul 13 12:22:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1328001 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=hLYogsEr; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54CN4Klnz9sR4 for ; Mon, 13 Jul 2020 23:25:36 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729916AbgGMNZb (ORCPT ); Mon, 13 Jul 2020 09:25:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729897AbgGMNWr (ORCPT ); Mon, 13 Jul 2020 09:22:47 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1FFCC061755; Mon, 13 Jul 2020 06:22:46 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id y10so17167550eje.1; Mon, 13 Jul 2020 06:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9eSzPhspiWvGf9aT6n+u7h1JAatvbzNtxDm7qgPwQa4=; b=hLYogsErj4MxDifEjs2yaWms0NpgUVako6c8lR/I2R4HV9RllrJIdGqkMDp5APeeDE oWeJOdnNhg7Ug/j0KkKHuaUJSEqiFCugiXFDKBKD08Rf4UCqkHYGXXTk09tPPdekReMl f/Z3N9TMpWpw2xAQtgdR8/N+9F0vAhXDYUe0EU/xGTl4W5zeIioGJduOy6lClM+Y6oFA xnjejrZ8kSmDHyZVOhAaPrgokXgExqfS+EI7cvM+Df1dhlImeqOdm4/lVR+HRcx5xHku Igf8N+NUygg5XttWH+kIcV9FL4bX+s92wGGITkFUVhBz34HIbR1LCVyWtNYcj0CfHCge ox9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9eSzPhspiWvGf9aT6n+u7h1JAatvbzNtxDm7qgPwQa4=; b=d0Opt1Ze4zzLv7lJoBvqB0JH2e3ch+zf4WPcdYkMnv1dbg2UUESeF1IvZ8yumYkOWW kIkPu5wBB3EhRgwN6803JbOQq7ZyeV1Xx59p9R2bxiObObFm/xRWEEerbW12Xk9ReoyS +PrcncfcCpaX0FVYu7ye2oiU0c2steyMreeZgOPrrDd8+EDvHSZRVAvYf98usRPGo2+e aVwfaPlx9NzMd4J+Qx4uNei3hrDFlI6q50a2kGdGLkKM2dxPWvH2Sam8JsStXZiVI64K 54DoHQCLCOVq7gNZnYgsBxLGM5ckfb/jYLNXqLWqtsbQebXxcfKqQ+7uCvthial2s2Vc 0q7A== X-Gm-Message-State: AOAM530nGAsI1MZvFhCevbWLKzMij+jJxA5o+AVAgYNuw/xTDyOSEWx0 YCgmL4TAmUIvwbFwiS3wU/I= X-Google-Smtp-Source: ABdhPJyNhtJJphGqXF4QW+aGFKHkMsFvQ0ZrswEHN2+kh5oK7be5K3ZFffA96ErJ6GVjCF52Di2gmA== X-Received: by 2002:a17:906:d143:: with SMTP id br3mr71266443ejb.268.1594646565435; Mon, 13 Jul 2020 06:22:45 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:22:44 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Lorenzo Pieralisi , Rob Herring , Ley Foon Tan , Marek Vasut , Yoshihiro Shimoda , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Toan Le , Jingoo Han , Gustavo Pimentel , Yue Wang , Kevin Hilman , Philipp Zabel Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, rfi@lists.rocketboards.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org Subject: [RFC PATCH 06/35] PCI: Tidy Success/Failure checks Date: Mon, 13 Jul 2020 14:22:18 +0200 Message-Id: <20200713122247.10985-7-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unnecessary check for 0. Signed-off-by: "Saheed O. Bolarinwa" --- This patch depends on PATCH 05/35 drivers/pci/controller/dwc/pci-meson.c | 2 +- drivers/pci/controller/dwc/pcie-designware-host.c | 2 +- drivers/pci/controller/pci-xgene.c | 3 +-- drivers/pci/controller/pcie-altera.c | 4 ++-- drivers/pci/controller/pcie-iproc.c | 2 +- drivers/pci/controller/pcie-rcar-host.c | 4 ++-- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c index 58142f03d300..8203d5f95d28 100644 --- a/drivers/pci/controller/dwc/pci-meson.c +++ b/drivers/pci/controller/dwc/pci-meson.c @@ -390,7 +390,7 @@ static int meson_pcie_rd_own_conf(struct pcie_port *pp, int where, int size, int ret; ret = dw_pcie_read(pci->dbi_base + where, size, val); - if (ret != 0) + if (ret) return ret; /* diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index 7c97c54f787c..2dd3965365f6 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -459,7 +459,7 @@ int dw_pcie_host_init(struct pcie_port *pp) } ret = dw_pcie_rd_own_conf(pp, PCI_HEADER_TYPE, 1, &hdr_type); - if (ret != 0) { + if (ret) { dev_err(pci->dev, "Failed reading PCI_HEADER_TYPE cfg space reg (ret: 0x%x)\n", ret); ret = pcibios_err_to_errno(ret); diff --git a/drivers/pci/controller/pci-xgene.c b/drivers/pci/controller/pci-xgene.c index bf74f0a8b451..8d55cfc4ff8a 100644 --- a/drivers/pci/controller/pci-xgene.c +++ b/drivers/pci/controller/pci-xgene.c @@ -167,8 +167,7 @@ static int xgene_pcie_config_read32(struct pci_bus *bus, unsigned int devfn, { struct xgene_pcie_port *port = pcie_bus_to_port(bus); - if (pci_generic_config_read32(bus, devfn, where & ~0x3, 4, val) != - 0) + if (pci_generic_config_read32(bus, devfn, where & ~0x3, 4, val)) return PCIBIOS_DEVICE_NOT_FOUND; /* diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c index 96f5bda32b58..9f7b12ad0c04 100644 --- a/drivers/pci/controller/pcie-altera.c +++ b/drivers/pci/controller/pcie-altera.c @@ -367,7 +367,7 @@ static int tlp_cfg_dword_write(struct altera_pcie *pcie, u8 bus, u32 devfn, value, false); ret = pcie->pcie_data->ops->tlp_read_pkt(pcie, NULL); - if (ret != 0) + if (ret) return ret; /* @@ -453,7 +453,7 @@ static int _altera_pcie_cfg_read(struct altera_pcie *pcie, u8 busno, ret = tlp_cfg_dword_read(pcie, busno, devfn, (where & ~DWORD_MASK), byte_en, &data); - if (ret != 0) + if (ret) return ret; switch (size) { diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c index dac9352c0cb2..d34c9457fbe4 100644 --- a/drivers/pci/controller/pcie-iproc.c +++ b/drivers/pci/controller/pcie-iproc.c @@ -584,7 +584,7 @@ static int iproc_pcie_config_read(struct pci_bus *bus, unsigned int devfn, /* root complex access */ if (busno == 0) { ret = pci_generic_config_read32(bus, devfn, where, size, val); - if (ret == 0) + if (!ret) iproc_pcie_fix_cap(pcie, where, val); return ret; diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c index 363a8630de28..2bb250c6f767 100644 --- a/drivers/pci/controller/pcie-rcar-host.c +++ b/drivers/pci/controller/pcie-rcar-host.c @@ -157,7 +157,7 @@ static int rcar_pcie_read_conf(struct pci_bus *bus, unsigned int devfn, ret = rcar_pcie_config_access(host, RCAR_PCI_ACCESS_READ, bus, devfn, where, val); - if (ret != 0) { + if (ret) { *val = 0xffffffff; return ret; } @@ -184,7 +184,7 @@ static int rcar_pcie_write_conf(struct pci_bus *bus, unsigned int devfn, ret = rcar_pcie_config_access(host, RCAR_PCI_ACCESS_READ, bus, devfn, where, &data); - if (ret != 0) + if (ret) return ret; dev_dbg(&bus->dev, "pcie-config-write: bus=%3d devfn=0x%04x where=0x%04x size=%d val=0x%08x\n", From patchwork Mon Jul 13 12:22:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327997 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=pi84S25E; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54CG5Ncyz9sTk for ; Mon, 13 Jul 2020 23:25:30 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729907AbgGMNWt (ORCPT ); Mon, 13 Jul 2020 09:22:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729881AbgGMNWs (ORCPT ); Mon, 13 Jul 2020 09:22:48 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64F6AC061755; Mon, 13 Jul 2020 06:22:48 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id p20so17106412ejd.13; Mon, 13 Jul 2020 06:22:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FetVZrPlJUPVzjvl/d8u42tnB5KKMfZUCULLNeuM/VI=; b=pi84S25E/LjOX6WfnqtNMuVL7qs5eO1E4EewALCcA9YMwfyw8CnRiXzijZVG26Bw2j 0xNBGXVpPw+j+e8RC7bx5v3vk4LyCNCZ7gb0ZvzSAAMHGlCtUkuj0sxXdepUae2OnJ43 JERDq32hpusL01gB+UL/JL/wwZF4MzoCs6+qLiWOdFnOUHcMZRmgEfT280w8JasvRaE9 CSY24PlKTHaERxPN0+m6mwuMwLEiai9Jgle5PeObDaPQHBLIzXiR44qH/cpp3+uvpbIO +hLR3AvXmAhlJlfJ5IsGwsQDycGe642PI7IF4CmBXU5f3/sqaqNBEafxVaMIODqkBGcD tMWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FetVZrPlJUPVzjvl/d8u42tnB5KKMfZUCULLNeuM/VI=; b=TxMNJPoMdyKAQSQnx8KGA1DsAujnQwwRZsRWg/mdwFNvhbkCzMLdzCttiQYgfBx8JP G8suSevUyjd4VXOfIM16iAa5sIpiadm73oM94hP4N7vMoAtxuhhQrDfOkWWWtAbdXPVE mn7qbSzKnhb4xHuIhKBr1vd1uQvU/8i55BheimBuJYB8w/Ss3BrCzxEW4A/hBxkiPmXm 53Pc7bdf+X4cs2kOWpB+Pmr9S5357GUtRAQpZsFLICgvbpKyE5Y/wyB7uUFfgXBJXBEu eL0T/f9Hchc8njl8B0k5ihB07k7AwXu1EUT/UA5LUAhkpEAkxgosgXEgHwj6UTZpXfss E80w== X-Gm-Message-State: AOAM5320IYBz+yfVyUUoWBnYJ4MSlMzLJZQePwcITkWHtwek+FyUQOZD 5dSI/IYwrIsuWt0ilcOTHaQ= X-Google-Smtp-Source: ABdhPJzp2M4i/xmpJ7GKgnOIHqRMg1MAl8Qp4E8T8kCfwxBHg6LBO9oYn/AU6tHj6VuJkN61Uk+q6g== X-Received: by 2002:a17:906:7c8:: with SMTP id m8mr73049398ejc.527.1594646567104; Mon, 13 Jul 2020 06:22:47 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:22:46 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 07/35] PCI: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:19 +0200 Message-Id: <20200713122247.10985-8-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- drivers/pci/access.c | 14 +++++++------- drivers/pci/pci-bridge-emul.c | 14 +++++++------- drivers/pci/pci.c | 8 ++++---- drivers/pci/pcie/bw_notification.c | 4 ++-- drivers/pci/probe.c | 4 ++-- drivers/pci/quirks.c | 2 +- drivers/pci/syscall.c | 8 ++++---- drivers/pci/xen-pcifront.c | 2 +- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/pci/access.c b/drivers/pci/access.c index 79c4a2ef269a..b907abe38679 100644 --- a/drivers/pci/access.c +++ b/drivers/pci/access.c @@ -92,7 +92,7 @@ int pci_generic_config_read(struct pci_bus *bus, unsigned int devfn, else *val = readl(addr); - return PCIBIOS_SUCCESSFUL; + return 0; } EXPORT_SYMBOL_GPL(pci_generic_config_read); @@ -112,7 +112,7 @@ int pci_generic_config_write(struct pci_bus *bus, unsigned int devfn, else writel(val, addr); - return PCIBIOS_SUCCESSFUL; + return 0; } EXPORT_SYMBOL_GPL(pci_generic_config_write); @@ -132,7 +132,7 @@ int pci_generic_config_read32(struct pci_bus *bus, unsigned int devfn, if (size <= 2) *val = (*val >> (8 * (where & 3))) & ((1 << (size * 8)) - 1); - return PCIBIOS_SUCCESSFUL; + return 0; } EXPORT_SYMBOL_GPL(pci_generic_config_read32); @@ -148,7 +148,7 @@ int pci_generic_config_write32(struct pci_bus *bus, unsigned int devfn, if (size == 4) { writel(val, addr); - return PCIBIOS_SUCCESSFUL; + return 0; } /* @@ -169,7 +169,7 @@ int pci_generic_config_write32(struct pci_bus *bus, unsigned int devfn, tmp |= val << ((where & 0x3) * 8); writel(tmp, addr); - return PCIBIOS_SUCCESSFUL; + return 0; } EXPORT_SYMBOL_GPL(pci_generic_config_write32); @@ -222,7 +222,7 @@ static noinline void pci_wait_cfg(struct pci_dev *dev) int pci_user_read_config_##size \ (struct pci_dev *dev, int pos, type *val) \ { \ - int ret = PCIBIOS_SUCCESSFUL; \ + int ret = 0; \ u32 data = -1; \ if (PCI_##size##_BAD) \ return -EINVAL; \ @@ -242,7 +242,7 @@ EXPORT_SYMBOL_GPL(pci_user_read_config_##size); int pci_user_write_config_##size \ (struct pci_dev *dev, int pos, type val) \ { \ - int ret = PCIBIOS_SUCCESSFUL; \ + int ret = 0; \ if (PCI_##size##_BAD) \ return -EINVAL; \ raw_spin_lock_irq(&pci_lock); \ diff --git a/drivers/pci/pci-bridge-emul.c b/drivers/pci/pci-bridge-emul.c index ccf26d12ec61..9695c453e197 100644 --- a/drivers/pci/pci-bridge-emul.c +++ b/drivers/pci/pci-bridge-emul.c @@ -323,12 +323,12 @@ int pci_bridge_emul_conf_read(struct pci_bridge_emul *bridge, int where, if (bridge->has_pcie && reg >= PCI_CAP_PCIE_END) { *value = 0; - return PCIBIOS_SUCCESSFUL; + return 0; } if (!bridge->has_pcie && reg >= PCI_BRIDGE_CONF_END) { *value = 0; - return PCIBIOS_SUCCESSFUL; + return 0; } if (bridge->has_pcie && reg >= PCI_CAP_PCIE_START) { @@ -364,7 +364,7 @@ int pci_bridge_emul_conf_read(struct pci_bridge_emul *bridge, int where, else if (size != 4) return PCIBIOS_BAD_REGISTER_NUMBER; - return PCIBIOS_SUCCESSFUL; + return 0; } /* @@ -383,10 +383,10 @@ int pci_bridge_emul_conf_write(struct pci_bridge_emul *bridge, int where, const struct pci_bridge_reg_behavior *behavior; if (bridge->has_pcie && reg >= PCI_CAP_PCIE_END) - return PCIBIOS_SUCCESSFUL; + return 0; if (!bridge->has_pcie && reg >= PCI_BRIDGE_CONF_END) - return PCIBIOS_SUCCESSFUL; + return 0; shift = (where & 0x3) * 8; @@ -400,7 +400,7 @@ int pci_bridge_emul_conf_write(struct pci_bridge_emul *bridge, int where, return PCIBIOS_BAD_REGISTER_NUMBER; ret = pci_bridge_emul_conf_read(bridge, reg, 4, &old); - if (ret != PCIBIOS_SUCCESSFUL) + if (ret != 0) return ret; if (bridge->has_pcie && reg >= PCI_CAP_PCIE_START) { @@ -428,5 +428,5 @@ int pci_bridge_emul_conf_write(struct pci_bridge_emul *bridge, int where, if (write_op) write_op(bridge, reg, old, new, mask); - return PCIBIOS_SUCCESSFUL; + return 0; } diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index ce096272f52b..a74547861d5e 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -185,7 +185,7 @@ int pci_status_get_and_clear_errors(struct pci_dev *pdev) int ret; ret = pci_read_config_word(pdev, PCI_STATUS, &status); - if (ret != PCIBIOS_SUCCESSFUL) + if (ret != 0) return -EIO; status &= PCI_STATUS_ERROR_BITS; @@ -534,7 +534,7 @@ int pci_find_next_ext_capability(struct pci_dev *dev, int start, int cap) if (start) pos = start; - if (pci_read_config_dword(dev, pos, &header) != PCIBIOS_SUCCESSFUL) + if (pci_read_config_dword(dev, pos, &header) != 0) return 0; /* @@ -552,7 +552,7 @@ int pci_find_next_ext_capability(struct pci_dev *dev, int start, int cap) if (pos < PCI_CFG_SPACE_SIZE) break; - if (pci_read_config_dword(dev, pos, &header) != PCIBIOS_SUCCESSFUL) + if (pci_read_config_dword(dev, pos, &header) != 0) break; } @@ -628,7 +628,7 @@ static int __pci_find_next_ht_cap(struct pci_dev *dev, int pos, int ht_cap) PCI_CAP_ID_HT, &ttl); while (pos) { rc = pci_read_config_byte(dev, pos + 3, &cap); - if (rc != PCIBIOS_SUCCESSFUL) + if (rc != 0) return 0; if ((cap & mask) == ht_cap) diff --git a/drivers/pci/pcie/bw_notification.c b/drivers/pci/pcie/bw_notification.c index 77e685771487..c7201d886026 100644 --- a/drivers/pci/pcie/bw_notification.c +++ b/drivers/pci/pcie/bw_notification.c @@ -23,7 +23,7 @@ static bool pcie_link_bandwidth_notification_supported(struct pci_dev *dev) u32 lnk_cap; ret = pcie_capability_read_dword(dev, PCI_EXP_LNKCAP, &lnk_cap); - return (ret == PCIBIOS_SUCCESSFUL) && (lnk_cap & PCI_EXP_LNKCAP_LBNC); + return (ret == 0) && (lnk_cap & PCI_EXP_LNKCAP_LBNC); } static void pcie_enable_link_bandwidth_notification(struct pci_dev *dev) @@ -56,7 +56,7 @@ static irqreturn_t pcie_bw_notification_irq(int irq, void *context) ret = pcie_capability_read_word(port, PCI_EXP_LNKSTA, &link_status); events = link_status & PCI_EXP_LNKSTA_LBMS; - if (ret != PCIBIOS_SUCCESSFUL || !events) + if (ret != 0 || !events) return IRQ_NONE; pcie_capability_write_word(port, PCI_EXP_LNKSTA, events); diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 2f66988cea25..ab7e19882b30 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1582,7 +1582,7 @@ static bool pci_ext_cfg_is_aliased(struct pci_dev *dev) for (pos = PCI_CFG_SPACE_SIZE; pos < PCI_CFG_SPACE_EXP_SIZE; pos += PCI_CFG_SPACE_SIZE) { - if (pci_read_config_dword(dev, pos, &tmp) != PCIBIOS_SUCCESSFUL + if (pci_read_config_dword(dev, pos, &tmp) != 0 || header != tmp) return false; } @@ -1609,7 +1609,7 @@ static int pci_cfg_space_size_ext(struct pci_dev *dev) u32 status; int pos = PCI_CFG_SPACE_SIZE; - if (pci_read_config_dword(dev, pos, &status) != PCIBIOS_SUCCESSFUL) + if (pci_read_config_dword(dev, pos, &status) != 0) return PCI_CFG_SPACE_SIZE; if (status == 0xffffffff || pci_ext_cfg_is_aliased(dev)) return PCI_CFG_SPACE_SIZE; diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 812bfc32ecb8..e60ef8abd698 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -5117,7 +5117,7 @@ static void quirk_intel_qat_vf_cap(struct pci_dev *pdev) pdev->cfg_size = PCI_CFG_SPACE_EXP_SIZE; if (pci_read_config_dword(pdev, PCI_CFG_SPACE_SIZE, &status) != - PCIBIOS_SUCCESSFUL || (status == 0xffffffff)) + 0 || (status == 0xffffffff)) pdev->cfg_size = PCI_CFG_SPACE_SIZE; if (pci_find_saved_cap(pdev, PCI_CAP_ID_EXP)) diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c index 31e39558d49d..7d45b58beacd 100644 --- a/drivers/pci/syscall.c +++ b/drivers/pci/syscall.c @@ -46,7 +46,7 @@ SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn, } err = -EIO; - if (cfg_ret != PCIBIOS_SUCCESSFUL) + if (cfg_ret != 0) goto error; switch (len) { @@ -105,7 +105,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, if (err) break; err = pci_user_write_config_byte(dev, off, byte); - if (err != PCIBIOS_SUCCESSFUL) + if (err != 0) err = -EIO; break; @@ -114,7 +114,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, if (err) break; err = pci_user_write_config_word(dev, off, word); - if (err != PCIBIOS_SUCCESSFUL) + if (err != 0) err = -EIO; break; @@ -123,7 +123,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, if (err) break; err = pci_user_write_config_dword(dev, off, dword); - if (err != PCIBIOS_SUCCESSFUL) + if (err != 0) err = -EIO; break; diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c index fab267e359e7..f63623b683ad 100644 --- a/drivers/pci/xen-pcifront.c +++ b/drivers/pci/xen-pcifront.c @@ -81,7 +81,7 @@ static int errno_to_pcibios_err(int errno) { switch (errno) { case XEN_PCI_ERR_success: - return PCIBIOS_SUCCESSFUL; + return 0; case XEN_PCI_ERR_dev_not_found: return PCIBIOS_DEVICE_NOT_FOUND; From patchwork Mon Jul 13 12:22:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327996 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=uC7eUgOb; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54CF5rMzz9sTK for ; Mon, 13 Jul 2020 23:25:29 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729909AbgGMNZR (ORCPT ); Mon, 13 Jul 2020 09:25:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729910AbgGMNWu (ORCPT ); Mon, 13 Jul 2020 09:22:50 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E6BCC061755; Mon, 13 Jul 2020 06:22:49 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id rk21so17148285ejb.2; Mon, 13 Jul 2020 06:22:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JxkhZKsVa3z0BZ63RYkimychYt6uFQAMZoAlbu2p1Uc=; b=uC7eUgOb2feCtchst56uIJDoHC7Zp0WbIbUpDeyGVdCSd48ogNAOs+i/m80OEKDeCs ADgZl3lhhpSNHIWQnegJlNV99b/4+TGh/P7sM64Y/Ecfz6rqENwBHiqMykLoTfMaRpr+ SHEuVinXAErkPrzitCk/MmluTDwDhO+LJSKvrg1WNDYN9CwIWl8FGkSBBLIEM8fX3aFM D/s10PtX/fX7fack2CoJXPcHsIk7veCSbpQBCVkoJv2/L8SK2+hdR0j2/BT0FtlqFF/U KqkW/Um6gUJU5OT5KTc6/r6IEe4MYQeg4BlQ2Zy1Cytx/D5/oTvzdvWNHEk0hAqLZtvn oZvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JxkhZKsVa3z0BZ63RYkimychYt6uFQAMZoAlbu2p1Uc=; b=IFUT5W/XlBsMD70rGBGhhF+O4QeOuIcHjBlwmQt9XB0zFWvhjBjYPNaAUV2Ot9U7/C t8bbGYC1TV40QramJQZViLArWYMbo5/+jlADyJV8PkoGaLsU6Vlsf37RK0wsIH/EHLNe DsT8PpjKt8CaIxCXScEgtLjMBx/CO9/oqJYZ28AGKFHVT4fzi5ucds2hpMUuK4jPQDBl 8lkUjYe3stQTx0m6JltLnQSecp+xy3hC1M1gvv8ovw7t5RioKnJLxQ6Sxlts1bplpGZs rDXw/OdyOc3cfUanjQGoJS1wKe0jCWoyP7RVqhpzLMWZjJ0HoEBqThd1txvnvm1AuDoj AtHg== X-Gm-Message-State: AOAM5332ZC5/McJk5yw5CIj09EEliIPmQss9QRUK0ANfNBE7WsDB0LFs uNQXzEHjF/npZLSHqIq7F//PYr5LRJ8Fvg== X-Google-Smtp-Source: ABdhPJyvEFGOBAm5twEHyZqvV5SIe2iQDHFq46CgDrJch/0w7R2T3iioA0rmv9hum6shYaVHNjLYpw== X-Received: by 2002:a17:906:fa9a:: with SMTP id lt26mr63653165ejb.502.1594646568296; Mon, 13 Jul 2020 06:22:48 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:22:47 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 08/35] PCI: Tidy Success/Failure checks Date: Mon, 13 Jul 2020 14:22:20 +0200 Message-Id: <20200713122247.10985-9-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unnecessary check for 0. Signed-off-by: "Saheed O. Bolarinwa" --- This patch depends on PATCH 07/35 drivers/pci/pci-bridge-emul.c | 2 +- drivers/pci/pci.c | 8 ++++---- drivers/pci/pcie/bw_notification.c | 4 ++-- drivers/pci/probe.c | 4 ++-- drivers/pci/quirks.c | 4 ++-- drivers/pci/syscall.c | 8 ++++---- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/pci/pci-bridge-emul.c b/drivers/pci/pci-bridge-emul.c index 9695c453e197..c270c18d5cf5 100644 --- a/drivers/pci/pci-bridge-emul.c +++ b/drivers/pci/pci-bridge-emul.c @@ -400,7 +400,7 @@ int pci_bridge_emul_conf_write(struct pci_bridge_emul *bridge, int where, return PCIBIOS_BAD_REGISTER_NUMBER; ret = pci_bridge_emul_conf_read(bridge, reg, 4, &old); - if (ret != 0) + if (ret) return ret; if (bridge->has_pcie && reg >= PCI_CAP_PCIE_START) { diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index a74547861d5e..4b2a348576cb 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -185,7 +185,7 @@ int pci_status_get_and_clear_errors(struct pci_dev *pdev) int ret; ret = pci_read_config_word(pdev, PCI_STATUS, &status); - if (ret != 0) + if (ret) return -EIO; status &= PCI_STATUS_ERROR_BITS; @@ -534,7 +534,7 @@ int pci_find_next_ext_capability(struct pci_dev *dev, int start, int cap) if (start) pos = start; - if (pci_read_config_dword(dev, pos, &header) != 0) + if (pci_read_config_dword(dev, pos, &header)) return 0; /* @@ -552,7 +552,7 @@ int pci_find_next_ext_capability(struct pci_dev *dev, int start, int cap) if (pos < PCI_CFG_SPACE_SIZE) break; - if (pci_read_config_dword(dev, pos, &header) != 0) + if (pci_read_config_dword(dev, pos, &header)) break; } @@ -628,7 +628,7 @@ static int __pci_find_next_ht_cap(struct pci_dev *dev, int pos, int ht_cap) PCI_CAP_ID_HT, &ttl); while (pos) { rc = pci_read_config_byte(dev, pos + 3, &cap); - if (rc != 0) + if (rc) return 0; if ((cap & mask) == ht_cap) diff --git a/drivers/pci/pcie/bw_notification.c b/drivers/pci/pcie/bw_notification.c index c7201d886026..f62c19ffedfc 100644 --- a/drivers/pci/pcie/bw_notification.c +++ b/drivers/pci/pcie/bw_notification.c @@ -23,7 +23,7 @@ static bool pcie_link_bandwidth_notification_supported(struct pci_dev *dev) u32 lnk_cap; ret = pcie_capability_read_dword(dev, PCI_EXP_LNKCAP, &lnk_cap); - return (ret == 0) && (lnk_cap & PCI_EXP_LNKCAP_LBNC); + return (!ret) && (lnk_cap & PCI_EXP_LNKCAP_LBNC); } static void pcie_enable_link_bandwidth_notification(struct pci_dev *dev) @@ -56,7 +56,7 @@ static irqreturn_t pcie_bw_notification_irq(int irq, void *context) ret = pcie_capability_read_word(port, PCI_EXP_LNKSTA, &link_status); events = link_status & PCI_EXP_LNKSTA_LBMS; - if (ret != 0 || !events) + if (ret || !events) return IRQ_NONE; pcie_capability_write_word(port, PCI_EXP_LNKSTA, events); diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index ab7e19882b30..60ecebbc7dcf 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1582,7 +1582,7 @@ static bool pci_ext_cfg_is_aliased(struct pci_dev *dev) for (pos = PCI_CFG_SPACE_SIZE; pos < PCI_CFG_SPACE_EXP_SIZE; pos += PCI_CFG_SPACE_SIZE) { - if (pci_read_config_dword(dev, pos, &tmp) != 0 + if (pci_read_config_dword(dev, pos, &tmp) || header != tmp) return false; } @@ -1609,7 +1609,7 @@ static int pci_cfg_space_size_ext(struct pci_dev *dev) u32 status; int pos = PCI_CFG_SPACE_SIZE; - if (pci_read_config_dword(dev, pos, &status) != 0) + if (pci_read_config_dword(dev, pos, &status)) return PCI_CFG_SPACE_SIZE; if (status == 0xffffffff || pci_ext_cfg_is_aliased(dev)) return PCI_CFG_SPACE_SIZE; diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index e60ef8abd698..8b69d6ebb619 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -5116,8 +5116,8 @@ static void quirk_intel_qat_vf_cap(struct pci_dev *pdev) pdev->pcie_mpss = reg16 & PCI_EXP_DEVCAP_PAYLOAD; pdev->cfg_size = PCI_CFG_SPACE_EXP_SIZE; - if (pci_read_config_dword(pdev, PCI_CFG_SPACE_SIZE, &status) != - 0 || (status == 0xffffffff)) + if (pci_read_config_dword(pdev, PCI_CFG_SPACE_SIZE, &status) + || (status == 0xffffffff)) pdev->cfg_size = PCI_CFG_SPACE_SIZE; if (pci_find_saved_cap(pdev, PCI_CAP_ID_EXP)) diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c index 7d45b58beacd..a208700000ea 100644 --- a/drivers/pci/syscall.c +++ b/drivers/pci/syscall.c @@ -46,7 +46,7 @@ SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn, } err = -EIO; - if (cfg_ret != 0) + if (cfg_ret) goto error; switch (len) { @@ -105,7 +105,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, if (err) break; err = pci_user_write_config_byte(dev, off, byte); - if (err != 0) + if (err) err = -EIO; break; @@ -114,7 +114,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, if (err) break; err = pci_user_write_config_word(dev, off, word); - if (err != 0) + if (err) err = -EIO; break; @@ -123,7 +123,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, if (err) break; err = pci_user_write_config_dword(dev, off, dword); - if (err != 0) + if (err) err = -EIO; break; From patchwork Mon Jul 13 12:22:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327998 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=kC1a/6Y3; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54CH5Hxyz9sTK for ; Mon, 13 Jul 2020 23:25:31 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729898AbgGMNZQ (ORCPT ); Mon, 13 Jul 2020 09:25:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729914AbgGMNWv (ORCPT ); Mon, 13 Jul 2020 09:22:51 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEAAFC061755; Mon, 13 Jul 2020 06:22:50 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id by13so13645166edb.11; Mon, 13 Jul 2020 06:22:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3p7ZQxDsqAw6bxRKCsTTKpFTwnHOWTrmwbcNce8gSD0=; b=kC1a/6Y3ti+3Edy+d+cQbMBh/qldnRPwLHoSl2H23Cjje6H3rWM5692t38HrMqgY5A p1s+PqqNo+5RJ1dsUaLO/o5atjQ5iwPsNylHtq4N71vpa7Ravr+SjTHFmCGF2RNGVtz1 8grrGtS5fONExEzjvRwgkpnWiQSkXOqP+gu6uFJCY9CpTcNWRqKPPF4WQFX33thviMtu ZgQF1sl7N4Ol14HkF07patZboGe159hLEnRA8+C4BSQbknyJ9Wvo1B5TgHzQwmrrY4ka Ykaw7YcDuIa/pxfpmu3FfVjiWooxaEDWeaIztQdb2ec4JMk0kXnxi/RG1NJQ7mTJx21I a2cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3p7ZQxDsqAw6bxRKCsTTKpFTwnHOWTrmwbcNce8gSD0=; b=e75KQmWWzHc597ZaNYtmqaZzM0r6IpAwVs0rvLm/6oQtUFNh17CGBV+mtenl+7uaT+ FU42+MuXd94xWutmsV6RFV8cN3VhQ4YeLTlIe8OvOIX+YxPcpZQdJpUxifi5BG3cp0DO xwN991GEZzLI6kWThtiZGLD4DTE4jQilYSjXrkSYYjZRAmcp3sOyCnLkWwttTK3/M7AU 7ED+rB37kwgyOS/8H2tM8yrAGA+H8s+JsWNWQKM2Tt/UHWe5o7vptW6CRP/5vmIvIz6o +P8wBZdoqSP8Zm/nSPqZyIcP+HQMsRa+5eSDB3RqZ946unEVFctbrEoZAIUlk5Wbm+xO yW8w== X-Gm-Message-State: AOAM530PVx0TG9OZQb9ZesiMNrP1qGWv1QrVZB4zk1ZyYnxYm9wveYTQ bIvaTxc8EYne9m0mK0Hdadw= X-Google-Smtp-Source: ABdhPJwmht5srHkaTBLjOCr2Ce2Xe22jTAEZQo7y4UlcZf5gkxKXM5zk7Ce/DGTX6LLjYHYrZk6MDw== X-Received: by 2002:a50:ee87:: with SMTP id f7mr93706702edr.355.1594646569663; Mon, 13 Jul 2020 06:22:49 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:22:49 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org Subject: [RFC PATCH 09/35] nvme-pci: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:21 +0200 Message-Id: <20200713122247.10985-10-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- drivers/nvme/host/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index b1d18f0633c7..d426efb53f44 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1185,7 +1185,7 @@ static void nvme_warn_reset(struct nvme_dev *dev, u32 csts) result = pci_read_config_word(to_pci_dev(dev->dev), PCI_STATUS, &pci_status); - if (result == PCIBIOS_SUCCESSFUL) + if (result == 0) dev_warn(dev->ctrl.device, "controller is down; will reset: CSTS=0x%x, PCI_STATUS=0x%hx\n", csts, pci_status); From patchwork Mon Jul 13 12:22:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327961 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=oDiXLMMy; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B548J6DJkz9sSt for ; Mon, 13 Jul 2020 23:22:56 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729924AbgGMNWx (ORCPT ); Mon, 13 Jul 2020 09:22:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729919AbgGMNWw (ORCPT ); Mon, 13 Jul 2020 09:22:52 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B0F3C061755; Mon, 13 Jul 2020 06:22:52 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id w6so17135306ejq.6; Mon, 13 Jul 2020 06:22:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pbRPI5T6+CQlcjE3Ve13l43uBQozAmlKN702iYI4+CA=; b=oDiXLMMy3B0TEHpeLRAA8vNGcLzfduiAQ+QAJdNsEevV2wQyULi7h1rsVLBU0QBd8y 4LjXS26jKI0uEsMZ3UdV/cg+efVFpxA8EO0JRJtvjwrfx9wDZNmSEAkJedi2rmcmkC6H IrZ0p9UJ3D8udE+6aKJUN/HcHK/A5s+unm9YnDwz/kgjWAY0+6+vxGd4t9UQUf2g0TmK gP/D4CB0DB+UwLz0Pn0O0iHxIM6U8KNLOmW6Kt5dW5DyPHBZqcrUWBZRRCIMAcxoUPBb CaIinXEHJ1jIAy4Z+NwSNDbb1xsx4djmFhPfF2P68dm1y6syHOuz+H/xwyqAifzy/izP Q7OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pbRPI5T6+CQlcjE3Ve13l43uBQozAmlKN702iYI4+CA=; b=iWVEICT2IPrayVtBvTqdIzLZ0WWle67cp2IjvypAsbzDt6GGq+9p5A8vH6pe1KgICt 2hMMrMUvZMEmNn07OtWWY9paIxUsZgHpd6UX3st6pIk2o4GVADkEZo07bZiWHf+tLjgh 9jRWtSeaMSKKsMCNcZHIqLStcjzl9m/Ink5/UuCLvDoxku9uF0z7uaW/hhR76eBTNCXD oKKBb+H9Jil7F3J9XpYLgnKS/9Msy1nTf9qyBm9yVvN4REBT6EgSJn3OvpJ5fzn6tNoN TUnRzT2sHyLgzB+vEqmt79ED8RWHhvwUmKJhNaT/O1DarcvwTBrxh76FnEkwD2FXQTFn kRMg== X-Gm-Message-State: AOAM533V15iEqe275HrRuFymWZzIyb6BZ3yzNnO/AkCD98vXimDWXIW6 fmhkAboFWcVg+wdHK5vzVjc= X-Google-Smtp-Source: ABdhPJzLFoiuIquHARFKdvDNBo7G8zRr4UNzS9o5abkca8STc4RB8fWWh2+zFSwtRcAtOf/6bGWDbA== X-Received: by 2002:a17:906:cd19:: with SMTP id oz25mr72103030ejb.36.1594646570989; Mon, 13 Jul 2020 06:22:50 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:22:50 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org Subject: [RFC PATCH 10/35] nvme-pci: Tidy Success/Failure checks Date: Mon, 13 Jul 2020 14:22:22 +0200 Message-Id: <20200713122247.10985-11-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unnecessary check for 0. Signed-off-by: "Saheed O. Bolarinwa" --- This patch depends on PATCH 09/35 drivers/nvme/host/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index d426efb53f44..a04f2d0375de 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1185,7 +1185,7 @@ static void nvme_warn_reset(struct nvme_dev *dev, u32 csts) result = pci_read_config_word(to_pci_dev(dev->dev), PCI_STATUS, &pci_status); - if (result == 0) + if (!result) dev_warn(dev->ctrl.device, "controller is down; will reset: CSTS=0x%x, PCI_STATUS=0x%hx\n", csts, pci_status); From patchwork Mon Jul 13 12:22:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=QT0ftuJU; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54Bs34Hjz9sSd for ; Mon, 13 Jul 2020 23:25:09 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729593AbgGMNZH (ORCPT ); Mon, 13 Jul 2020 09:25:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729925AbgGMNWy (ORCPT ); Mon, 13 Jul 2020 09:22:54 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9684EC061755; Mon, 13 Jul 2020 06:22:53 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id ga4so17129006ejb.11; Mon, 13 Jul 2020 06:22:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xIWj0P8al909J+4pBE5o44qtYmVuYzVtW9yKrCNUaw0=; b=QT0ftuJUMnvN9L1yGVRJDjEK3qSZdoXJXBN5DYl7jyWso++THIIOuHpbc17F/zrosi 8AuTgvAPKXfSy6z4977e3BRxPajXTXDMS4RXeyVTILawt6WgXpY//f2djyt/UkJQGRzk /gdGnf3M/3rld4z29OqilvjBcL0gyasTI6OnKfGjeReyQglVGg+YQe+xr3g3vN2ZXmuT H3K8zDE9spjbeXT5VJ615ifyAxorGrxgxDGJjtr2u9GrRuD3j9OL7Xjkb7TwOPORQmqL TfhNmfHAyI3xoFlBuZ/xKOOKE0n/7YMZrCkoDpUABaGXyhlEEpPzVsxCBXEJHjxWIgoV ZxEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xIWj0P8al909J+4pBE5o44qtYmVuYzVtW9yKrCNUaw0=; b=D/offut8vk+96+14HCrsAaIA0wi0HtAAGM/PehE7LImuNEbIi8C8qiZnsXTnfiWStF IDcIdvD8/UgUphb3+M/VjP1JEYJhig2m/JGrN0zvhDyIYpkEMc3ywK6unF/nlp9Hg8+t eoJiF17w1kA/+SQYSAovK4LFejk3l8mCMv49w39dj+J9CIBZtE9DPJ2G4v7mNLUSOuxj eHbohz7Pt7NaevAxtIjObDIa03Wbm8IddLQUHek/RS5V8JVTZygBOSDNIDvo0XtiyvLH NZ+PSZjwBO57NIsbKDmWt/QE9DhBvmOqd4DiNpdQ49o9ZMJyjRAO4JY39wzkN3rFItaS 9MMA== X-Gm-Message-State: AOAM5334fK8Mml+Ny8lmhc5OXdi36trIR8gSHCkvtqftRpz+Y5AfosB3 4hBlPYseVhtdvjct21tzseo= X-Google-Smtp-Source: ABdhPJxAfEv30rbnDL4uWXY7GIMGij0pMiiCWfpa5ktuZKtBwYpOGp8E6A1+3fdVVGoX3cC+gtFk5Q== X-Received: by 2002:a17:906:f53:: with SMTP id h19mr71418351ejj.491.1594646572377; Mon, 13 Jul 2020 06:22:52 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:22:51 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Realtek linux nic maintainers , Heiner Kallweit , "David S. Miller" , Jakub Kicinski , Russell King Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [RFC PATCH 11/35] r8169: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:23 +0200 Message-Id: <20200713122247.10985-12-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- drivers/net/ethernet/realtek/r8169_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index b660ddbe4025..206dac958cb2 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -2656,7 +2656,7 @@ static void rtl_csi_access_enable(struct rtl8169_private *tp, u8 val) * first and if it fails fall back to CSI. */ if (pdev->cfg_size > 0x070f && - pci_write_config_byte(pdev, 0x070f, val) == PCIBIOS_SUCCESSFUL) + pci_write_config_byte(pdev, 0x070f, val) == 0) return; netdev_notice_once(tp->dev, From patchwork Mon Jul 13 12:22:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327992 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=kMSP5L5F; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54Bm389lz9sSd for ; Mon, 13 Jul 2020 23:25:04 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729874AbgGMNZA (ORCPT ); Mon, 13 Jul 2020 09:25:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729927AbgGMNWz (ORCPT ); Mon, 13 Jul 2020 09:22:55 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C3C3C061794; Mon, 13 Jul 2020 06:22:55 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id p20so17106900ejd.13; Mon, 13 Jul 2020 06:22:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4mtRlJQaHePxtEmxgJ4wlQxNn5L43q/Zka7616zruI8=; b=kMSP5L5Flpc6NQRlZYtnLBolHIuDM831m9PhJvg2LNyM/twJSV5iJ8UbM+6MQsdE5M CLml5IDPqOPYg6ZN757vdGZAeRzeO8W4v9K37fUtLv49qnF2JfdQKGdreBg10qenXt7f brY7Xfw8BL3Hiq4f+z4Ak0QDisXul8aNqNa1gbx8IfSJDXUB4GS7hj3jucg2WpedWTIp 6t21q38GNrpKaAwB7fXFVRrY9h0regwcQxnbtdfMUz5GL4WX5ij2p1/Q+NVL76aXremr WqFYo+vasH+aRxaKKYbzhnAMuMyWzWEAL0HKxZnL226nb5mt6T8dUWFj3y7//RY8J7ss bigQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4mtRlJQaHePxtEmxgJ4wlQxNn5L43q/Zka7616zruI8=; b=C2K40KXlO4OTFKOjMPDkSVk63FNMIz4kEq3xmHaPzJz/xruc9LAONSP8vLtUEW8jPs x3udjglnNgI4QTRto0+jR7WpGxkewmkPcM8Si4B5Tkl3Ok7VspdEw4xDmTkumLFcGoEi GhzjEvjEK7/96oQg+lyK26YRyDUPciL9h+1LnpFkh26oukNhDaD4M8qqBgtTDcMx/mXH 0qDYfV9iL/fi+y7aD16M/zBaha4WVhu6AtEUlHN9MXtcJA3PGBIA5nXHBwoOg9HATcUI wl8ufPfMqqkT60OTlfF7cavGMpPSLyZBbV/dY7U1OPhaNotznlT9Pd9lb/KOg2bWMpul XSUw== X-Gm-Message-State: AOAM530KpbpzkzinnEBtmL01bN6antQFu/AinXLUYvT0CmJ9TEFBsT/L IaQR15eHvh9WgHyxPd5QVo3f4BFgScCLPQ== X-Google-Smtp-Source: ABdhPJxBg6NeDOYmyTW5DNO1P5saMhEnmdJjfVEe5tJAB3i+dRIhgcPYOfBUSf1/IW9C6Yjeq+b0UQ== X-Received: by 2002:a17:906:2b52:: with SMTP id b18mr75601756ejg.158.1594646573741; Mon, 13 Jul 2020 06:22:53 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:22:53 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Realtek linux nic maintainers , Heiner Kallweit , "David S. Miller" , Jakub Kicinski , Russell King Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [RFC PATCH 12/35] r8169: Tidy Success/Failure checks Date: Mon, 13 Jul 2020 14:22:24 +0200 Message-Id: <20200713122247.10985-13-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unnecessary check for 0. Signed-off-by: "Saheed O. Bolarinwa" --- This patch depends on PATCH 11/35 drivers/net/ethernet/realtek/r8169_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 206dac958cb2..79edbc0c4476 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -2656,7 +2656,7 @@ static void rtl_csi_access_enable(struct rtl8169_private *tp, u8 val) * first and if it fails fall back to CSI. */ if (pdev->cfg_size > 0x070f && - pci_write_config_byte(pdev, 0x070f, val) == 0) + !pci_write_config_byte(pdev, 0x070f, val)) return; netdev_notice_once(tp->dev, From patchwork Mon Jul 13 12:22:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327962 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=FTWOqfbp; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B548M514Qz9sRN for ; Mon, 13 Jul 2020 23:22:59 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729919AbgGMNW6 (ORCPT ); Mon, 13 Jul 2020 09:22:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729934AbgGMNW5 (ORCPT ); Mon, 13 Jul 2020 09:22:57 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58D2CC08C5DB; Mon, 13 Jul 2020 06:22:56 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id rk21so17148738ejb.2; Mon, 13 Jul 2020 06:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DdekBSMp1R6DMOi8Ubgu/NKkVYPxPUhZ+i21xkvtPe8=; b=FTWOqfbply9IuxFuX4WbClT+NDxhwIxjM5Ro3JMMJvWUF/qmT2QqYgn9mPlI4ZQhXi v2c89Y7pRNNIkGHanZbWp714th0k6d/h/SqBbsn+TQXTvtHl1WfGUK+WeRAROyk9zne2 GtYuFQG89vv7dtXuHtwkzzKJDhwHfvwWHwTbjCOUd9cUdw41wUN78Ov22kBOR8YHFYQ5 wrBmxb1+4kdpnw2QV/j7UQp6iZ+bvCdiStFmNnTvD3pP+jCsVYww9Dxnz3+0lznY6oNv 4kZM5mNHRH1z1WUnoN3xGqKrYKvdrXbBTYmFSue4FHdg/I3vdUFls2hkGjyHozP9urHc yikA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DdekBSMp1R6DMOi8Ubgu/NKkVYPxPUhZ+i21xkvtPe8=; b=Hb66iLzcPP5/VN/JkQf0oHFgTnJE6iguXdh4t5DZ6iB7KtIY3P8fZB6iWD0QQUqHPT r1057jW4kzk70Wetq0VQmMKyFYJF4x2tGcHqyEDbwhqulE2RIfjBpkdlxfYc8rwA1pNT qhXIIHLKQe6Z17e+ha4q2YY37pWR14M5F3ADolIu3lFwIFpbjzLVyLR0Yrw6OVa47ewx D3QKpbAY83Nm6wBmo/DsB1L96LMAqvglFeajQk55cOUiH9GxxiHkfx/leDVYE4N1v8wj KqyJzAEt+4TtL4Yt7sS4mIX/9uaw18MP3zIQK59LlY2eSrPZtGWQ0CIiJO9xHeocsOmO 0TjQ== X-Gm-Message-State: AOAM532CrijCQKWeWHNsopkjCFie0C4Vvlhj2wEXZSl7ztulhij3a48l uigWF7P1RSJl8HgyhzUbsKU= X-Google-Smtp-Source: ABdhPJwlZKUK04d4vumCE1XKJSvgTpI1XxdiZZmiZ06iFJo6g09xUAqwOaAm7kBfWxZHFEZ22od4hg== X-Received: by 2002:a17:906:6606:: with SMTP id b6mr77145046ejp.102.1594646575134; Mon, 13 Jul 2020 06:22:55 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:22:54 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Frederic Barrat , Andrew Donnellan , Arnd Bergmann , Greg Kroah-Hartman Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [RFC PATCH 13/35] cxl: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:25 +0200 Message-Id: <20200713122247.10985-14-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. There scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- drivers/misc/cxl/vphb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/cxl/vphb.c b/drivers/misc/cxl/vphb.c index 1cf320e2a415..1264253cc07b 100644 --- a/drivers/misc/cxl/vphb.c +++ b/drivers/misc/cxl/vphb.c @@ -150,7 +150,7 @@ static int cxl_pcie_read_config(struct pci_bus *bus, unsigned int devfn, out: cxl_afu_configured_put(afu); - return rc ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; + return rc ? PCIBIOS_DEVICE_NOT_FOUND : 0; } static int cxl_pcie_write_config(struct pci_bus *bus, unsigned int devfn, @@ -184,7 +184,7 @@ static int cxl_pcie_write_config(struct pci_bus *bus, unsigned int devfn, out: cxl_afu_configured_put(afu); - return rc ? PCIBIOS_SET_FAILED : PCIBIOS_SUCCESSFUL; + return rc ? PCIBIOS_SET_FAILED : 0; } static struct pci_ops cxl_pcie_pci_ops = From patchwork Mon Jul 13 12:22:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327991 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=fRAKL+ar; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54Bk5TkBz9sTh for ; Mon, 13 Jul 2020 23:25:02 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729934AbgGMNYy (ORCPT ); Mon, 13 Jul 2020 09:24:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729937AbgGMNW6 (ORCPT ); Mon, 13 Jul 2020 09:22:58 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10A94C061755; Mon, 13 Jul 2020 06:22:58 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id bm28so11680279edb.2; Mon, 13 Jul 2020 06:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SZWhEQhdAshrEKOg1OdeBySM/iJl7P0u/Wtd+OUZgXk=; b=fRAKL+ar0mP3quTtvn/VpmyE8ofupZbeB8r47gxq5b/gxvL3G1VqC9LYDGni8Tlx5I 0qsw3fcJ+cb5IZKC4h24+hvVIbdMcms3VyUgaBvoAaECnfjkgmnLIHQHjTIBMriAiTlY 3akPM+5JCmyP+/gaM3gU5ANiOKopU6jAzN/DU2LtxeAXgN49CQ3umiX8APk8D3hUIrLx kVYrJttsCfxDIsqUozcJwuNsipxmBfwFIKackKL08Am03KDZnQQw2R9aM+I9ePyvdhoq zgwreYm3Ofx6rpfGKucbI3B/AWhLiaTD9EPIf9zTJkR/J+jjAzees1l65pkjG6gNZ+u5 fwZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SZWhEQhdAshrEKOg1OdeBySM/iJl7P0u/Wtd+OUZgXk=; b=ESvmr0z7PcnfAcxZI3wVhP6EEtNV9k+kH9juwztWVrJEmxK4Ci+X4rGPyLvJKDSXM3 VXLA8ocSE3uX+pTD918cQWGEoaD1ve/wic/aRhcHPIG5zzElbbkZmmzIU916ldRaC1av uWqAKBCxI1vYAKXFP5yqykqQAl8lmji/fU7i5kXhbJMBa8qz96vqR8hulYCtZgPNvnhv HJztgWMZ6reLmQXl/0MG+JoHFH9o9YDCvwgHaeK31pbRo9Tq6w09FTDp+lg3dy/hIj3c Yxez5meVqFA0Ohd5cA3waFF6WSwO28Qez432PZFkN9lcdAY/LODDu4gmjnrJnM/fxv1W wWoQ== X-Gm-Message-State: AOAM53057kAtGRxaGO/+Bqw5OwVb6Vk0MupSd/g6FDQlALpib12gbC7w Jt1SqgzKggj5QFEJjRfoerY= X-Google-Smtp-Source: ABdhPJxjSkM06k8pRCUPzMRpx17h5RlpCmZfRWCd5RkykmrcYELKqDznF5j3XGqTDyeV2adZguE47A== X-Received: by 2002:aa7:c341:: with SMTP id j1mr95061530edr.197.1594646576666; Mon, 13 Jul 2020 06:22:56 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:22:55 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Jean Delvare Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org Subject: [RFC PATCH 14/35] i2c/busses: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:26 +0200 Message-Id: <20200713122247.10985-15-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- drivers/i2c/busses/i2c-ali15x3.c | 4 ++-- drivers/i2c/busses/i2c-nforce2.c | 2 +- drivers/i2c/busses/i2c-sis5595.c | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/i2c/busses/i2c-ali15x3.c b/drivers/i2c/busses/i2c-ali15x3.c index 02185a1cfa77..359ee3e0864a 100644 --- a/drivers/i2c/busses/i2c-ali15x3.c +++ b/drivers/i2c/busses/i2c-ali15x3.c @@ -167,11 +167,11 @@ static int ali15x3_setup(struct pci_dev *ALI15X3_dev) if(force_addr) { dev_info(&ALI15X3_dev->dev, "forcing ISA address 0x%04X\n", ali15x3_smba); - if (PCIBIOS_SUCCESSFUL != pci_write_config_word(ALI15X3_dev, + if (0 != pci_write_config_word(ALI15X3_dev, SMBBA, ali15x3_smba)) goto error; - if (PCIBIOS_SUCCESSFUL != pci_read_config_word(ALI15X3_dev, + if (0 != pci_read_config_word(ALI15X3_dev, SMBBA, &a)) goto error; if ((a & ~(ALI15X3_SMB_IOSIZE - 1)) != ali15x3_smba) { diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c index 777278386f58..385f4f446f36 100644 --- a/drivers/i2c/busses/i2c-nforce2.c +++ b/drivers/i2c/busses/i2c-nforce2.c @@ -328,7 +328,7 @@ static int nforce2_probe_smb(struct pci_dev *dev, int bar, int alt_reg, u16 iobase; if (pci_read_config_word(dev, alt_reg, &iobase) - != PCIBIOS_SUCCESSFUL) { + != 0) { dev_err(&dev->dev, "Error reading PCI config for %s\n", name); return -EIO; diff --git a/drivers/i2c/busses/i2c-sis5595.c b/drivers/i2c/busses/i2c-sis5595.c index c793a5c14cda..fbe3ee31eae3 100644 --- a/drivers/i2c/busses/i2c-sis5595.c +++ b/drivers/i2c/busses/i2c-sis5595.c @@ -176,10 +176,10 @@ static int sis5595_setup(struct pci_dev *SIS5595_dev) if (force_addr) { dev_info(&SIS5595_dev->dev, "forcing ISA address 0x%04X\n", sis5595_base); if (pci_write_config_word(SIS5595_dev, ACPI_BASE, sis5595_base) - != PCIBIOS_SUCCESSFUL) + != 0) goto error; if (pci_read_config_word(SIS5595_dev, ACPI_BASE, &a) - != PCIBIOS_SUCCESSFUL) + != 0) goto error; if ((a & ~(SIS5595_EXTENT - 1)) != sis5595_base) { /* doesn't work for some chips! */ @@ -189,15 +189,15 @@ static int sis5595_setup(struct pci_dev *SIS5595_dev) } if (pci_read_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, &val) - != PCIBIOS_SUCCESSFUL) + != 0) goto error; if ((val & 0x80) == 0) { dev_info(&SIS5595_dev->dev, "enabling ACPI\n"); if (pci_write_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, val | 0x80) - != PCIBIOS_SUCCESSFUL) + != 0) goto error; if (pci_read_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, &val) - != PCIBIOS_SUCCESSFUL) + != 0) goto error; if ((val & 0x80) == 0) { /* doesn't work for some chips? */ From patchwork Mon Jul 13 12:22:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327988 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=R7fqTYEe; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54BW2BXWz9sTh for ; Mon, 13 Jul 2020 23:24:51 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729947AbgGMNXB (ORCPT ); Mon, 13 Jul 2020 09:23:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729941AbgGMNW7 (ORCPT ); Mon, 13 Jul 2020 09:22:59 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69FE8C061794; Mon, 13 Jul 2020 06:22:59 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id lx13so17142431ejb.4; Mon, 13 Jul 2020 06:22:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tczYCFdS3/cJq1nOdmzHC0tWFoQ+QsE/iL94vlXviGU=; b=R7fqTYEesFmsZR8cnid/s+sdOfqo+j8ibuFpW6vdh+YRJ4gFsdHihYvV7hMXEzRzNr rK3uboChKJI7yf3viTPCBaYKlheR1K2wc/wMdcX2HSqtpwuBxu0tebqqqOOIoKKpgx+5 D1VNntZQRD0d3UDkQBYV52zN2qtwENMN+7O/Cj0Z8NSmPYtH8UubaeaauJJT/6ouVBrc Po7kfwVfE7DiPOIjQ8rutCzl81VQLaiFYGVNDSkVvGAXzwIBy0aS8DQ9g2JYwc0wl8iq hy/o1FYEnUYXOAKctA5QN4uPHAoi9IVixu+b57RxQJcYwxUljfR7YDA2zk5ew9UqaIUv J43g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tczYCFdS3/cJq1nOdmzHC0tWFoQ+QsE/iL94vlXviGU=; b=GZZeEIUgL7clR1Gpq7RL0h+xP5EYqjF3zDndw8WHyTxKEtP/FjLpkikVR15NGCjUE/ MVlwjZJ6U65uoh576mKPsKN6hI3zu4MWBxHf/z/f5cVbh5MOGNQY0wF7LStclUemWtZn fv8NOI00wqwU7q87bMQieGm8g/Zzr2tWruifbivsWTxim6/VHeJrOpp/jccUr4JlO2m0 VuHY73FIY4rXtCiKuR7UMOypizCUhVTUsL2L852ghvk4i542xovtzXpT5HohWlxjmTgX WWJH32nkcr1wIEB0NS5jG1XT+tfPVjZeWN2pLu3gZZnMmOQlB5eWX9fsx4NBykPn4gy9 HBfw== X-Gm-Message-State: AOAM531lcjTvnfPb/t4C+/YE2fmqThdrmXdkaQhWJNS3ZNmTwyIxI9Dy BqLp+5RB5f1RY9lnmbk8EEg= X-Google-Smtp-Source: ABdhPJyi7kdKnWKidhuD/7S0rUnuO695mifL4kwQQRb/qclwiEU741xbCG8OqefW8KfutA+tJMt2Xg== X-Received: by 2002:a17:906:ef2:: with SMTP id x18mr71342560eji.547.1594646578134; Mon, 13 Jul 2020 06:22:58 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:22:57 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Jean Delvare Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org Subject: [RFC PATCH 15/35] i2c/busses: Tidy Success/Failure checks Date: Mon, 13 Jul 2020 14:22:27 +0200 Message-Id: <20200713122247.10985-16-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unnecessary check for 0. Signed-off-by: "Saheed O. Bolarinwa" --- This patch depends on PATCH 15/35 drivers/i2c/busses/i2c-ali15x3.c | 5 ++--- drivers/i2c/busses/i2c-nforce2.c | 3 +-- drivers/i2c/busses/i2c-sis5595.c | 15 +++++---------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/i2c/busses/i2c-ali15x3.c b/drivers/i2c/busses/i2c-ali15x3.c index 359ee3e0864a..c9e779cc184e 100644 --- a/drivers/i2c/busses/i2c-ali15x3.c +++ b/drivers/i2c/busses/i2c-ali15x3.c @@ -167,11 +167,10 @@ static int ali15x3_setup(struct pci_dev *ALI15X3_dev) if(force_addr) { dev_info(&ALI15X3_dev->dev, "forcing ISA address 0x%04X\n", ali15x3_smba); - if (0 != pci_write_config_word(ALI15X3_dev, - SMBBA, + if (pci_write_config_word(ALI15X3_dev, SMBBA, ali15x3_smba)) goto error; - if (0 != pci_read_config_word(ALI15X3_dev, + if (pci_read_config_word(ALI15X3_dev, SMBBA, &a)) goto error; if ((a & ~(ALI15X3_SMB_IOSIZE - 1)) != ali15x3_smba) { diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c index 385f4f446f36..54d2985b7aaf 100644 --- a/drivers/i2c/busses/i2c-nforce2.c +++ b/drivers/i2c/busses/i2c-nforce2.c @@ -327,8 +327,7 @@ static int nforce2_probe_smb(struct pci_dev *dev, int bar, int alt_reg, /* Older incarnations of the device used non-standard BARs */ u16 iobase; - if (pci_read_config_word(dev, alt_reg, &iobase) - != 0) { + if (pci_read_config_word(dev, alt_reg, &iobase)) { dev_err(&dev->dev, "Error reading PCI config for %s\n", name); return -EIO; diff --git a/drivers/i2c/busses/i2c-sis5595.c b/drivers/i2c/busses/i2c-sis5595.c index fbe3ee31eae3..b016f48519d3 100644 --- a/drivers/i2c/busses/i2c-sis5595.c +++ b/drivers/i2c/busses/i2c-sis5595.c @@ -175,11 +175,9 @@ static int sis5595_setup(struct pci_dev *SIS5595_dev) if (force_addr) { dev_info(&SIS5595_dev->dev, "forcing ISA address 0x%04X\n", sis5595_base); - if (pci_write_config_word(SIS5595_dev, ACPI_BASE, sis5595_base) - != 0) + if (pci_write_config_word(SIS5595_dev, ACPI_BASE, sis5595_base)) goto error; - if (pci_read_config_word(SIS5595_dev, ACPI_BASE, &a) - != 0) + if (pci_read_config_word(SIS5595_dev, ACPI_BASE, &a)) goto error; if ((a & ~(SIS5595_EXTENT - 1)) != sis5595_base) { /* doesn't work for some chips! */ @@ -188,16 +186,13 @@ static int sis5595_setup(struct pci_dev *SIS5595_dev) } } - if (pci_read_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, &val) - != 0) + if (pci_read_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, &val)) goto error; if ((val & 0x80) == 0) { dev_info(&SIS5595_dev->dev, "enabling ACPI\n"); - if (pci_write_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, val | 0x80) - != 0) + if (pci_write_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, val | 0x80)) goto error; - if (pci_read_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, &val) - != 0) + if (pci_read_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, &val)) goto error; if ((val & 0x80) == 0) { /* doesn't work for some chips? */ From patchwork Mon Jul 13 12:22:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327989 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=IFgUkHYU; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54BW720fz9sSd for ; Mon, 13 Jul 2020 23:24:51 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730193AbgGMNYu (ORCPT ); Mon, 13 Jul 2020 09:24:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729934AbgGMNXB (ORCPT ); Mon, 13 Jul 2020 09:23:01 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C03ADC061755; Mon, 13 Jul 2020 06:23:00 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id bm28so11680454edb.2; Mon, 13 Jul 2020 06:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wedHCIChLPI3W8eJR45NkujB6S4xOXi2tVCNNo2QC2g=; b=IFgUkHYUyQ5yQAzQIlZ+QKHSWJi9aV4DKXkMTpCLI8tz4cQXE4ag3ugFeOcFKQDAyg EWa9qIrHkYxPAJMSO1gtMhCpe4qELsErSvppuGNJeWxNdWzvDhTiuvD3oVrtf/NAydtg MMLlkhS/HPlMjHrJlNIMh2U1vizkVtujUJ2nmM5X4BuI9pCfdNmVNOFQR4NYYZYsC9/4 sHf+92UmiYhr5XXjzOV0iy3+CXdhk5s1srXZ8SsGqDwta9X7ukdKtB4sJM3DiCjYV3vO z6r3AXhLllgg51T6aLGw2V2K7xpabsbgWOYO39XhFApMzMcWe3gwJclj1XZKAsYJ5ncU gY1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wedHCIChLPI3W8eJR45NkujB6S4xOXi2tVCNNo2QC2g=; b=UF3glH2OseE0PRxdhlnfheU7WN/QnOa/OSngRIHuWVMlLcLw4znb/rFLyAOuanNguY yzO1BKaehXlmwRgkrpUE780L//4JBMjRc/EeleMfrjzPvcnYwakYUocAWWdwKCy8hB9/ 72QWnopFImfWhNn+mjNTPk4Jok5sONow6P8hKyWjCSSBKKl+965Jrefl8noW/GqlM06E JsZ4vcV689vpkku9y0t92kYI+DbszLyMUqKMPbY9J3fc3rx6mJ3pDFBzQUpZmMSgjIO7 YDw78rVY5hXztQ0OYR6jPW044MpUfhqz6YhoM5fP6UeJEIId+v2mv3sG1VWnjq7AUNY1 /iYQ== X-Gm-Message-State: AOAM533V+e/0P0Rt3tNGR9G64zaQhnCBxABy9a5eBhNmNJDx/0VsJRUr hZ+f5rzSrIjigJIB3gjCzoY= X-Google-Smtp-Source: ABdhPJz3+R8EMDUd8r+h17AEUUENNjntQ7SKL3N/QarL0j05KmXQg0LEb8ICq9q0/JqFa1l7NL7ZDg== X-Received: by 2002:aa7:c504:: with SMTP id o4mr89798702edq.311.1594646579546; Mon, 13 Jul 2020 06:22:59 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:22:59 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Jean Delvare , Guenter Roeck Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org Subject: [RFC PATCH 16/35] hwmon: (sis5595) Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:28 +0200 Message-Id: <20200713122247.10985-17-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- drivers/hwmon/sis5595.c | 8 ++++---- drivers/hwmon/via686a.c | 8 ++++---- drivers/hwmon/vt8231.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/hwmon/sis5595.c b/drivers/hwmon/sis5595.c index 0c6741f949f5..0ea174fb3048 100644 --- a/drivers/hwmon/sis5595.c +++ b/drivers/hwmon/sis5595.c @@ -825,7 +825,7 @@ static int sis5595_pci_probe(struct pci_dev *dev, pci_write_config_word(dev, SIS5595_BASE_REG, force_addr); } - if (PCIBIOS_SUCCESSFUL != + if (0 != pci_read_config_word(dev, SIS5595_BASE_REG, &address)) { dev_err(&dev->dev, "Failed to read ISA address\n"); return -ENODEV; @@ -843,16 +843,16 @@ static int sis5595_pci_probe(struct pci_dev *dev, return -ENODEV; } - if (PCIBIOS_SUCCESSFUL != + if (0 != pci_read_config_byte(dev, SIS5595_ENABLE_REG, &enable)) { dev_err(&dev->dev, "Failed to read enable register\n"); return -ENODEV; } if (!(enable & 0x80)) { - if ((PCIBIOS_SUCCESSFUL != + if ((0 != pci_write_config_byte(dev, SIS5595_ENABLE_REG, enable | 0x80)) - || (PCIBIOS_SUCCESSFUL != + || (0 != pci_read_config_byte(dev, SIS5595_ENABLE_REG, &enable)) || (!(enable & 0x80))) { /* doesn't work for some chips! */ diff --git a/drivers/hwmon/via686a.c b/drivers/hwmon/via686a.c index a2eddd2c2538..cffea688878f 100644 --- a/drivers/hwmon/via686a.c +++ b/drivers/hwmon/via686a.c @@ -863,11 +863,11 @@ static int via686a_pci_probe(struct pci_dev *dev, if (force_addr) { address = force_addr & ~(VIA686A_EXTENT - 1); dev_warn(&dev->dev, "Forcing ISA address 0x%x\n", address); - if (PCIBIOS_SUCCESSFUL != + if (0 != pci_write_config_word(dev, VIA686A_BASE_REG, address | 1)) return -ENODEV; } - if (PCIBIOS_SUCCESSFUL != + if (0 != pci_read_config_word(dev, VIA686A_BASE_REG, &val)) return -ENODEV; @@ -878,7 +878,7 @@ static int via686a_pci_probe(struct pci_dev *dev, return -ENODEV; } - if (PCIBIOS_SUCCESSFUL != + if (0 != pci_read_config_word(dev, VIA686A_ENABLE_REG, &val)) return -ENODEV; if (!(val & 0x0001)) { @@ -890,7 +890,7 @@ static int via686a_pci_probe(struct pci_dev *dev, } dev_warn(&dev->dev, "Enabling sensors\n"); - if (PCIBIOS_SUCCESSFUL != + if (0 != pci_write_config_word(dev, VIA686A_ENABLE_REG, val | 0x0001)) return -ENODEV; diff --git a/drivers/hwmon/vt8231.c b/drivers/hwmon/vt8231.c index 2335d440f72d..cc1d24c2a2c8 100644 --- a/drivers/hwmon/vt8231.c +++ b/drivers/hwmon/vt8231.c @@ -987,12 +987,12 @@ static int vt8231_pci_probe(struct pci_dev *dev, dev_warn(&dev->dev, "Forcing ISA address 0x%x\n", address); - if (PCIBIOS_SUCCESSFUL != + if (0 != pci_write_config_word(dev, VT8231_BASE_REG, address | 1)) return -ENODEV; } - if (PCIBIOS_SUCCESSFUL != pci_read_config_word(dev, VT8231_BASE_REG, + if (0 != pci_read_config_word(dev, VT8231_BASE_REG, &val)) return -ENODEV; @@ -1002,13 +1002,13 @@ static int vt8231_pci_probe(struct pci_dev *dev, return -ENODEV; } - if (PCIBIOS_SUCCESSFUL != pci_read_config_word(dev, VT8231_ENABLE_REG, + if (0 != pci_read_config_word(dev, VT8231_ENABLE_REG, &val)) return -ENODEV; if (!(val & 0x0001)) { dev_warn(&dev->dev, "enabling sensors\n"); - if (PCIBIOS_SUCCESSFUL != + if (0 != pci_write_config_word(dev, VT8231_ENABLE_REG, val | 0x0001)) return -ENODEV; From patchwork Mon Jul 13 12:22:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327981 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=va14DwSp; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54BC5q9bz9sSd for ; Mon, 13 Jul 2020 23:24:35 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729965AbgGMNXF (ORCPT ); Mon, 13 Jul 2020 09:23:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729952AbgGMNXC (ORCPT ); Mon, 13 Jul 2020 09:23:02 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 234E9C061755; Mon, 13 Jul 2020 06:23:02 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id ga4so17129725ejb.11; Mon, 13 Jul 2020 06:23:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WeyIeoPZJMXK7vhLHL5c0YV2wwYi5JPUEFrxzTX8RvU=; b=va14DwSpJTk8Hv73zRY2TzzhxmZEFmEKBsfKXWnt/tzVTOr74i7qtpDWIp4vmQMCAk wxYB0bW9tYz22zJj8OOtOi6N6bWeBzWo3lSiWKmps+V96kj1qxSE3QFi9C2Gzqd5YZaX 6cOeVRPEPWamg1UBvZrCC3b9/xKGFeZ/lvllDTgYQ67sZ6eseA6VrCI4nMR9ipMAdB5V 8IjA/EOJGUyLhipxOaXpWCoZTwBGBotZf2uFyOnPyLWJMxn4IAzBLMREPrQdOH3U+WJK Lo/IdoSaucGHkIZCHDI2TlTI3UEyeqroXs5xoA5KQ2KdyUlT+5/nUpNxnknP4tFcEAJy jB2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WeyIeoPZJMXK7vhLHL5c0YV2wwYi5JPUEFrxzTX8RvU=; b=LGg7jsKXoaN+pSGau4pwB+fE4mRTgpbIYaSznKlPphSlWwFXGJG+gOQgLtI47bU+nI 39MH1Qwq6tcRw9WeKrC/L7NojJ5wIkG72YUqxVGzsQc8ebjhn7/Mc/RPspsYSahoZ0kO A2PwotGPL1+lccwWnkom4gQ9I97aw3+VBRfjQGlcViCVu1ejtlViHmaW9mcc0acQwBCj +gtDQ+rRSO5QQQ95Psee0F7jwo+d2/ffYCrTcOksKp8Vf4uflld6+VsMModbvXkvv8Bl JV/oNm+gBP3aVq5f8JICACaHbvbGmm5GchHlLsfLXoCO2hlXkAIphnAfXilhChJJbQkC sEkg== X-Gm-Message-State: AOAM531cOrjuGO8j92TLQY4S96Ul1MdFEHh5ghhgMLpc0Hf71NiipaAD MZwJpwI8Wa+pxm3nx4P1mrEvMrEtjiC+hQ== X-Google-Smtp-Source: ABdhPJwUjqmZeNSlCTAl57KxA+cutsVpR1kCU85dk+qzkHj4E1FjAK7/IQ+7zYeHb5tZSd31kCRd1A== X-Received: by 2002:a17:906:4dd4:: with SMTP id f20mr77156370ejw.170.1594646580813; Mon, 13 Jul 2020 06:23:00 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.22.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:00 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Jean Delvare , Guenter Roeck Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org Subject: [RFC PATCH 17/35] hwmon: (sis5595) Tidy Success/Failure checks Date: Mon, 13 Jul 2020 14:22:29 +0200 Message-Id: <20200713122247.10985-18-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unnecessary check for 0. Signed-off-by: "Saheed O. Bolarinwa" --- This patch depends on PATCH 16/35 drivers/hwmon/sis5595.c | 13 ++++--------- drivers/hwmon/via686a.c | 13 ++++--------- drivers/hwmon/vt8231.c | 13 ++++--------- 3 files changed, 12 insertions(+), 27 deletions(-) diff --git a/drivers/hwmon/sis5595.c b/drivers/hwmon/sis5595.c index 0ea174fb3048..91fdddaa4136 100644 --- a/drivers/hwmon/sis5595.c +++ b/drivers/hwmon/sis5595.c @@ -825,8 +825,7 @@ static int sis5595_pci_probe(struct pci_dev *dev, pci_write_config_word(dev, SIS5595_BASE_REG, force_addr); } - if (0 != - pci_read_config_word(dev, SIS5595_BASE_REG, &address)) { + if (pci_read_config_word(dev, SIS5595_BASE_REG, &address)) { dev_err(&dev->dev, "Failed to read ISA address\n"); return -ENODEV; } @@ -843,17 +842,13 @@ static int sis5595_pci_probe(struct pci_dev *dev, return -ENODEV; } - if (0 != - pci_read_config_byte(dev, SIS5595_ENABLE_REG, &enable)) { + if (pci_read_config_byte(dev, SIS5595_ENABLE_REG, &enable)) { dev_err(&dev->dev, "Failed to read enable register\n"); return -ENODEV; } if (!(enable & 0x80)) { - if ((0 != - pci_write_config_byte(dev, SIS5595_ENABLE_REG, - enable | 0x80)) - || (0 != - pci_read_config_byte(dev, SIS5595_ENABLE_REG, &enable)) + if ((pci_write_config_byte(dev, SIS5595_ENABLE_REG, enable | 0x80)) + || (pci_read_config_byte(dev, SIS5595_ENABLE_REG, &enable)) || (!(enable & 0x80))) { /* doesn't work for some chips! */ dev_err(&dev->dev, "Failed to enable HWM device\n"); diff --git a/drivers/hwmon/via686a.c b/drivers/hwmon/via686a.c index cffea688878f..b8466e2e1435 100644 --- a/drivers/hwmon/via686a.c +++ b/drivers/hwmon/via686a.c @@ -863,12 +863,10 @@ static int via686a_pci_probe(struct pci_dev *dev, if (force_addr) { address = force_addr & ~(VIA686A_EXTENT - 1); dev_warn(&dev->dev, "Forcing ISA address 0x%x\n", address); - if (0 != - pci_write_config_word(dev, VIA686A_BASE_REG, address | 1)) + if (pci_write_config_word(dev, VIA686A_BASE_REG, address | 1)) return -ENODEV; } - if (0 != - pci_read_config_word(dev, VIA686A_BASE_REG, &val)) + if (pci_read_config_word(dev, VIA686A_BASE_REG, &val)) return -ENODEV; address = val & ~(VIA686A_EXTENT - 1); @@ -878,8 +876,7 @@ static int via686a_pci_probe(struct pci_dev *dev, return -ENODEV; } - if (0 != - pci_read_config_word(dev, VIA686A_ENABLE_REG, &val)) + if (pci_read_config_word(dev, VIA686A_ENABLE_REG, &val)) return -ENODEV; if (!(val & 0x0001)) { if (!force_addr) { @@ -890,9 +887,7 @@ static int via686a_pci_probe(struct pci_dev *dev, } dev_warn(&dev->dev, "Enabling sensors\n"); - if (0 != - pci_write_config_word(dev, VIA686A_ENABLE_REG, - val | 0x0001)) + if (pci_write_config_word(dev, VIA686A_ENABLE_REG, val | 0x0001)) return -ENODEV; } diff --git a/drivers/hwmon/vt8231.c b/drivers/hwmon/vt8231.c index cc1d24c2a2c8..ee6cd6b85f91 100644 --- a/drivers/hwmon/vt8231.c +++ b/drivers/hwmon/vt8231.c @@ -987,13 +987,11 @@ static int vt8231_pci_probe(struct pci_dev *dev, dev_warn(&dev->dev, "Forcing ISA address 0x%x\n", address); - if (0 != - pci_write_config_word(dev, VT8231_BASE_REG, address | 1)) + if (pci_write_config_word(dev, VT8231_BASE_REG, address | 1)) return -ENODEV; } - if (0 != pci_read_config_word(dev, VT8231_BASE_REG, - &val)) + if (pci_read_config_word(dev, VT8231_BASE_REG, &val)) return -ENODEV; address = val & ~(VT8231_EXTENT - 1); @@ -1002,15 +1000,12 @@ static int vt8231_pci_probe(struct pci_dev *dev, return -ENODEV; } - if (0 != pci_read_config_word(dev, VT8231_ENABLE_REG, - &val)) + if (pci_read_config_word(dev, VT8231_ENABLE_REG, &val)) return -ENODEV; if (!(val & 0x0001)) { dev_warn(&dev->dev, "enabling sensors\n"); - if (0 != - pci_write_config_word(dev, VT8231_ENABLE_REG, - val | 0x0001)) + if (pci_write_config_word(dev, VT8231_ENABLE_REG, val | 0x0001)) return -ENODEV; } From patchwork Mon Jul 13 12:22:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327984 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=RYu8pxNg; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54BM6Kpsz9sTC for ; Mon, 13 Jul 2020 23:24:43 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729957AbgGMNXE (ORCPT ); Mon, 13 Jul 2020 09:23:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729941AbgGMNXD (ORCPT ); Mon, 13 Jul 2020 09:23:03 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53618C061755; Mon, 13 Jul 2020 06:23:03 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id g20so13695316edm.4; Mon, 13 Jul 2020 06:23:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ExF6es49alDYSdqAf6nfQyrFV/rkp6/B8fioIMr76uI=; b=RYu8pxNgdnsOJ+hiYOZPlgYabzTbyLX+KMaw5u1yC21ZGr8PmNJw4tVllr1m9KBdW6 e1yZPoxl4y5vSPwSff+H5xY+hBFKa0xapp3KqR4lMOytc87Cu0xtS6UAQ4fu6FzUAJfZ pRYjhi9Q0FHBszC+QXNaDkBU76r+evf62OFLkBk6jgs5Kkgdu9YNMR8DApOdJrkbmxIX n9TgJiTaWqPLAjmiPdhuOA+y8c3N0T4ztzYJqgMxaTrD6ZraQP9RiV9P1137SC4/OST6 tP3QAy3RnsKQrlXqfirjGAvj0zomjFPkEZf9F1WuUKjG9Zo92zd6cdt1pPsPih+31Wya V/3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ExF6es49alDYSdqAf6nfQyrFV/rkp6/B8fioIMr76uI=; b=la+pUI9C1DVBeCYXdzPy/VsdDA979SrjVlmLv0KKvfufNTyQ9n8oEHqTRsglILY+Ow g22ySiwACOC/DhB/W6gZNyne6WGf+LlhF2azslTVI3DEJnfIXg6+U1YlDblKCRURxrIs zUFnvQVISaao9lnz8x6uFEfBL13f3W7vOEuWorJ69FozkBHvhHwhBSS2CSm0Reo0Ak+6 fgtqpU9TaCa0cXq4F0mMXGz6YP03bMBa8DuNEFaZDyei2JgQoOBN2lQWmQXw9NQXxRHf FUF7h9Hatq7TxxC3EkSxSlh9/av0K+83EiRxCueDbc453m/6BDVq+W9gcr7/qfz9jH/J HvPQ== X-Gm-Message-State: AOAM531IRihLEU0dNUXC2y5Z7udV8J6tZO7zAofiPFSmJxTvMRdNXA/c 8FqMgEgJobDeLJ3RJ5hUN16pb2aj0+K2Qg== X-Google-Smtp-Source: ABdhPJx62O4aj0c9a5CqnQR0S5T4oeckXkZ/F5P2u6F1htBXN0jjErRFVTWu9CQ+3ieaAac56zRjXw== X-Received: by 2002:a05:6402:1805:: with SMTP id g5mr80230354edy.357.1594646582069; Mon, 13 Jul 2020 06:23:02 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:01 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org Subject: [RFC PATCH 18/35] bcma: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:30 +0200 Message-Id: <20200713122247.10985-19-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- drivers/bcma/driver_pci_host.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/bcma/driver_pci_host.c b/drivers/bcma/driver_pci_host.c index 88a93c266c19..b64ba68bdc8a 100644 --- a/drivers/bcma/driver_pci_host.c +++ b/drivers/bcma/driver_pci_host.c @@ -244,7 +244,7 @@ static int bcma_core_pci_hostmode_read_config(struct pci_bus *bus, PCI_FUNC(devfn), reg, val, size); spin_unlock_irqrestore(&pc_host->cfgspace_lock, flags); - return err ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; + return err ? PCIBIOS_DEVICE_NOT_FOUND : 0; } static int bcma_core_pci_hostmode_write_config(struct pci_bus *bus, @@ -264,7 +264,7 @@ static int bcma_core_pci_hostmode_write_config(struct pci_bus *bus, PCI_FUNC(devfn), reg, &val, size); spin_unlock_irqrestore(&pc_host->cfgspace_lock, flags); - return err ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; + return err ? PCIBIOS_DEVICE_NOT_FOUND : 0; } /* return cap_offset if requested capability exists in the PCI config space */ From patchwork Mon Jul 13 12:22:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327986 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=e7SRK/ds; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54BT2QnYz9sSd for ; Mon, 13 Jul 2020 23:24:49 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730178AbgGMNYm (ORCPT ); Mon, 13 Jul 2020 09:24:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729961AbgGMNXF (ORCPT ); Mon, 13 Jul 2020 09:23:05 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86EF6C061755; Mon, 13 Jul 2020 06:23:04 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id z17so13651943edr.9; Mon, 13 Jul 2020 06:23:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Od1uE36VZZcVYLn0QSD8NtzuxQxsefbubYclE4nvIkY=; b=e7SRK/dskLXTgSYSlQ2o7Q4GwDjhmiP9X6vyk4ZKZEDu/qgVrpUvAqt9H0nYD8+O6G tS9IxLNysoC0AJatrwEo44o4SAxid1FlUkUtT0nJX2TYfohWaenFiCs0a+bBJoPZ4PrQ olkimNUMz/4c2WhWYTiMwpSVPAxiMCziBsQ1kHrgdn1HkxRuu4IMfbWw8/CJ3QROjQOj kmSCNf1U1Jh9w/9rKB7mUu3WCIIc/quDAXu4oBtvdAJaugj9OAo5B/Olh3qgInDhjr0W kZ9WFKb+55kYxv090/oS2lbVBG/glVDJxIHRBePzwE74mGECDU7wwOU4oYCIY1k3Arja 1khg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Od1uE36VZZcVYLn0QSD8NtzuxQxsefbubYclE4nvIkY=; b=oxk7hlzXsUbGG75z38ScGWBp/6FacRpa79zDqNQk2XOvw3fQyjchVgHYtaugniEmj0 89iXDs6pti7Gw4sPfYtAshmHFrfjduV4VgHy9j1A8KoMe7/joRfPZHBvYyN11XA+Iajc nZ56SwEFf3MnAuS37lSPzumnikNb50nKPH3AJfbCKMmR4Q3iAnFW71jMn89Ej8vJ5McN ROhl1gIwy69PVW8hk6tPj4/WcX8sDKfJft7UYxafNuDjf7Y8rpK3KXw/amFg9oF/LtEA 7CKAeucgFtu17nG2xRhq6djMpyEMFUyauy5420P1OgEPA7qidRLcKVGm6DpcVtoYQezX McQg== X-Gm-Message-State: AOAM53134dvafH8epqpW2a4mXN2dFDSW/nzaAEjNCXST9IAAPLjWBQ5m Fdx7KynyGBEc4rdPxbLDuZY= X-Google-Smtp-Source: ABdhPJxpNR6rRgsPQS5aE3w3IDF8VLZSwN1M0ZM5Th2IbtF+Dj00cjehb0zQNQGy6XXrKpQDJRU0Hw== X-Received: by 2002:aa7:da8a:: with SMTP id q10mr29025674eds.139.1594646583291; Mon, 13 Jul 2020 06:23:03 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:02 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Chas Williams <3chas3@gmail.com> Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org Subject: [RFC PATCH 19/35] atm: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:31 +0200 Message-Id: <20200713122247.10985-20-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- drivers/atm/iphase.c | 4 ++-- drivers/atm/lanai.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 8c7a996d1f16..b01cc491540d 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -2296,12 +2296,12 @@ static int reset_sar(struct atm_dev *dev) iadev = INPH_IA_DEV(dev); for(i=0; i<64; i++) if ((error = pci_read_config_dword(iadev->pci, - i*4, &pci[i])) != PCIBIOS_SUCCESSFUL) + i*4, &pci[i])) != 0) return error; writel(0, iadev->reg+IPHASE5575_EXT_RESET); for(i=0; i<64; i++) if ((error = pci_write_config_dword(iadev->pci, - i*4, pci[i])) != PCIBIOS_SUCCESSFUL) + i*4, pci[i])) != 0) return error; udelay(5); return 0; diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index 645a6bc1df88..2b82ae30dd74 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c @@ -1098,7 +1098,7 @@ static void pcistatus_check(struct lanai_dev *lanai, int clearonly) u16 s; int result; result = pci_read_config_word(lanai->pci, PCI_STATUS, &s); - if (result != PCIBIOS_SUCCESSFUL) { + if (result != 0) { printk(KERN_ERR DEV_LABEL "(itf %d): can't read PCI_STATUS: " "%d\n", lanai->number, result); return; @@ -1109,7 +1109,7 @@ static void pcistatus_check(struct lanai_dev *lanai, int clearonly) if (s == 0) return; result = pci_write_config_word(lanai->pci, PCI_STATUS, s); - if (result != PCIBIOS_SUCCESSFUL) + if (result != 0) printk(KERN_ERR DEV_LABEL "(itf %d): can't write PCI_STATUS: " "%d\n", lanai->number, result); if (clearonly) @@ -1949,7 +1949,7 @@ static int lanai_pci_start(struct lanai_dev *lanai) return result; /* Set latency timer to zero as per lanai docs */ result = pci_write_config_byte(pci, PCI_LATENCY_TIMER, 0); - if (result != PCIBIOS_SUCCESSFUL) { + if (result != 0) { printk(KERN_ERR DEV_LABEL "(itf %d): can't write " "PCI_LATENCY_TIMER: %d\n", lanai->number, result); return -EINVAL; From patchwork Mon Jul 13 12:22:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327983 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=nP4tM4Oo; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54BM2GKwz9sSd for ; Mon, 13 Jul 2020 23:24:43 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729975AbgGMNYe (ORCPT ); Mon, 13 Jul 2020 09:24:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729969AbgGMNXG (ORCPT ); Mon, 13 Jul 2020 09:23:06 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC3B2C061755; Mon, 13 Jul 2020 06:23:05 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id rk21so17149493ejb.2; Mon, 13 Jul 2020 06:23:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=f8H9ERlOx/bwQCAi3oIgaIga9LfQUpIbkoayEldb0HM=; b=nP4tM4OoaJfI0jEtW6xEBzg5apoi+sWZOdNUHQnZql6+5zpfUsCjSE4u5R6pLHW7oz jwCKuzbcq2TY5Dj55XYH232OmurQzeBHVhYptBrE9zfGCZRU4opTaCJbHAMpr0Io+O6H 7CkiLXYzvyqDjoBjHNoxd6DKPV8nlkPB4GjV5Gm5694PrvQuHLga/wb1ZW/qqoYB7fX/ 23WjP7f45Ar86+KfC2ZgCUkjdOH+neDGunZLfG1c3Unv9zr1u/U/MpAClk0P9WhMhftQ ZOPqXc9lBwP4VFQwgbEqziTeD1X6/NYWmcovo0m8tlTlLm04kKUGwewdHeh4toIGMfu7 3x/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=f8H9ERlOx/bwQCAi3oIgaIga9LfQUpIbkoayEldb0HM=; b=pztxPtpxGG8sJaOluoP5/lUUn/noVfyMUp9WcKFCd0XM7Za7SZILzyV43ZPUsm2mx5 qBGx5E78zDzY/4MYHJNhwMlusOPYjyE5QOZuoSg8S5Qc+EWLZouqiSGGes77tAtGwEux ZNdj7Y6m9G2P+/685aBqIiab6rzDahgiVDiVoTqDzORQWw4TZPHkqVXRnckZM4CTpmhd XFAAGAvurnVpihwCejR1h5tU6O0RnvbGZkZMKdTovfTmowbExTG1gQ4LMcvW27MRID6l 5S+/Cbr79M1vCk8jh0oSkEUJB+ylpJSbiBYc9rSlV/WgVo49tbaL3lyVrPrzHjUI1cWq fTAg== X-Gm-Message-State: AOAM532esOD2WD25d9yB9rABIX7jfNrg48TO2o/T4xK1+DpMV+/gnHTb tDuGcXZC7KB9ez+1rX5J8hI= X-Google-Smtp-Source: ABdhPJzx0zQFxJKNIsf6530AIRMCz6zA8fnk43QLenk2ugiiyTQ45TDgcyc6ZIixfZou+TbMT0rN7g== X-Received: by 2002:a17:906:ca56:: with SMTP id jx22mr72549054ejb.494.1594646584531; Mon, 13 Jul 2020 06:23:04 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:04 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Chas Williams <3chas3@gmail.com> Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org Subject: [RFC PATCH 20/35] atm: Tidy Success/Failure checks Date: Mon, 13 Jul 2020 14:22:32 +0200 Message-Id: <20200713122247.10985-21-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unnecessary check for 0. Signed-off-by: "Saheed O. Bolarinwa" --- This patch depends on PATCH 19/35 drivers/atm/iphase.c | 10 ++++------ drivers/atm/lanai.c | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index b01cc491540d..2c75b82b4e7f 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -2295,14 +2295,12 @@ static int reset_sar(struct atm_dev *dev) iadev = INPH_IA_DEV(dev); for(i=0; i<64; i++) - if ((error = pci_read_config_dword(iadev->pci, - i*4, &pci[i])) != 0) - return error; + if ((error = pci_read_config_dword(iadev->pci, i*4, &pci[i]))) + return error; writel(0, iadev->reg+IPHASE5575_EXT_RESET); for(i=0; i<64; i++) - if ((error = pci_write_config_dword(iadev->pci, - i*4, pci[i])) != 0) - return error; + if ((error = pci_write_config_dword(iadev->pci, i*4, pci[i]))) + return error; udelay(5); return 0; } diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index 2b82ae30dd74..5852b8cc0cc4 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c @@ -1098,7 +1098,7 @@ static void pcistatus_check(struct lanai_dev *lanai, int clearonly) u16 s; int result; result = pci_read_config_word(lanai->pci, PCI_STATUS, &s); - if (result != 0) { + if (result) { printk(KERN_ERR DEV_LABEL "(itf %d): can't read PCI_STATUS: " "%d\n", lanai->number, result); return; @@ -1109,7 +1109,7 @@ static void pcistatus_check(struct lanai_dev *lanai, int clearonly) if (s == 0) return; result = pci_write_config_word(lanai->pci, PCI_STATUS, s); - if (result != 0) + if (result) printk(KERN_ERR DEV_LABEL "(itf %d): can't write PCI_STATUS: " "%d\n", lanai->number, result); if (clearonly) @@ -1945,7 +1945,7 @@ static int lanai_pci_start(struct lanai_dev *lanai) return -EBUSY; } result = check_board_id_and_rev("PCI", pci->subsystem_device, NULL); - if (result != 0) + if (result) return result; /* Set latency timer to zero as per lanai docs */ result = pci_write_config_byte(pci, PCI_LATENCY_TIMER, 0); From patchwork Mon Jul 13 12:22:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327980 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=GfVbLOBw; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54BB5qf5z9sTd for ; Mon, 13 Jul 2020 23:24:34 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729919AbgGMNY2 (ORCPT ); Mon, 13 Jul 2020 09:24:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729975AbgGMNXH (ORCPT ); Mon, 13 Jul 2020 09:23:07 -0400 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0774DC061755; Mon, 13 Jul 2020 06:23:07 -0700 (PDT) Received: by mail-ed1-x544.google.com with SMTP id h28so13716203edz.0; Mon, 13 Jul 2020 06:23:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1igF4d0BlRch6oTsOMsklRo2hJykPi64NTGjSwxBH2w=; b=GfVbLOBwTQM68ys28gmEsLzbrBK1b+c6gCAsHBPLuU1sBU4FxzUQzy/FNV+5JwZOZm kR1VcVfpphRXsdfwIXVx0TAIiRR2ezTv5Ddtc5q6AGYct5hmINAtuH2sc4z+kABGsA3q MZpWVLyzERoP5ZgKwWxgZ/Bwb6KkGfAYQ9yYfsAF7q7g9s64zC4q4x7y4lMUurO7OOP+ GRtkarmdVJUSPnTc67hb7A1PCAolXIJeajY5fisQ/pGpWykWJ6NKryHtSJ+mG/rXcimM ZkVft5Cj3VHZrbAZSjJNYb5UM7QM1G0i5UELVPbI1106MfxiHosmC6D9IGT7Iu7SHFu8 L03A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1igF4d0BlRch6oTsOMsklRo2hJykPi64NTGjSwxBH2w=; b=gJSX5mC990yYxLc5htqCy0iSJF9M0lYNw2NsATvQF5+IlKKoJiRV/kEymYvPq6A89b 61n5pcpPVbscu8p4Wd19aQarKcOuF6u5mLGCTHZL/8jJMAupjY/OVfTOQ9OBMtjwoekV Vx6x3FpcwJIi68OlhEnj8JM5gyFxk5ZORfsASja4jFgBtVXM9vVyeWQwrXBs+5GJQsA3 5nIgl7vbCJO97iajzgXlBVu62i18LmWgOYfHXT3/n7DmkNccfD/4W6QYz3M5aAnyyzAr jVpubpflV77APN357c0SE3v/zGhVqKaTpzjkLHMt14hGogtSRZNxdFl4Fr+5VdiYEUtj PJfw== X-Gm-Message-State: AOAM532D2mUbi7boe1G7SYNQPUeetqFwx3i+XHlxVhxBR/NjFIUPtOtQ kD9BsZFoLVxrptCYcWqp2BU= X-Google-Smtp-Source: ABdhPJxLeJeo/pnR11earKOB22YmNVCGTeYK935Hvqyg5TcDWyXANgwsI03EL03zM4adEjgBZ464zw== X-Received: by 2002:a50:f392:: with SMTP id g18mr67987969edm.151.1594646585767; Mon, 13 Jul 2020 06:23:05 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:05 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Chas Williams <3chas3@gmail.com> Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org Subject: [RFC PATCH 21/35] atm: Fix Style ERROR- assignment in if condition Date: Mon, 13 Jul 2020 14:22:33 +0200 Message-Id: <20200713122247.10985-22-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Move assignment out of the if condition Fix style issues in the for-loop Signed-off-by: "Saheed O. Bolarinwa" --- This patch depends on PATCH 20/35 drivers/atm/iphase.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 2c75b82b4e7f..584d9be5fa73 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -2294,13 +2294,19 @@ static int reset_sar(struct atm_dev *dev) unsigned int pci[64]; iadev = INPH_IA_DEV(dev); - for(i=0; i<64; i++) - if ((error = pci_read_config_dword(iadev->pci, i*4, &pci[i]))) + for (i = 0; i < 64; i++) { + error = pci_read_config_dword(iadev->pci, i*4, &pci[i]); + if (error) return error; + } + writel(0, iadev->reg+IPHASE5575_EXT_RESET); - for(i=0; i<64; i++) - if ((error = pci_write_config_dword(iadev->pci, i*4, pci[i]))) + for (i = 0; i < 64; i++) { + error = pci_write_config_dword(iadev->pci, i*4, pci[i]); + if (error) return error; + } + udelay(5); return 0; } From patchwork Mon Jul 13 12:22:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327963 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=sor0wqfV; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B548c2HxJz9sRW for ; Mon, 13 Jul 2020 23:23:12 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729987AbgGMNXK (ORCPT ); Mon, 13 Jul 2020 09:23:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729983AbgGMNXI (ORCPT ); Mon, 13 Jul 2020 09:23:08 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AD7AC061755; Mon, 13 Jul 2020 06:23:08 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id f12so17132138eja.9; Mon, 13 Jul 2020 06:23:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EKTGQqjFsfzqPPjmNL4aUYY57OLmCsGI5alt5eIAZQo=; b=sor0wqfVidp46y23ExI3rsc2tAIgirfY+l2lliUu1vrr+cY4AhVxnL0vWpCtDi/pa5 0P/FVcGFyX2Y+3pe62aArh19MEj55T95wEF+4oO9/2bmfXNg6ZpcRhj2+xOarQfnO3Yi ClS6N9vgqqhyfuzzULu1HTxbdxjEJ3PCZ1/fQN6Vq9ipdpD8QA7XBzpGnmHXYxqzfHy7 Im6YnfbXdPENwK0Tv/Tr3ewida6YiRbYRqw18+LV8NcOyemhUVamZyfUC87ZztrdJOXo rpPZAOHjeXFIcgipzq9CQ0IbGmW/5P7Avm2qQZKpCVxQroZ2vCz5Rp2R9aSL5UYVBjCw lWAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EKTGQqjFsfzqPPjmNL4aUYY57OLmCsGI5alt5eIAZQo=; b=ZO8HLpHhnoCRiAD8nBfO4PJEHW5HNrAgbVJeFrLkou6S5uswkGOEE2hPysI2pwIf0t lxag01xPu5xeL2Ds0lvGQxU73zhhvHiA4zTaZokxO60I4rxYTxROG1LNdY7LgJVYmmNN auZnQZL3lT5guNoV0P8SiaAVGkd4qoDlWi3dDUKOOUmUY1eON+fXdy/9aLiwkkXFG3I7 DT0GwlwrLDpP2fojnEEHviigKgeZ08ClCq+xncp6t4KiEjwOv/2Y3buY8peb4SreZ/WX AdOLocVSeQuN0FJ0wxNcrLTbWzMWBjw/CQnHVTWLbAwrxTQZC/JXHU3FJ77+qnCMPzV/ 7umg== X-Gm-Message-State: AOAM532/cP/NCxSSxnyTppgJwAnZiH0qlVPXB3CkCo6wnAPZoEA/gIbX JX+x4VDAWpEwIt+07kQ7kcY= X-Google-Smtp-Source: ABdhPJzOwIZGspjLgMaEq365pJ5/qMDFTMQ2+msioD//dAatGjVwqe5nQfPgFpq7fjw/LM34pCqEZA== X-Received: by 2002:a17:906:3c42:: with SMTP id i2mr78330767ejg.14.1594646587072; Mon, 13 Jul 2020 06:23:07 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:06 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Guan Xuetao Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 22/35] unicore32: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:34 +0200 Message-Id: <20200713122247.10985-23-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- arch/unicore32/kernel/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/unicore32/kernel/pci.c b/arch/unicore32/kernel/pci.c index 0d098aa05b47..401ab356c814 100644 --- a/arch/unicore32/kernel/pci.c +++ b/arch/unicore32/kernel/pci.c @@ -37,7 +37,7 @@ puv3_read_config(struct pci_bus *bus, unsigned int devfn, int where, *value = readl(PCICFG_DATA); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int @@ -58,7 +58,7 @@ puv3_write_config(struct pci_bus *bus, unsigned int devfn, int where, writel(value, PCICFG_DATA); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops pci_puv3_ops = { From patchwork Mon Jul 13 12:22:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327978 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=qOy7ElWW; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54B43b2Tz9sRk for ; Mon, 13 Jul 2020 23:24:28 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729780AbgGMNYX (ORCPT ); Mon, 13 Jul 2020 09:24:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729984AbgGMNXK (ORCPT ); Mon, 13 Jul 2020 09:23:10 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DCD7C061755; Mon, 13 Jul 2020 06:23:09 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id n26so17185399ejx.0; Mon, 13 Jul 2020 06:23:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rplWXqoRmMzG/PAypQDSMVo9rsbsvM0HW4mN54VwCPY=; b=qOy7ElWW63EuFj1bTCYdyQLghlNDXNsRyywynTNgzD0Gq2x5qrJkewWFkC7exZ3ZK+ WszpqO334hwMhryyStOXx4Lr6yXFcseq6PMIyjonDk24NsGX1T9MUDI2QUBUjO3LWGbM Li9jO95VLMGwEH/ZoYPlMg5XHj1kZ5ppuN+yX9tYvdA/nj3QJiO8zdIXlSNw2qo2a6nH sqbqya0t9Apm7UjW5m5M6YLJRGsvsyAdyWdCif1CyKWabSWLz57vj7tLaSDUILABN/76 3mqzHZzhgpEV/h5XKdKHPT7Sv3o5sk5cKDjcx7xoPTUKFkv62VAV/8RkNo81Aco4xq90 zLlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rplWXqoRmMzG/PAypQDSMVo9rsbsvM0HW4mN54VwCPY=; b=hpoq7FtN3cKq95YYEtH2PFKR155P4ixw93SwsFFEBeLAy9CenaMbEYfRkQQYwjka4S VSWzfWNL6aeX3soQWiRVMNPfN4W4tV+Bj/gEPiH37xRRP+n/CFH9yXtwI2fd4nI6oRqv fW02dXav+yAJRWZAFFw9I5ziieOGwgM2RBl47MIxJUpbpa7C/2Vdz12b3IVgLBY9YkAr 86JxMSwpqKzOtenFRv9VQ5vib23Qsoi7/f4FLvsQcG4976eeFJg3ImkIJujQpDk8TNjh WPfPZkdlBNavTLcpXEnc3SAWfpYRmFuHQGEooVjrmSU6guiAAiFBeCDncTSvnzqcmMcG dblg== X-Gm-Message-State: AOAM533WUtPBI88HeVi1TkiLEcO1aSqAVj6EDggpPfjjDap2BxY7vyEE Ek17vm9jUBD6MKlcG/siZI4= X-Google-Smtp-Source: ABdhPJwRfcZjb10nMLeLG67GTJhBUEo56JkZJMLUALmO5nYTsFEky+Xkmns5sJRXxh54bY0oHtpWTA== X-Received: by 2002:a17:906:7115:: with SMTP id x21mr71985610ejj.86.1594646588253; Mon, 13 Jul 2020 06:23:08 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:07 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, "David S. Miller" Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org Subject: [RFC PATCH 23/35] sparc/PCI: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:35 +0200 Message-Id: <20200713122247.10985-24-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- arch/sparc/kernel/pci_common.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/sparc/kernel/pci_common.c b/arch/sparc/kernel/pci_common.c index 4759ccd542fe..39175f26f401 100644 --- a/arch/sparc/kernel/pci_common.c +++ b/arch/sparc/kernel/pci_common.c @@ -59,7 +59,7 @@ static int sun4u_read_pci_cfg_host(struct pci_pbm_info *pbm, addr = sun4u_config_mkaddr(pbm, bus, devfn, where); if (!addr) - return PCIBIOS_SUCCESSFUL; + return 0; switch (size) { case 1: @@ -102,7 +102,7 @@ static int sun4u_read_pci_cfg_host(struct pci_pbm_info *pbm, *value |= tmp32 << 16; break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int sun4u_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, @@ -132,7 +132,7 @@ static int sun4u_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, addr = sun4u_config_mkaddr(pbm, bus, devfn, where); if (!addr) - return PCIBIOS_SUCCESSFUL; + return 0; switch (size) { case 1: @@ -144,7 +144,7 @@ static int sun4u_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, if (where & 0x01) { printk("pci_read_config_word: misaligned reg [%x]\n", where); - return PCIBIOS_SUCCESSFUL; + return 0; } pci_config_read16((u16 *)addr, &tmp16); *value = (u32) tmp16; @@ -154,12 +154,12 @@ static int sun4u_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, if (where & 0x03) { printk("pci_read_config_dword: misaligned reg [%x]\n", where); - return PCIBIOS_SUCCESSFUL; + return 0; } pci_config_read32(addr, value); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int sun4u_write_pci_cfg_host(struct pci_pbm_info *pbm, @@ -170,7 +170,7 @@ static int sun4u_write_pci_cfg_host(struct pci_pbm_info *pbm, addr = sun4u_config_mkaddr(pbm, bus, devfn, where); if (!addr) - return PCIBIOS_SUCCESSFUL; + return 0; switch (size) { case 1: @@ -206,7 +206,7 @@ static int sun4u_write_pci_cfg_host(struct pci_pbm_info *pbm, where + 2, 2, value >> 16); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int sun4u_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, @@ -222,7 +222,7 @@ static int sun4u_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, addr = sun4u_config_mkaddr(pbm, bus, devfn, where); if (!addr) - return PCIBIOS_SUCCESSFUL; + return 0; switch (size) { case 1: @@ -233,7 +233,7 @@ static int sun4u_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, if (where & 0x01) { printk("pci_write_config_word: misaligned reg [%x]\n", where); - return PCIBIOS_SUCCESSFUL; + return 0; } pci_config_write16((u16 *)addr, value); break; @@ -242,11 +242,11 @@ static int sun4u_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, if (where & 0x03) { printk("pci_write_config_dword: misaligned reg [%x]\n", where); - return PCIBIOS_SUCCESSFUL; + return 0; } pci_config_write32(addr, value); } - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops sun4u_pci_ops = { @@ -284,7 +284,7 @@ static int sun4v_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, } - return PCIBIOS_SUCCESSFUL; + return 0; } static int sun4v_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, @@ -307,7 +307,7 @@ static int sun4v_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, HV_PCI_DEVICE_BUILD(bus, device, func), where, size, value); } - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops sun4v_pci_ops = { From patchwork Mon Jul 13 12:22:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327976 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=SaNGQfLV; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B549y427Yz9sTb for ; Mon, 13 Jul 2020 23:24:22 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729995AbgGMNXM (ORCPT ); Mon, 13 Jul 2020 09:23:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729989AbgGMNXL (ORCPT ); Mon, 13 Jul 2020 09:23:11 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5D95C061755; Mon, 13 Jul 2020 06:23:10 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id lx13so17143288ejb.4; Mon, 13 Jul 2020 06:23:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xcKDUJtN8KnVp8SK38Ke0hkXpSNLE2nTiZgewkHzMQw=; b=SaNGQfLVx6RqUWzELxm9T+H6i+YLj/d/wFalPHk2qzqpsLYUvY6xsqG5ifZyl5xXoy RHUOs4DoBmK3mHxWhLxDqNqNcjjm0z46C6vabdJ9p+CfmRYhNpygqvBxUrO9ijIBAPac 6uNj3/qTGxTkv7CXIbf6eBF8B1utWOoErQZBM29hcjWAi4iFZiS2GfpT+wGthIaS/jb6 NJmNbiBWqExF7WlkzgTsOwl1n12faQczUqZrcILxAoxtlcnHL2LXFmvUpVSnj3Rs8YYg VlJVRb227P01Gzajwxc0dSRkTqJuEYitM47cU1sN5shRZIY4d89mqXpxqaUuH80isD47 U27g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xcKDUJtN8KnVp8SK38Ke0hkXpSNLE2nTiZgewkHzMQw=; b=O6nmdgYU3mE4j8gg0cMLs3soRWuj6MM38/q6cFmNnySAC2PF8fj5tQvNTyk3MTGsXp IBjGGcE/td0WLO116j3gYBKTGeuftt+JoeKw8UfsC7Rx51pySMHNFgH97yDZhsUcgGG6 zx7/2RoT+zLPuUDtJQiYqQfHO8HxTg4n2bs0nHoL1ZDDFsFUmGFNg3VFSxZzmyAe3AYx Ksy29J/Qu439kThq34mDuXxlB5LIn9Z7NzUiEz+oxAp4duqWLuA4yrUbT7n/nYG1JYtH t/chrHeV6wDy5ZaS0DQPce3xUHIZ+YWBb4k/0tPhOWHm2VQYm3KbZDdEUzdbdwZubSsL mbJw== X-Gm-Message-State: AOAM5331FTwRJjtuKbtRNIbWw+GnQ10gw5IuFMYInwz/ay+VNSRSsZ/O huUyzQkbREA260nih0F62sg= X-Google-Smtp-Source: ABdhPJwsSYVM2+fMyxzB9eGDOoH0392buOi9pzjJVv96vP3BQvWvgtw4YTkrbkHgyoMZV9LLvQIslw== X-Received: by 2002:a17:906:f53:: with SMTP id h19mr71419486ejj.491.1594646589588; Mon, 13 Jul 2020 06:23:09 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:09 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Yoshinori Sato , Rich Felker Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org Subject: [RFC PATCH 24/35] sh: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:36 +0200 Message-Id: <20200713122247.10985-25-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" Acked-by: Rich Felker --- arch/sh/drivers/pci/common.c | 2 +- arch/sh/drivers/pci/ops-dreamcast.c | 4 ++-- arch/sh/drivers/pci/ops-sh4.c | 4 ++-- arch/sh/drivers/pci/ops-sh7786.c | 8 ++++---- arch/sh/drivers/pci/pci.c | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/sh/drivers/pci/common.c b/arch/sh/drivers/pci/common.c index fe163ecd0719..ee27cdfd3e68 100644 --- a/arch/sh/drivers/pci/common.c +++ b/arch/sh/drivers/pci/common.c @@ -61,7 +61,7 @@ int __init pci_is_66mhz_capable(struct pci_channel *hose, continue; if (early_read_config_word(hose, top_bus, current_bus, pci_devfn, PCI_VENDOR_ID, &vid) != - PCIBIOS_SUCCESSFUL) + 0) continue; if (vid == 0xffff) continue; diff --git a/arch/sh/drivers/pci/ops-dreamcast.c b/arch/sh/drivers/pci/ops-dreamcast.c index 517a8a9702f6..431cd006951f 100644 --- a/arch/sh/drivers/pci/ops-dreamcast.c +++ b/arch/sh/drivers/pci/ops-dreamcast.c @@ -56,7 +56,7 @@ static int gapspci_read(struct pci_bus *bus, unsigned int devfn, int where, int case 4: *val = inl(GAPSPCI_BBA_CONFIG+where); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int gapspci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val) @@ -70,7 +70,7 @@ static int gapspci_write(struct pci_bus *bus, unsigned int devfn, int where, int case 4: outl((u32)val, GAPSPCI_BBA_CONFIG+where); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops gapspci_pci_ops = { diff --git a/arch/sh/drivers/pci/ops-sh4.c b/arch/sh/drivers/pci/ops-sh4.c index a205be3bfc4a..4d757e5f38c6 100644 --- a/arch/sh/drivers/pci/ops-sh4.c +++ b/arch/sh/drivers/pci/ops-sh4.c @@ -49,7 +49,7 @@ static int sh4_pci_read(struct pci_bus *bus, unsigned int devfn, return PCIBIOS_FUNC_NOT_SUPPORTED; } - return PCIBIOS_SUCCESSFUL; + return 0; } /* @@ -90,7 +90,7 @@ static int sh4_pci_write(struct pci_bus *bus, unsigned int devfn, pci_write_reg(chan, data, SH4_PCIPDR); - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops sh4_pci_ops = { diff --git a/arch/sh/drivers/pci/ops-sh7786.c b/arch/sh/drivers/pci/ops-sh7786.c index a10f9f4ebd7f..7c329e467360 100644 --- a/arch/sh/drivers/pci/ops-sh7786.c +++ b/arch/sh/drivers/pci/ops-sh7786.c @@ -52,7 +52,7 @@ static int sh7786_pcie_config_access(unsigned char access_type, else pci_write_reg(chan, *data, PCI_REG(reg)); - return PCIBIOS_SUCCESSFUL; + return 0; } else if (dev > 1) return PCIBIOS_DEVICE_NOT_FOUND; } @@ -83,7 +83,7 @@ static int sh7786_pcie_config_access(unsigned char access_type, /* Disable the configuration access */ pci_write_reg(chan, 0, SH4A_PCIEPCTLR); - return PCIBIOS_SUCCESSFUL; + return 0; } static int sh7786_pcie_read(struct pci_bus *bus, unsigned int devfn, @@ -101,7 +101,7 @@ static int sh7786_pcie_read(struct pci_bus *bus, unsigned int devfn, raw_spin_lock_irqsave(&pci_config_lock, flags); ret = sh7786_pcie_config_access(PCI_ACCESS_READ, bus, devfn, where, &data); - if (ret != PCIBIOS_SUCCESSFUL) { + if (ret != 0) { *val = 0xffffffff; goto out; } @@ -137,7 +137,7 @@ static int sh7786_pcie_write(struct pci_bus *bus, unsigned int devfn, raw_spin_lock_irqsave(&pci_config_lock, flags); ret = sh7786_pcie_config_access(PCI_ACCESS_READ, bus, devfn, where, &data); - if (ret != PCIBIOS_SUCCESSFUL) + if (ret != 0) goto out; dev_dbg(&bus->dev, "pcie-config-write: bus=%3d devfn=0x%04x " diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index c7784e156964..77130f035fdd 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c @@ -204,7 +204,7 @@ pcibios_bus_report_status_early(struct pci_channel *hose, continue; ret = early_read_config_word(hose, top_bus, current_bus, pci_devfn, PCI_STATUS, &status); - if (ret != PCIBIOS_SUCCESSFUL) + if (ret != 0) continue; if (status == 0xffff) continue; From patchwork Mon Jul 13 12:22:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327975 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=qhqR5FlS; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B549x6jmxz9sTS for ; Mon, 13 Jul 2020 23:24:21 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730000AbgGMNXN (ORCPT ); Mon, 13 Jul 2020 09:23:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729996AbgGMNXM (ORCPT ); Mon, 13 Jul 2020 09:23:12 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22ABCC061755; Mon, 13 Jul 2020 06:23:12 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id lx13so17143399ejb.4; Mon, 13 Jul 2020 06:23:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=a4qclUpgkVLODkm3qmb6k0l4x97EWCpj9W69r9J7+M4=; b=qhqR5FlSBoF6xGgJ9myL6BEHj3SWp6zu5kQf3Ik4Rr69Vd1gY84Qi4wolwrTt0qgYW plapG8w+tVKsouDRp8WFKqpLN6+pXFT173QI0rIgfIm6txt4X73hrtNVlJqsil9mcPHZ NQXZcfqCsCGOxQtxhIsBMR/rdNPGE7633fXpVIxFTIrj51dp+3llmstY0ZDnzbZSNE8X gWVRu/J5Iyotd+NeBiu+FhV1zTqL09iLZivT8tlxugX9yFAWU/fipl6u5iIi6ocyCcBT u+aNZEHAH7qCFKogHZPz0pjyycFT3CC6gU4Ows7yZIUpmdHa6u4qBDHFpopfJgiPZW7d 5Mew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=a4qclUpgkVLODkm3qmb6k0l4x97EWCpj9W69r9J7+M4=; b=CZcnWHbyq8HmkHMfTjyTqQOVb7iZofxsccbEgqD77n1kQ7hxkpkRpTsy+oWm7Y+6Dw UTWDzU4MuXEfBV+rj5ny2eFWjaXbcki59cI7e1uvYaKQLnCXoqnNrinOB3FF3WCkDG/F eYkij29J0bpmTj95bS+qMWZq16qUtvyZphxvoHwSxkhHi2zu9yxQpYrSwbTBEaD9gg0D z5rRk/668RbTJElc38udJONkoP44wkZnJ0jaNJoQAw1rpOmDwtp/G1HUDPazY40+ITsh bqsCwUQGhWZdKmgdin9gHV//otWzZOx7uFPh/fTj2KjJJrdRVDQuxK0RTStsPhtyf/Nv UYgg== X-Gm-Message-State: AOAM533SlBDT+J2hTIu6Q/YOrIL91aWlGDI4CIR2sNOafG8oGtvDparL nMbRx5Ho36I7Co14H1f9Hl0= X-Google-Smtp-Source: ABdhPJwhwgHzEzV8y9RxY4MQVGO6CwCxft/SH/sDeVCsCsqstTlIeftQpN2hNpcjN9TS7Mn+dSK4Eg== X-Received: by 2002:a17:906:2b52:: with SMTP id b18mr75602949ejg.158.1594646590832; Mon, 13 Jul 2020 06:23:10 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:10 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Yoshinori Sato , Rich Felker Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org Subject: [RFC PATCH 25/35] sh: Tidy Success/Failure checks Date: Mon, 13 Jul 2020 14:22:37 +0200 Message-Id: <20200713122247.10985-26-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unnecessary check for 0. Signed-off-by: "Saheed O. Bolarinwa" --- This patch depends on PATCH 24/35 arch/sh/drivers/pci/common.c | 3 +-- arch/sh/drivers/pci/ops-sh7786.c | 4 ++-- arch/sh/drivers/pci/pci.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/sh/drivers/pci/common.c b/arch/sh/drivers/pci/common.c index ee27cdfd3e68..676907e6a514 100644 --- a/arch/sh/drivers/pci/common.c +++ b/arch/sh/drivers/pci/common.c @@ -60,8 +60,7 @@ int __init pci_is_66mhz_capable(struct pci_channel *hose, if (PCI_FUNC(pci_devfn)) continue; if (early_read_config_word(hose, top_bus, current_bus, - pci_devfn, PCI_VENDOR_ID, &vid) != - 0) + pci_devfn, PCI_VENDOR_ID, &vid)) continue; if (vid == 0xffff) continue; diff --git a/arch/sh/drivers/pci/ops-sh7786.c b/arch/sh/drivers/pci/ops-sh7786.c index 7c329e467360..c1be0ac2508a 100644 --- a/arch/sh/drivers/pci/ops-sh7786.c +++ b/arch/sh/drivers/pci/ops-sh7786.c @@ -101,7 +101,7 @@ static int sh7786_pcie_read(struct pci_bus *bus, unsigned int devfn, raw_spin_lock_irqsave(&pci_config_lock, flags); ret = sh7786_pcie_config_access(PCI_ACCESS_READ, bus, devfn, where, &data); - if (ret != 0) { + if (ret) { *val = 0xffffffff; goto out; } @@ -137,7 +137,7 @@ static int sh7786_pcie_write(struct pci_bus *bus, unsigned int devfn, raw_spin_lock_irqsave(&pci_config_lock, flags); ret = sh7786_pcie_config_access(PCI_ACCESS_READ, bus, devfn, where, &data); - if (ret != 0) + if (ret) goto out; dev_dbg(&bus->dev, "pcie-config-write: bus=%3d devfn=0x%04x " diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index 77130f035fdd..19e9a211c23e 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c @@ -204,7 +204,7 @@ pcibios_bus_report_status_early(struct pci_channel *hose, continue; ret = early_read_config_word(hose, top_bus, current_bus, pci_devfn, PCI_STATUS, &status); - if (ret != 0) + if (ret) continue; if (status == 0xffff) continue; From patchwork Mon Jul 13 12:22:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327973 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=CRJ+eOrF; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B549h3fHvz9sSJ for ; Mon, 13 Jul 2020 23:24:08 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730123AbgGMNYF (ORCPT ); Mon, 13 Jul 2020 09:24:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730005AbgGMNXO (ORCPT ); Mon, 13 Jul 2020 09:23:14 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CD8FC061755; Mon, 13 Jul 2020 06:23:13 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id n26so17185719ejx.0; Mon, 13 Jul 2020 06:23:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CqnQzLagV907q2DtZUmj9ucC67l45yw7G9UU01xV9po=; b=CRJ+eOrFMBo/lBjr7P0jG106EU1m3aA89WdMkojOKu0fhIqVbeWwawRT8c2JVTNVf6 vH31cZc+hmYy4JBBDR1GYH0/j6xZ2sQS3lyKVAXc2BUnm7jDq4vfJKxzOR6ekWAjcZbt lhv/QnWokdFnxK9Z75zldkVpev4+Xi0Bvz9LWwdB9coyrcbhT/lzqGKB6zWUOPkFMsRo 7Sfcg5A90uvkpFutYn8hHL4zypTFhA08sjDbl3TzVROBvggLbkYIcI5HcMXNgkZbyDx9 7+sl9vXOKv3K49AtTf9xCaiB2I+3UQ0duNCCsFfLU16Poi4V9NQITTE4pjsukd7aUvof Z01A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CqnQzLagV907q2DtZUmj9ucC67l45yw7G9UU01xV9po=; b=XJ3yKdz85q4KxX0PdnTV/fHzBcwTon8UtpXyVc8axwSxhcZ4UUzZO97xB1/ac9XiOL 3SYE30LSNkxdLjDGFMrpszkdBeOzM0NYdO4i4eIl3bu6N+waQxQyK7p56axFXGFU+qRp rjYOFk8C/g4aOgjHPm7OLKrqOcWH2fUhCcZxOk+REr0STEuaprMmVqaGhmIBS1PD6k0h 3KBeCDU7IDMWz6MxMhVOD9pRBJoa+u7G3fFi5AnHNlWNGQlDSDIxTBQpttbjy4PQCURr 6xWVlcLxUwObnR95m5O1CrMPYMmYIL7M76Mdqc2KhSVzCF8sBoNNiO1Xz9qVtKzgIHym HOCA== X-Gm-Message-State: AOAM53366iVZJVnTwN6O2Z6+Afd16jT/uzMSAfMVzah/bmXEgE5xXLMM +kvpnJyVnduZLSIDcrBeo38= X-Google-Smtp-Source: ABdhPJxC1D2mvva5sNGWa1M2WUYKgdpW17USveAPUEU8MV+xucsXbvB99O2JawyIHGQPK2d7sUsGNg== X-Received: by 2002:a17:906:b2c8:: with SMTP id cf8mr73669829ejb.132.1594646592134; Mon, 13 Jul 2020 06:23:12 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:11 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [RFC PATCH 26/35] powerpc: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:38 +0200 Message-Id: <20200713122247.10985-27-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- arch/powerpc/kernel/rtas_pci.c | 4 ++-- arch/powerpc/platforms/4xx/pci.c | 4 ++-- arch/powerpc/platforms/52xx/efika.c | 4 ++-- arch/powerpc/platforms/52xx/mpc52xx_pci.c | 4 ++-- arch/powerpc/platforms/82xx/pq2.c | 2 +- arch/powerpc/platforms/85xx/mpc85xx_cds.c | 2 +- arch/powerpc/platforms/85xx/mpc85xx_ds.c | 2 +- arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 2 +- arch/powerpc/platforms/chrp/pci.c | 8 ++++---- arch/powerpc/platforms/embedded6xx/holly.c | 2 +- .../platforms/embedded6xx/mpc7448_hpc2.c | 2 +- arch/powerpc/platforms/fsl_uli1575.c | 2 +- arch/powerpc/platforms/maple/pci.c | 18 +++++++++--------- arch/powerpc/platforms/pasemi/pci.c | 6 +++--- arch/powerpc/platforms/powermac/pci.c | 8 ++++---- arch/powerpc/platforms/powernv/eeh-powernv.c | 4 ++-- arch/powerpc/platforms/powernv/pci.c | 4 ++-- arch/powerpc/platforms/pseries/eeh_pseries.c | 4 ++-- arch/powerpc/sysdev/fsl_pci.c | 2 +- arch/powerpc/sysdev/indirect_pci.c | 4 ++-- arch/powerpc/sysdev/tsi108_pci.c | 4 ++-- 21 files changed, 46 insertions(+), 46 deletions(-) diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c index 781c1869902e..18108ed9284c 100644 --- a/arch/powerpc/kernel/rtas_pci.c +++ b/arch/powerpc/kernel/rtas_pci.c @@ -71,7 +71,7 @@ int rtas_read_config(struct pci_dn *pdn, int where, int size, u32 *val) if (ret) return PCIBIOS_DEVICE_NOT_FOUND; - return PCIBIOS_SUCCESSFUL; + return 0; } static int rtas_pci_read_config(struct pci_bus *bus, @@ -121,7 +121,7 @@ int rtas_write_config(struct pci_dn *pdn, int where, int size, u32 val) if (ret) return PCIBIOS_DEVICE_NOT_FOUND; - return PCIBIOS_SUCCESSFUL; + return 0; } static int rtas_pci_write_config(struct pci_bus *bus, diff --git a/arch/powerpc/platforms/4xx/pci.c b/arch/powerpc/platforms/4xx/pci.c index c13d64c3b019..3e6799d987d2 100644 --- a/arch/powerpc/platforms/4xx/pci.c +++ b/arch/powerpc/platforms/4xx/pci.c @@ -1652,7 +1652,7 @@ static int ppc4xx_pciex_read_config(struct pci_bus *bus, unsigned int devfn, dcr_write(port->dcrs, DCRO_PEGPL_CFG, gpl_cfg); - return PCIBIOS_SUCCESSFUL; + return 0; } static int ppc4xx_pciex_write_config(struct pci_bus *bus, unsigned int devfn, @@ -1696,7 +1696,7 @@ static int ppc4xx_pciex_write_config(struct pci_bus *bus, unsigned int devfn, dcr_write(port->dcrs, DCRO_PEGPL_CFG, gpl_cfg); - return PCIBIOS_SUCCESSFUL; + return 0; } static struct pci_ops ppc4xx_pciex_pci_ops = diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c index 4514a6f7458a..ef2584eb2dad 100644 --- a/arch/powerpc/platforms/52xx/efika.c +++ b/arch/powerpc/platforms/52xx/efika.c @@ -44,7 +44,7 @@ static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset, rval = rtas_call(rtas_token("read-pci-config"), 2, 2, &ret, addr, len); *val = ret; - return rval ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; + return rval ? PCIBIOS_DEVICE_NOT_FOUND : 0; } static int rtas_write_config(struct pci_bus *bus, unsigned int devfn, @@ -58,7 +58,7 @@ static int rtas_write_config(struct pci_bus *bus, unsigned int devfn, rval = rtas_call(rtas_token("write-pci-config"), 3, 1, NULL, addr, len, val); - return rval ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; + return rval ? PCIBIOS_DEVICE_NOT_FOUND : 0; } static struct pci_ops rtas_pci_ops = { diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c index af0f79995214..b9c2d0a7077e 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c @@ -157,7 +157,7 @@ mpc52xx_pci_read_config(struct pci_bus *bus, unsigned int devfn, out_be32(hose->cfg_addr, 0); mb(); - return PCIBIOS_SUCCESSFUL; + return 0; } static int @@ -221,7 +221,7 @@ mpc52xx_pci_write_config(struct pci_bus *bus, unsigned int devfn, out_be32(hose->cfg_addr, 0); mb(); - return PCIBIOS_SUCCESSFUL; + return 0; } static struct pci_ops mpc52xx_pci_ops = { diff --git a/arch/powerpc/platforms/82xx/pq2.c b/arch/powerpc/platforms/82xx/pq2.c index 3b5cb39a564c..c15b3b0ed118 100644 --- a/arch/powerpc/platforms/82xx/pq2.c +++ b/arch/powerpc/platforms/82xx/pq2.c @@ -40,7 +40,7 @@ static int pq2_pci_exclude_device(struct pci_controller *hose, if (bus == 0 && PCI_SLOT(devfn) == 0) return PCIBIOS_DEVICE_NOT_FOUND; else - return PCIBIOS_SUCCESSFUL; + return 0; } static void __init pq2_pci_add_bridge(struct device_node *np) diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c index 172d2b7cfeb7..66f00eb2a8be 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c @@ -76,7 +76,7 @@ static int mpc85xx_exclude_device(struct pci_controller *hose, if ((bus == 0) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL)) return PCIBIOS_DEVICE_NOT_FOUND; else - return PCIBIOS_SUCCESSFUL; + return 0; } static int mpc85xx_cds_restart(struct notifier_block *this, diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index 2157a8017aa4..f33ac8e04da6 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c @@ -118,7 +118,7 @@ static int mpc85xx_exclude_device(struct pci_controller *hose, if (hose->dn == pci_with_uli) return uli_exclude_device(hose, bus, devfn); - return PCIBIOS_SUCCESSFUL; + return 0; } #endif /* CONFIG_PCI */ diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c index b697918b727d..36b38b28d40b 100644 --- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c @@ -49,7 +49,7 @@ static int mpc86xx_exclude_device(struct pci_controller *hose, if (hose->dn == fsl_pci_primary) return uli_exclude_device(hose, bus, devfn); - return PCIBIOS_SUCCESSFUL; + return 0; } #endif /* CONFIG_PCI */ diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c index b2c2bf35b76c..c8f8356607c7 100644 --- a/arch/powerpc/platforms/chrp/pci.c +++ b/arch/powerpc/platforms/chrp/pci.c @@ -55,7 +55,7 @@ static int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off, *val = in_le32(cfg_data); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off, @@ -82,7 +82,7 @@ static int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off, out_le32(cfg_data, val); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static struct pci_ops gg2_pci_ops = @@ -106,7 +106,7 @@ static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset, rval = rtas_call(rtas_token("read-pci-config"), 2, 2, &ret, addr, len); *val = ret; - return rval? PCIBIOS_DEVICE_NOT_FOUND: PCIBIOS_SUCCESSFUL; + return rval ? PCIBIOS_DEVICE_NOT_FOUND : 0; } static int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset, @@ -120,7 +120,7 @@ static int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset rval = rtas_call(rtas_token("write-pci-config"), 3, 1, NULL, addr, len, val); - return rval? PCIBIOS_DEVICE_NOT_FOUND: PCIBIOS_SUCCESSFUL; + return rval ? PCIBIOS_DEVICE_NOT_FOUND : 0; } static struct pci_ops rtas_pci_ops = diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c index d8f2e2c737bb..f9fca540c52a 100644 --- a/arch/powerpc/platforms/embedded6xx/holly.c +++ b/arch/powerpc/platforms/embedded6xx/holly.c @@ -47,7 +47,7 @@ static int holly_exclude_device(struct pci_controller *hose, u_char bus, if (bus == 0 && PCI_SLOT(devfn) == 0) return PCIBIOS_DEVICE_NOT_FOUND; else - return PCIBIOS_SUCCESSFUL; + return 0; } static void holly_remap_bridge(void) diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c index 15437abe1f6d..34f6a0ecdf67 100644 --- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c +++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c @@ -55,7 +55,7 @@ int mpc7448_hpc2_exclude_device(struct pci_controller *hose, if (bus == 0 && PCI_SLOT(devfn) == 0) return PCIBIOS_DEVICE_NOT_FOUND; else - return PCIBIOS_SUCCESSFUL; + return 0; } static void __init mpc7448_hpc2_setup_arch(void) diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c index 044a20c1fbde..17c2cb5a8682 100644 --- a/arch/powerpc/platforms/fsl_uli1575.c +++ b/arch/powerpc/platforms/fsl_uli1575.c @@ -353,5 +353,5 @@ int uli_exclude_device(struct pci_controller *hose, return PCIBIOS_DEVICE_NOT_FOUND; } - return PCIBIOS_SUCCESSFUL; + return 0; } diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c index c86a66d5e998..4e49f465056d 100644 --- a/arch/powerpc/platforms/maple/pci.c +++ b/arch/powerpc/platforms/maple/pci.c @@ -142,7 +142,7 @@ static int u3_agp_read_config(struct pci_bus *bus, unsigned int devfn, *val = in_le32(addr); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int u3_agp_write_config(struct pci_bus *bus, unsigned int devfn, @@ -173,7 +173,7 @@ static int u3_agp_write_config(struct pci_bus *bus, unsigned int devfn, out_le32(addr, val); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static struct pci_ops u3_agp_pci_ops = @@ -223,7 +223,7 @@ static int u3_ht_root_read_config(struct pci_controller *hose, u8 offset, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int u3_ht_root_write_config(struct pci_controller *hose, u8 offset, @@ -234,7 +234,7 @@ static int u3_ht_root_write_config(struct pci_controller *hose, u8 offset, addr = hose->cfg_addr + ((offset & ~3) << 2) + (4 - len - (offset & 3)); if (offset >= PCI_BASE_ADDRESS_0 && offset < PCI_CAPABILITY_LIST) - return PCIBIOS_SUCCESSFUL; + return 0; switch (len) { case 1: @@ -248,7 +248,7 @@ static int u3_ht_root_write_config(struct pci_controller *hose, u8 offset, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, @@ -286,7 +286,7 @@ static int u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, *val = in_le32(addr); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn, @@ -323,7 +323,7 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn, out_le32(addr, val); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static struct pci_ops u3_ht_pci_ops = @@ -397,7 +397,7 @@ static int u4_pcie_read_config(struct pci_bus *bus, unsigned int devfn, *val = in_le32(addr); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 val) @@ -428,7 +428,7 @@ static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn, out_le32(addr, val); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static struct pci_ops u4_pcie_pci_ops = diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c index 8779b107d872..e558a402532a 100644 --- a/arch/powerpc/platforms/pasemi/pci.c +++ b/arch/powerpc/platforms/pasemi/pci.c @@ -166,7 +166,7 @@ static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn, return PCIBIOS_BAD_REGISTER_NUMBER; if (workaround_5945(bus, devfn, offset, len, val)) - return PCIBIOS_SUCCESSFUL; + return 0; addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset); @@ -188,7 +188,7 @@ static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int pa_pxp_write_config(struct pci_bus *bus, unsigned int devfn, @@ -223,7 +223,7 @@ static int pa_pxp_write_config(struct pci_bus *bus, unsigned int devfn, out_le32(addr, val); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static struct pci_ops pa_pxp_ops = { diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index e35eaa9cf938..bdc9a89b5181 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c @@ -307,7 +307,7 @@ static int u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, default: *val = 0xfffffffful; break; } - return PCIBIOS_SUCCESSFUL; + return 0; default: return PCIBIOS_DEVICE_NOT_FOUND; } @@ -327,7 +327,7 @@ static int u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, *val = swap ? in_le32(addr) : in_be32(addr); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn, @@ -350,7 +350,7 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn, case 0: break; case 1: - return PCIBIOS_SUCCESSFUL; + return 0; default: return PCIBIOS_DEVICE_NOT_FOUND; } @@ -370,7 +370,7 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn, swap ? out_le32(addr, val) : out_be32(addr, val); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static struct pci_ops u3_ht_pci_ops = diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c index 79409e005fcd..92f145dc9c1d 100644 --- a/arch/powerpc/platforms/powernv/eeh-powernv.c +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c @@ -318,7 +318,7 @@ static int pnv_eeh_find_ecap(struct pci_dn *pdn, int cap) if (!edev || !edev->pcie_cap) return 0; - if (pnv_pci_cfg_read(pdn, pos, 4, &header) != PCIBIOS_SUCCESSFUL) + if (pnv_pci_cfg_read(pdn, pos, 4, &header) != 0) return 0; else if (!header) return 0; @@ -331,7 +331,7 @@ static int pnv_eeh_find_ecap(struct pci_dn *pdn, int cap) if (pos < 256) break; - if (pnv_pci_cfg_read(pdn, pos, 4, &header) != PCIBIOS_SUCCESSFUL) + if (pnv_pci_cfg_read(pdn, pos, 4, &header) != 0) break; } diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 091fe1cf386b..b3d5cc3e262a 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c @@ -685,7 +685,7 @@ int pnv_pci_cfg_read(struct pci_dn *pdn, pr_devel("%s: bus: %x devfn: %x +%x/%x -> %08x\n", __func__, pdn->busno, pdn->devfn, where, size, *val); - return PCIBIOS_SUCCESSFUL; + return 0; } int pnv_pci_cfg_write(struct pci_dn *pdn, @@ -710,7 +710,7 @@ int pnv_pci_cfg_write(struct pci_dn *pdn, return PCIBIOS_FUNC_NOT_SUPPORTED; } - return PCIBIOS_SUCCESSFUL; + return 0; } #if CONFIG_EEH diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c index ace117f99d94..9c023b928f2c 100644 --- a/arch/powerpc/platforms/pseries/eeh_pseries.c +++ b/arch/powerpc/platforms/pseries/eeh_pseries.c @@ -200,7 +200,7 @@ static int pseries_eeh_find_ecap(struct pci_dn *pdn, int cap) if (!edev || !edev->pcie_cap) return 0; - if (rtas_read_config(pdn, pos, 4, &header) != PCIBIOS_SUCCESSFUL) + if (rtas_read_config(pdn, pos, 4, &header) != 0) return 0; else if (!header) return 0; @@ -213,7 +213,7 @@ static int pseries_eeh_find_ecap(struct pci_dn *pdn, int cap) if (pos < 256) break; - if (rtas_read_config(pdn, pos, 4, &header) != PCIBIOS_SUCCESSFUL) + if (rtas_read_config(pdn, pos, 4, &header) != 0) break; } diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 040b9d01c079..f1118c4443f4 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -697,7 +697,7 @@ static int mpc83xx_pcie_exclude_device(struct pci_bus *bus, unsigned int devfn) return PCIBIOS_DEVICE_NOT_FOUND; } - return PCIBIOS_SUCCESSFUL; + return 0; } static void __iomem *mpc83xx_pcie_remap_cfg(struct pci_bus *bus, diff --git a/arch/powerpc/sysdev/indirect_pci.c b/arch/powerpc/sysdev/indirect_pci.c index 09b36617425e..35b21276609b 100644 --- a/arch/powerpc/sysdev/indirect_pci.c +++ b/arch/powerpc/sysdev/indirect_pci.c @@ -70,7 +70,7 @@ int __indirect_read_config(struct pci_controller *hose, *val = in_le32(cfg_data); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } int indirect_read_config(struct pci_bus *bus, unsigned int devfn, @@ -148,7 +148,7 @@ int indirect_write_config(struct pci_bus *bus, unsigned int devfn, out_le32(cfg_data, val); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static struct pci_ops indirect_pci_ops = diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c index 49f9541954f8..586dabb4e7ea 100644 --- a/arch/powerpc/sysdev/tsi108_pci.c +++ b/arch/powerpc/sysdev/tsi108_pci.c @@ -78,7 +78,7 @@ tsi108_direct_write_config(struct pci_bus *bus, unsigned int devfunc, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } void tsi108_clear_pci_error(u32 pci_cfg_base) @@ -167,7 +167,7 @@ tsi108_direct_read_config(struct pci_bus *bus, unsigned int devfn, int offset, printk("data = 0x%x\n", *val); } #endif - return PCIBIOS_SUCCESSFUL; + return 0; } void tsi108_clear_pci_cfg_error(void) From patchwork Mon Jul 13 12:22:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327972 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ayIR4bAO; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B549g2BDjz9sTb for ; Mon, 13 Jul 2020 23:24:07 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730120AbgGMNYE (ORCPT ); Mon, 13 Jul 2020 09:24:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730011AbgGMNXP (ORCPT ); Mon, 13 Jul 2020 09:23:15 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC78FC061755; Mon, 13 Jul 2020 06:23:14 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id lx13so17143595ejb.4; Mon, 13 Jul 2020 06:23:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lE8AN0pbCu/dDP6jrScw+PxyAG3fiRl3vN639OZNf9c=; b=ayIR4bAOLjTG4FPDTwj9Bv/rT1Mu5DSxUxmly1JRltd3/t49vc11ms35/6SaQTBnDW grgTbiRcbvJv/DP8VfCI2t5YIAma/O83HsL8bg6F3jmYn8DjHIHlFyBlPbwgK9NZvLpV NhVTBRZ7lKyJjY2HhB4nOgVrjuzjGx7Gbvx/0Ct/jc4ZoZkaXRHDGimKOxD6qy9dBCS+ sqcnADgH9diLoghHvHkKw+ljTOKr7vUjZGCiVth+JL4t+Oj2ZMh2VG+Nl97H8BDvhtip 06AOHg8fxgsVax5a7Dn03qBbGWuJCeSxlPhhmGspiYLN45bio5jqhu1ESiQs78Ezc6ow QJuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lE8AN0pbCu/dDP6jrScw+PxyAG3fiRl3vN639OZNf9c=; b=MxAQ13L0fuqCrtaO4VLvpk6UvuA3IjlqTjRnyzTucXKbeDd89FQK/ZApQrKmz6O/l1 c6SQXLuPlIUzvWoKm81RM2wtZK8+1ozCbgKtRba702qCqN/FYXI0lScOZkRMV1jOfbYi jjtRBbQ7C7vhhPhVf7Gt6Egrczp4DOnDFc0Q93WqneUoTIV8KK0TUxEdB9RlZnhq+1+v kseFibqktiFtvzeSMCZISWHssfhGbTXbU61kamSF1/+CAlobJasv9YHUR4xYThvH3V3v FO7ZVx248+EMXZP1cwLqsKYyB6kpE/h0Gikm7XV8+bnw+yJ6jSttIqGj1zGlkriuKbDC s1bA== X-Gm-Message-State: AOAM531iQHZbf24RQSugO5R3Nj08RJxvpTdIOaYxw0GjBbyy9uwx5T+v Kyps4cByktvBlJLMQ4H9qh0= X-Google-Smtp-Source: ABdhPJxhwheaZHFk6xB+rN51Yz6X0yo6JNfKZG64pSHUWsziY38Td4p53F5FZbITqU6TE36B/dChCA== X-Received: by 2002:a17:906:c24e:: with SMTP id bl14mr71978064ejb.285.1594646593479; Mon, 13 Jul 2020 06:23:13 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:13 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [RFC PATCH 27/35] powerpc: Tidy Success/Failure checks Date: Mon, 13 Jul 2020 14:22:39 +0200 Message-Id: <20200713122247.10985-28-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unnecessary check for 0. Signed-off-by: "Saheed O. Bolarinwa" --- This patch depends on PATCH 26/35 arch/powerpc/platforms/powernv/eeh-powernv.c | 4 ++-- arch/powerpc/platforms/pseries/eeh_pseries.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c index 92f145dc9c1d..834cb6175cc4 100644 --- a/arch/powerpc/platforms/powernv/eeh-powernv.c +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c @@ -318,7 +318,7 @@ static int pnv_eeh_find_ecap(struct pci_dn *pdn, int cap) if (!edev || !edev->pcie_cap) return 0; - if (pnv_pci_cfg_read(pdn, pos, 4, &header) != 0) + if (pnv_pci_cfg_read(pdn, pos, 4, &header)) return 0; else if (!header) return 0; @@ -331,7 +331,7 @@ static int pnv_eeh_find_ecap(struct pci_dn *pdn, int cap) if (pos < 256) break; - if (pnv_pci_cfg_read(pdn, pos, 4, &header) != 0) + if (pnv_pci_cfg_read(pdn, pos, 4, &header)) break; } diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c index 9c023b928f2c..aec6f76879a9 100644 --- a/arch/powerpc/platforms/pseries/eeh_pseries.c +++ b/arch/powerpc/platforms/pseries/eeh_pseries.c @@ -200,7 +200,7 @@ static int pseries_eeh_find_ecap(struct pci_dn *pdn, int cap) if (!edev || !edev->pcie_cap) return 0; - if (rtas_read_config(pdn, pos, 4, &header) != 0) + if (rtas_read_config(pdn, pos, 4, &header)) return 0; else if (!header) return 0; @@ -213,7 +213,7 @@ static int pseries_eeh_find_ecap(struct pci_dn *pdn, int cap) if (pos < 256) break; - if (rtas_read_config(pdn, pos, 4, &header) != 0) + if (rtas_read_config(pdn, pos, 4, &header)) break; } From patchwork Mon Jul 13 12:22:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327964 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=EsL54MmM; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B548r2H8Bz9sTC for ; Mon, 13 Jul 2020 23:23:24 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730028AbgGMNXW (ORCPT ); Mon, 13 Jul 2020 09:23:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729823AbgGMNXQ (ORCPT ); Mon, 13 Jul 2020 09:23:16 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C045C061755; Mon, 13 Jul 2020 06:23:16 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id a1so17115940ejg.12; Mon, 13 Jul 2020 06:23:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YiKDPZAVuj+rtPOroUOUnVyZ3NsBlXSRcAAbZr+8SRY=; b=EsL54MmMG5SKKbH2KJWklYr+4ydgltbH++lpIXGVgNk3o2Gr/fY/xHlMLqeOYI1TPC AhzlkDrjyXlGb0RZt/xzlbvT9zA5c01f7xEVckHCBfzd25ATATYZlSmqbkr/jsjE5wbT ksRTZHNvu56sQikovfx6CVTOTC3R5e9toRNZDZHj/6LjgCjdo0E7DzhhANuKsncnPG20 jj0IB2cMoUhkoqyR4xz2QGOTHX5Jn1/SuQ7PfO2t0JGd5FiOmJxrG8/9TyPj1vqv9iXx H7CkjHoihlyzRvDqZ5SziWw+/IQ5d9s5V2jZ2gTe7q6Dz91m6wv/o8iwJPN4e9fHbSWJ GGoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YiKDPZAVuj+rtPOroUOUnVyZ3NsBlXSRcAAbZr+8SRY=; b=bvl+5rtNuAUhJ5uvm+PzxSvGjYp6oPWgbtwRDEku324XJCtkGd8sMtoLuwE9OOgzvM fzszkqLQIQ2AJqHAfJxIn574bwyVPkZOAZsByVb6oA2PzE0IyZHKemyRtzepT7Relsh3 ArkaPfFs1PWTAjf0bxeV1B4RbnWbNUi7CZDZsCvWivJbDS6+GMbsDF8n198sYLQwdd0p HnDWDWXLejfHftZAZ+5HySD3CZBzTRo1bPZ/sYt39G2lwOCVuRc4LICPmdsxwNXhIO09 OriVVH9lSmHe6uYZya+oVFPTZaYazcDGLPw+yQn2vDHD3B/XFD1ZuH/gnGzYv0+/XzbG T09A== X-Gm-Message-State: AOAM532C14ugYNMwTm16XWZYK5VHVSrxxakjlUzQukKCL5ZiHToaghjp J1W0QYj1aNb2P6xAVc6EgBE= X-Google-Smtp-Source: ABdhPJx3AUAer2LIsCC7nq7+b17seDuCuh1+OsfEExyvO32+SViQChXeHjbL2QdmJveTzdL1nRP1LQ== X-Received: by 2002:a17:907:2058:: with SMTP id pg24mr77914815ejb.79.1594646594813; Mon, 13 Jul 2020 06:23:14 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:14 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Thomas Bogendoerfer Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org Subject: [RFC PATCH 28/35] mips: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:40 +0200 Message-Id: <20200713122247.10985-29-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- arch/mips/pci/fixup-ath79.c | 2 +- arch/mips/pci/ops-bcm63xx.c | 14 +++++++------- arch/mips/pci/ops-bonito64.c | 4 ++-- arch/mips/pci/ops-gt64xxx_pci0.c | 4 ++-- arch/mips/pci/ops-lantiq.c | 4 ++-- arch/mips/pci/ops-loongson2.c | 4 ++-- arch/mips/pci/ops-mace.c | 4 ++-- arch/mips/pci/ops-msc.c | 4 ++-- arch/mips/pci/ops-rc32434.c | 6 +++--- arch/mips/pci/ops-sni.c | 4 ++-- arch/mips/pci/ops-tx3927.c | 2 +- arch/mips/pci/ops-tx4927.c | 2 +- arch/mips/pci/ops-vr41xx.c | 4 ++-- arch/mips/pci/pci-alchemy.c | 6 +++--- arch/mips/pci/pci-ar2315.c | 4 ++-- arch/mips/pci/pci-ar71xx.c | 4 ++-- arch/mips/pci/pci-ar724x.c | 6 +++--- arch/mips/pci/pci-bcm1480.c | 4 ++-- arch/mips/pci/pci-bcm1480ht.c | 4 ++-- arch/mips/pci/pci-mt7620.c | 4 ++-- arch/mips/pci/pci-octeon.c | 12 ++++++------ arch/mips/pci/pci-rt2880.c | 4 ++-- arch/mips/pci/pci-rt3883.c | 4 ++-- arch/mips/pci/pci-sb1250.c | 4 ++-- arch/mips/pci/pci-virtio-guest.c | 4 ++-- arch/mips/pci/pci-xlp.c | 4 ++-- arch/mips/pci/pci-xlr.c | 4 ++-- arch/mips/pci/pci-xtalk-bridge.c | 14 +++++++------- arch/mips/pci/pcie-octeon.c | 4 ++-- arch/mips/txx9/generic/pci.c | 4 ++-- 30 files changed, 74 insertions(+), 74 deletions(-) diff --git a/arch/mips/pci/fixup-ath79.c b/arch/mips/pci/fixup-ath79.c index 09a4ce53424f..6a6c4f58f7f4 100644 --- a/arch/mips/pci/fixup-ath79.c +++ b/arch/mips/pci/fixup-ath79.c @@ -9,7 +9,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev) { - return PCIBIOS_SUCCESSFUL; + return 0; } int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) diff --git a/arch/mips/pci/ops-bcm63xx.c b/arch/mips/pci/ops-bcm63xx.c index dc6dc2741272..3e88e4869f37 100644 --- a/arch/mips/pci/ops-bcm63xx.c +++ b/arch/mips/pci/ops-bcm63xx.c @@ -115,7 +115,7 @@ static int bcm63xx_do_cfg_read(int type, unsigned int busn, *val = postprocess_read(data, where, size); - return PCIBIOS_SUCCESSFUL; + return 0; } static int bcm63xx_do_cfg_write(int type, unsigned int busn, @@ -141,7 +141,7 @@ static int bcm63xx_do_cfg_write(int type, unsigned int busn, /* restore IO space normal behaviour */ bcm_mpi_writel(0, MPI_L2PCFG_REG); - return PCIBIOS_SUCCESSFUL; + return 0; } static int bcm63xx_pci_read(struct pci_bus *bus, unsigned int devfn, @@ -282,7 +282,7 @@ static int fake_cb_bridge_read(int where, int size, u32 *val) } *val = postprocess_read(data, where, size); - return PCIBIOS_SUCCESSFUL; + return 0; } /* @@ -295,7 +295,7 @@ static int fake_cb_bridge_write(int where, int size, u32 val) int ret; ret = fake_cb_bridge_read((where & ~0x3), 4, &data); - if (ret != PCIBIOS_SUCCESSFUL) + if (ret != 0) return ret; data = preprocess_write(data, val, where, size); @@ -356,7 +356,7 @@ static int fake_cb_bridge_write(int where, int size, u32 val) break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int bcm63xx_cb_read(struct pci_bus *bus, unsigned int devfn, @@ -496,7 +496,7 @@ static int bcm63xx_pcie_read(struct pci_bus *bus, unsigned int devfn, *val = postprocess_read(data, where, size); - return PCIBIOS_SUCCESSFUL; + return 0; } @@ -518,7 +518,7 @@ static int bcm63xx_pcie_write(struct pci_bus *bus, unsigned int devfn, data = preprocess_write(data, val, where, size); bcm_pcie_writel(data, reg); - return PCIBIOS_SUCCESSFUL; + return 0; } diff --git a/arch/mips/pci/ops-bonito64.c b/arch/mips/pci/ops-bonito64.c index 4d5fe614f55e..0d0a5d52dee6 100644 --- a/arch/mips/pci/ops-bonito64.c +++ b/arch/mips/pci/ops-bonito64.c @@ -107,7 +107,7 @@ static int bonito64_pcibios_read(struct pci_bus *bus, unsigned int devfn, else *val = data; - return PCIBIOS_SUCCESSFUL; + return 0; } static int bonito64_pcibios_write(struct pci_bus *bus, unsigned int devfn, @@ -139,7 +139,7 @@ static int bonito64_pcibios_write(struct pci_bus *bus, unsigned int devfn, &data)) return -1; - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops bonito64_pci_ops = { diff --git a/arch/mips/pci/ops-gt64xxx_pci0.c b/arch/mips/pci/ops-gt64xxx_pci0.c index 501dcdf5a18c..d50a0ac0848d 100644 --- a/arch/mips/pci/ops-gt64xxx_pci0.c +++ b/arch/mips/pci/ops-gt64xxx_pci0.c @@ -104,7 +104,7 @@ static int gt64xxx_pci0_pcibios_read(struct pci_bus *bus, unsigned int devfn, else *val = data; - return PCIBIOS_SUCCESSFUL; + return 0; } static int gt64xxx_pci0_pcibios_write(struct pci_bus *bus, unsigned int devfn, @@ -131,7 +131,7 @@ static int gt64xxx_pci0_pcibios_write(struct pci_bus *bus, unsigned int devfn, where, &data)) return PCIBIOS_DEVICE_NOT_FOUND; - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops gt64xxx_pci0_ops = { diff --git a/arch/mips/pci/ops-lantiq.c b/arch/mips/pci/ops-lantiq.c index 7d71355394a6..9e9fd1c01199 100644 --- a/arch/mips/pci/ops-lantiq.c +++ b/arch/mips/pci/ops-lantiq.c @@ -83,7 +83,7 @@ int ltq_pci_read_config_dword(struct pci_bus *bus, unsigned int devfn, else *val = data; - return PCIBIOS_SUCCESSFUL; + return 0; } int ltq_pci_write_config_dword(struct pci_bus *bus, unsigned int devfn, @@ -109,5 +109,5 @@ int ltq_pci_write_config_dword(struct pci_bus *bus, unsigned int devfn, if (ltq_pci_config_access(PCI_ACCESS_WRITE, bus, devfn, where, &data)) return PCIBIOS_DEVICE_NOT_FOUND; - return PCIBIOS_SUCCESSFUL; + return 0; } diff --git a/arch/mips/pci/ops-loongson2.c b/arch/mips/pci/ops-loongson2.c index 0d1b36ba1c21..79d7ad3aa19f 100644 --- a/arch/mips/pci/ops-loongson2.c +++ b/arch/mips/pci/ops-loongson2.c @@ -136,7 +136,7 @@ static int loongson_pcibios_read(struct pci_bus *bus, unsigned int devfn, else *val = data; - return PCIBIOS_SUCCESSFUL; + return 0; } static int loongson_pcibios_write(struct pci_bus *bus, unsigned int devfn, @@ -168,7 +168,7 @@ static int loongson_pcibios_write(struct pci_bus *bus, unsigned int devfn, &data)) return -1; - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops loongson_pci_ops = { diff --git a/arch/mips/pci/ops-mace.c b/arch/mips/pci/ops-mace.c index 951d8070fb48..1593514d71f8 100644 --- a/arch/mips/pci/ops-mace.c +++ b/arch/mips/pci/ops-mace.c @@ -69,7 +69,7 @@ mace_pci_read_config(struct pci_bus *bus, unsigned int devfn, DPRINTK("read%d: reg=%08x,val=%02x\n", size * 8, reg, *val); - return PCIBIOS_SUCCESSFUL; + return 0; } static int @@ -91,7 +91,7 @@ mace_pci_write_config(struct pci_bus *bus, unsigned int devfn, DPRINTK("write%d: reg=%08x,val=%02x\n", size * 8, reg, val); - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops mace_pci_ops = { diff --git a/arch/mips/pci/ops-msc.c b/arch/mips/pci/ops-msc.c index 1f438baaf907..722a7992d7b5 100644 --- a/arch/mips/pci/ops-msc.c +++ b/arch/mips/pci/ops-msc.c @@ -93,7 +93,7 @@ static int msc_pcibios_read(struct pci_bus *bus, unsigned int devfn, else *val = data; - return PCIBIOS_SUCCESSFUL; + return 0; } static int msc_pcibios_write(struct pci_bus *bus, unsigned int devfn, @@ -125,7 +125,7 @@ static int msc_pcibios_write(struct pci_bus *bus, unsigned int devfn, &data)) return -1; - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops msc_pci_ops = { diff --git a/arch/mips/pci/ops-rc32434.c b/arch/mips/pci/ops-rc32434.c index 874ed6df9768..52714e58572d 100644 --- a/arch/mips/pci/ops-rc32434.c +++ b/arch/mips/pci/ops-rc32434.c @@ -140,7 +140,7 @@ write_config_byte(struct pci_bus *bus, unsigned int devfn, int where, if (config_access(PCI_ACCESS_WRITE, bus, devfn, where, &data)) return -1; - return PCIBIOS_SUCCESSFUL; + return 0; } @@ -160,7 +160,7 @@ write_config_word(struct pci_bus *bus, unsigned int devfn, int where, return -1; - return PCIBIOS_SUCCESSFUL; + return 0; } @@ -171,7 +171,7 @@ write_config_dword(struct pci_bus *bus, unsigned int devfn, int where, if (config_access(PCI_ACCESS_WRITE, bus, devfn, where, &val)) return -1; - return PCIBIOS_SUCCESSFUL; + return 0; } static int pci_config_read(struct pci_bus *bus, unsigned int devfn, diff --git a/arch/mips/pci/ops-sni.c b/arch/mips/pci/ops-sni.c index 35daa7fe6571..27468a603470 100644 --- a/arch/mips/pci/ops-sni.c +++ b/arch/mips/pci/ops-sni.c @@ -34,7 +34,7 @@ static int set_config_address(unsigned int busno, unsigned int devfn, int reg) ((devfn & 0xff) << 8) | (reg & 0xfc); - return PCIBIOS_SUCCESSFUL; + return 0; } static int pcimt_read(struct pci_bus *bus, unsigned int devfn, int reg, @@ -94,7 +94,7 @@ static int pcit_set_config_address(unsigned int busno, unsigned int devfn, int r return PCIBIOS_BAD_REGISTER_NUMBER; outl((1 << 31) | ((busno & 0xff) << 16) | ((devfn & 0xff) << 8) | (reg & 0xfc), 0xcf8); - return PCIBIOS_SUCCESSFUL; + return 0; } static int pcit_read(struct pci_bus *bus, unsigned int devfn, int reg, diff --git a/arch/mips/pci/ops-tx3927.c b/arch/mips/pci/ops-tx3927.c index d35dc9c9ab9d..7fe187879897 100644 --- a/arch/mips/pci/ops-tx3927.c +++ b/arch/mips/pci/ops-tx3927.c @@ -70,7 +70,7 @@ static inline int check_abort(void) iob(); return PCIBIOS_DEVICE_NOT_FOUND; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int tx3927_pci_read_config(struct pci_bus *bus, unsigned int devfn, diff --git a/arch/mips/pci/ops-tx4927.c b/arch/mips/pci/ops-tx4927.c index f7802f100401..1b3cea631448 100644 --- a/arch/mips/pci/ops-tx4927.c +++ b/arch/mips/pci/ops-tx4927.c @@ -74,7 +74,7 @@ static int mkaddr(struct pci_bus *bus, unsigned int devfn, int where, static int check_abort(struct tx4927_pcic_reg __iomem *pcicptr) { - int code = PCIBIOS_SUCCESSFUL; + int code = 0; /* wait write cycle completion before checking error status */ while (__raw_readl(&pcicptr->pcicstatus) & TX4927_PCIC_PCICSTATUS_IWB) diff --git a/arch/mips/pci/ops-vr41xx.c b/arch/mips/pci/ops-vr41xx.c index 7b7709aa14c7..f54cb555c743 100644 --- a/arch/mips/pci/ops-vr41xx.c +++ b/arch/mips/pci/ops-vr41xx.c @@ -70,7 +70,7 @@ static int pci_config_read(struct pci_bus *bus, unsigned int devfn, int where, return PCIBIOS_FUNC_NOT_SUPPORTED; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int pci_config_write(struct pci_bus *bus, unsigned int devfn, int where, @@ -104,7 +104,7 @@ static int pci_config_write(struct pci_bus *bus, unsigned int devfn, int where, writel(data, PCICONFDREG); - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops vr41xx_pci_ops = { diff --git a/arch/mips/pci/pci-alchemy.c b/arch/mips/pci/pci-alchemy.c index 7285b5667568..937f912fba20 100644 --- a/arch/mips/pci/pci-alchemy.c +++ b/arch/mips/pci/pci-alchemy.c @@ -103,7 +103,7 @@ static int config_access(unsigned char access_type, struct pci_bus *bus, unsigned int device = PCI_SLOT(dev_fn); unsigned int function = PCI_FUNC(dev_fn); unsigned long offset, status, cfg_base, flags, entryLo0, entryLo1, r; - int error = PCIBIOS_SUCCESSFUL; + int error = 0; if (device > 19) { *data = 0xffffffff; @@ -231,7 +231,7 @@ static int write_config_byte(struct pci_bus *bus, unsigned int devfn, if (config_access(PCI_ACCESS_WRITE, bus, devfn, where, &data)) return -1; - return PCIBIOS_SUCCESSFUL; + return 0; } static int write_config_word(struct pci_bus *bus, unsigned int devfn, @@ -248,7 +248,7 @@ static int write_config_word(struct pci_bus *bus, unsigned int devfn, if (config_access(PCI_ACCESS_WRITE, bus, devfn, where, &data)) return -1; - return PCIBIOS_SUCCESSFUL; + return 0; } static int write_config_dword(struct pci_bus *bus, unsigned int devfn, diff --git a/arch/mips/pci/pci-ar2315.c b/arch/mips/pci/pci-ar2315.c index 490953f51528..2268b63d20e8 100644 --- a/arch/mips/pci/pci-ar2315.c +++ b/arch/mips/pci/pci-ar2315.c @@ -260,7 +260,7 @@ static int ar2315_pci_cfg_access(struct ar2315_pci_ctrl *apc, unsigned devfn, 0); return isr & AR2315_PCI_INT_ABORT ? PCIBIOS_DEVICE_NOT_FOUND : - PCIBIOS_SUCCESSFUL; + 0; } static inline int ar2315_pci_local_cfg_rd(struct ar2315_pci_ctrl *apc, @@ -311,7 +311,7 @@ static int ar2315_pci_host_setup(struct ar2315_pci_ctrl *apc) u32 id; res = ar2315_pci_local_cfg_rd(apc, devfn, PCI_VENDOR_ID, &id); - if (res != PCIBIOS_SUCCESSFUL || id != AR2315_PCI_HOST_DEVID) + if (res != 0 || id != AR2315_PCI_HOST_DEVID) return -ENODEV; /* Program MBARs */ diff --git a/arch/mips/pci/pci-ar71xx.c b/arch/mips/pci/pci-ar71xx.c index a9f8e7c881bd..4216162858b1 100644 --- a/arch/mips/pci/pci-ar71xx.c +++ b/arch/mips/pci/pci-ar71xx.c @@ -182,7 +182,7 @@ static int ar71xx_pci_read_config(struct pci_bus *bus, unsigned int devfn, int err; int ret; - ret = PCIBIOS_SUCCESSFUL; + ret = 0; data = ~0; err = ar71xx_pci_set_cfgaddr(bus, devfn, where, size, @@ -206,7 +206,7 @@ static int ar71xx_pci_write_config(struct pci_bus *bus, unsigned int devfn, int ret; value = value << (8 * (where & 3)); - ret = PCIBIOS_SUCCESSFUL; + ret = 0; err = ar71xx_pci_set_cfgaddr(bus, devfn, where, size, AR71XX_PCI_CFG_CMD_WRITE); diff --git a/arch/mips/pci/pci-ar724x.c b/arch/mips/pci/pci-ar724x.c index 869d5c9a2f8d..09c607b82cfc 100644 --- a/arch/mips/pci/pci-ar724x.c +++ b/arch/mips/pci/pci-ar724x.c @@ -107,7 +107,7 @@ static int ar724x_pci_local_write(struct ar724x_pci_controller *apc, /* flush write */ __raw_readl(base + (where & ~3)); - return PCIBIOS_SUCCESSFUL; + return 0; } static int ar724x_pci_read(struct pci_bus *bus, unsigned int devfn, int where, @@ -154,7 +154,7 @@ static int ar724x_pci_read(struct pci_bus *bus, unsigned int devfn, int where, *value = data; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int ar724x_pci_write(struct pci_bus *bus, unsigned int devfn, int where, @@ -218,7 +218,7 @@ static int ar724x_pci_write(struct pci_bus *bus, unsigned int devfn, int where, /* flush write */ __raw_readl(base + (where & ~3)); - return PCIBIOS_SUCCESSFUL; + return 0; } static struct pci_ops ar724x_pci_ops = { diff --git a/arch/mips/pci/pci-bcm1480.c b/arch/mips/pci/pci-bcm1480.c index db0d4d22d46f..614f82cb42d2 100644 --- a/arch/mips/pci/pci-bcm1480.c +++ b/arch/mips/pci/pci-bcm1480.c @@ -126,7 +126,7 @@ static int bcm1480_pcibios_read(struct pci_bus *bus, unsigned int devfn, else *val = data; - return PCIBIOS_SUCCESSFUL; + return 0; } static int bcm1480_pcibios_write(struct pci_bus *bus, unsigned int devfn, @@ -156,7 +156,7 @@ static int bcm1480_pcibios_write(struct pci_bus *bus, unsigned int devfn, WRITECFG32(cfgaddr, data); - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops bcm1480_pci_ops = { diff --git a/arch/mips/pci/pci-bcm1480ht.c b/arch/mips/pci/pci-bcm1480ht.c index 3d996acd294c..249b54c499b4 100644 --- a/arch/mips/pci/pci-bcm1480ht.c +++ b/arch/mips/pci/pci-bcm1480ht.c @@ -115,7 +115,7 @@ static int bcm1480ht_pcibios_read(struct pci_bus *bus, unsigned int devfn, else *val = data; - return PCIBIOS_SUCCESSFUL; + return 0; } static int bcm1480ht_pcibios_write(struct pci_bus *bus, unsigned int devfn, @@ -145,7 +145,7 @@ static int bcm1480ht_pcibios_write(struct pci_bus *bus, unsigned int devfn, WRITECFG32(cfgaddr, data); - return PCIBIOS_SUCCESSFUL; + return 0; } static int bcm1480ht_pcibios_get_busno(void) diff --git a/arch/mips/pci/pci-mt7620.c b/arch/mips/pci/pci-mt7620.c index d36061603752..669347689d84 100644 --- a/arch/mips/pci/pci-mt7620.c +++ b/arch/mips/pci/pci-mt7620.c @@ -162,7 +162,7 @@ static int pci_config_read(struct pci_bus *bus, unsigned int devfn, int where, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int pci_config_write(struct pci_bus *bus, unsigned int devfn, int where, @@ -198,7 +198,7 @@ static int pci_config_write(struct pci_bus *bus, unsigned int devfn, int where, bridge_w32(data, RALINK_PCI_CONFIG_DATA_VIRT_REG); - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops mt7620_pci_ops = { diff --git a/arch/mips/pci/pci-octeon.c b/arch/mips/pci/pci-octeon.c index fc29b85cfa92..be6d0bf3aca4 100644 --- a/arch/mips/pci/pci-octeon.c +++ b/arch/mips/pci/pci-octeon.c @@ -273,13 +273,13 @@ static int octeon_read_config(struct pci_bus *bus, unsigned int devfn, switch (size) { case 4: *val = le32_to_cpu(cvmx_read64_uint32(pci_addr.u64)); - return PCIBIOS_SUCCESSFUL; + return 0; case 2: *val = le16_to_cpu(cvmx_read64_uint16(pci_addr.u64)); - return PCIBIOS_SUCCESSFUL; + return 0; case 1: *val = cvmx_read64_uint8(pci_addr.u64); - return PCIBIOS_SUCCESSFUL; + return 0; } return PCIBIOS_FUNC_NOT_SUPPORTED; } @@ -307,13 +307,13 @@ static int octeon_write_config(struct pci_bus *bus, unsigned int devfn, switch (size) { case 4: cvmx_write64_uint32(pci_addr.u64, cpu_to_le32(val)); - return PCIBIOS_SUCCESSFUL; + return 0; case 2: cvmx_write64_uint16(pci_addr.u64, cpu_to_le16(val)); - return PCIBIOS_SUCCESSFUL; + return 0; case 1: cvmx_write64_uint8(pci_addr.u64, val); - return PCIBIOS_SUCCESSFUL; + return 0; } return PCIBIOS_FUNC_NOT_SUPPORTED; } diff --git a/arch/mips/pci/pci-rt2880.c b/arch/mips/pci/pci-rt2880.c index e1f12e398136..4f4774c2c777 100644 --- a/arch/mips/pci/pci-rt2880.c +++ b/arch/mips/pci/pci-rt2880.c @@ -87,7 +87,7 @@ static int rt2880_pci_config_read(struct pci_bus *bus, unsigned int devfn, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int rt2880_pci_config_write(struct pci_bus *bus, unsigned int devfn, @@ -121,7 +121,7 @@ static int rt2880_pci_config_write(struct pci_bus *bus, unsigned int devfn, rt2880_pci_reg_write(data, RT2880_PCI_REG_CONFIG_DATA); spin_unlock_irqrestore(&rt2880_pci_lock, flags); - return PCIBIOS_SUCCESSFUL; + return 0; } static struct pci_ops rt2880_pci_ops = { diff --git a/arch/mips/pci/pci-rt3883.c b/arch/mips/pci/pci-rt3883.c index 0ac6346026d0..cb160ba7480f 100644 --- a/arch/mips/pci/pci-rt3883.c +++ b/arch/mips/pci/pci-rt3883.c @@ -256,7 +256,7 @@ static int rt3883_pci_config_read(struct pci_bus *bus, unsigned int devfn, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int rt3883_pci_config_write(struct pci_bus *bus, unsigned int devfn, @@ -294,7 +294,7 @@ static int rt3883_pci_config_write(struct pci_bus *bus, unsigned int devfn, rt3883_pci_w32(rpc, data, RT3883_PCI_REG_CFGDATA); - return PCIBIOS_SUCCESSFUL; + return 0; } static struct pci_ops rt3883_pci_ops = { diff --git a/arch/mips/pci/pci-sb1250.c b/arch/mips/pci/pci-sb1250.c index c3f82b280484..7f0fd484ef85 100644 --- a/arch/mips/pci/pci-sb1250.c +++ b/arch/mips/pci/pci-sb1250.c @@ -135,7 +135,7 @@ static int sb1250_pcibios_read(struct pci_bus *bus, unsigned int devfn, else *val = data; - return PCIBIOS_SUCCESSFUL; + return 0; } static int sb1250_pcibios_write(struct pci_bus *bus, unsigned int devfn, @@ -165,7 +165,7 @@ static int sb1250_pcibios_write(struct pci_bus *bus, unsigned int devfn, WRITECFG32(cfgaddr, data); - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops sb1250_pci_ops = { diff --git a/arch/mips/pci/pci-virtio-guest.c b/arch/mips/pci/pci-virtio-guest.c index 40a078bc4617..fb67b009b2cb 100644 --- a/arch/mips/pci/pci-virtio-guest.c +++ b/arch/mips/pci/pci-virtio-guest.c @@ -70,7 +70,7 @@ static int pci_virtio_guest_write_config(struct pci_bus *bus, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int pci_virtio_guest_read_config(struct pci_bus *bus, unsigned int devfn, @@ -89,7 +89,7 @@ static int pci_virtio_guest_read_config(struct pci_bus *bus, unsigned int devfn, *val = inl(PCI_CONFIG_DATA); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static struct pci_ops pci_virtio_guest_ops = { diff --git a/arch/mips/pci/pci-xlp.c b/arch/mips/pci/pci-xlp.c index 9eff9137f78e..75ea7d85913c 100644 --- a/arch/mips/pci/pci-xlp.c +++ b/arch/mips/pci/pci-xlp.c @@ -118,7 +118,7 @@ static int nlm_pcibios_read(struct pci_bus *bus, unsigned int devfn, else *val = data; - return PCIBIOS_SUCCESSFUL; + return 0; } @@ -145,7 +145,7 @@ static int nlm_pcibios_write(struct pci_bus *bus, unsigned int devfn, pci_cfg_write_32bit(bus, devfn, where, data); - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops nlm_pci_ops = { diff --git a/arch/mips/pci/pci-xlr.c b/arch/mips/pci/pci-xlr.c index 2a1c81a129ba..b6c72ac170d9 100644 --- a/arch/mips/pci/pci-xlr.c +++ b/arch/mips/pci/pci-xlr.c @@ -100,7 +100,7 @@ static int nlm_pcibios_read(struct pci_bus *bus, unsigned int devfn, else *val = data; - return PCIBIOS_SUCCESSFUL; + return 0; } @@ -127,7 +127,7 @@ static int nlm_pcibios_write(struct pci_bus *bus, unsigned int devfn, pci_cfg_write_32bit(bus, devfn, where, data); - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops nlm_pci_ops = { diff --git a/arch/mips/pci/pci-xtalk-bridge.c b/arch/mips/pci/pci-xtalk-bridge.c index 3b2552fb7735..101b18cd8817 100644 --- a/arch/mips/pci/pci-xtalk-bridge.c +++ b/arch/mips/pci/pci-xtalk-bridge.c @@ -67,7 +67,7 @@ static int ioc3_cfg_rd(void *addr, int where, int size, u32 *value, u32 sid) mask = 0xffffffffU >> ((4 - size) << 3); *value = (cf >> shift) & mask; - return PCIBIOS_SUCCESSFUL; + return 0; } static int ioc3_cfg_wr(void *addr, int where, int size, u32 value) @@ -75,7 +75,7 @@ static int ioc3_cfg_wr(void *addr, int where, int size, u32 value) u32 cf, shift, mask, smask; if ((where >= 0x14 && where < 0x40) || (where >= 0x48)) - return PCIBIOS_SUCCESSFUL; + return 0; if (get_dbe(cf, (u32 *)addr)) return PCIBIOS_DEVICE_NOT_FOUND; @@ -88,7 +88,7 @@ static int ioc3_cfg_wr(void *addr, int where, int size, u32 value) if (put_dbe(cf, (u32 *)addr)) return PCIBIOS_DEVICE_NOT_FOUND; - return PCIBIOS_SUCCESSFUL; + return 0; } static void bridge_disable_swapping(struct pci_dev *dev) @@ -149,7 +149,7 @@ static int pci_conf0_read_config(struct pci_bus *bus, unsigned int devfn, else res = get_dbe(*value, (u32 *)addr); - return res ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; + return res ? PCIBIOS_DEVICE_NOT_FOUND : 0; } static int pci_conf1_read_config(struct pci_bus *bus, unsigned int devfn, @@ -188,7 +188,7 @@ static int pci_conf1_read_config(struct pci_bus *bus, unsigned int devfn, else res = get_dbe(*value, (u32 *)addr); - return res ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; + return res ? PCIBIOS_DEVICE_NOT_FOUND : 0; } static int pci_read_config(struct pci_bus *bus, unsigned int devfn, @@ -236,7 +236,7 @@ static int pci_conf0_write_config(struct pci_bus *bus, unsigned int devfn, if (res) return PCIBIOS_DEVICE_NOT_FOUND; - return PCIBIOS_SUCCESSFUL; + return 0; } static int pci_conf1_write_config(struct pci_bus *bus, unsigned int devfn, @@ -277,7 +277,7 @@ static int pci_conf1_write_config(struct pci_bus *bus, unsigned int devfn, if (res) return PCIBIOS_DEVICE_NOT_FOUND; - return PCIBIOS_SUCCESSFUL; + return 0; } static int pci_write_config(struct pci_bus *bus, unsigned int devfn, diff --git a/arch/mips/pci/pcie-octeon.c b/arch/mips/pci/pcie-octeon.c index d919a0d813a1..11e9ed38ca2b 100644 --- a/arch/mips/pci/pcie-octeon.c +++ b/arch/mips/pci/pcie-octeon.c @@ -1703,7 +1703,7 @@ static int octeon_pcie_read_config(unsigned int pcie_port, struct pci_bus *bus, if (OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1) || OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_1)) write_c0_cvmmemctl(cvmmemctl_save.u64); - return PCIBIOS_SUCCESSFUL; + return 0; } static int octeon_pcie0_read_config(struct pci_bus *bus, unsigned int devfn, @@ -1759,7 +1759,7 @@ static int octeon_pcie_write_config(unsigned int pcie_port, struct pci_bus *bus, default: return PCIBIOS_FUNC_NOT_SUPPORTED; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int octeon_pcie0_write_config(struct pci_bus *bus, unsigned int devfn, diff --git a/arch/mips/txx9/generic/pci.c b/arch/mips/txx9/generic/pci.c index fb998726bd5d..bdff45b6b57d 100644 --- a/arch/mips/txx9/generic/pci.c +++ b/arch/mips/txx9/generic/pci.c @@ -62,7 +62,7 @@ int __init txx9_pci66_check(struct pci_controller *hose, int top_bus, continue; if (early_read_config_word(hose, top_bus, current_bus, pci_devfn, PCI_VENDOR_ID, &vid) != - PCIBIOS_SUCCESSFUL) + 0) continue; if (vid == 0xffff) continue; @@ -346,7 +346,7 @@ static void final_fixup(struct pci_dev *dev) unsigned char bist; /* Do build-in self test */ - if (pci_read_config_byte(dev, PCI_BIST, &bist) == PCIBIOS_SUCCESSFUL && + if (pci_read_config_byte(dev, PCI_BIST, &bist) == 0 && (bist & PCI_BIST_CAPABLE)) { unsigned long timeout; pci_set_power_state(dev, PCI_D0); From patchwork Mon Jul 13 12:22:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327969 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=hA2Advwg; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B549Q6v7gz9sTY for ; Mon, 13 Jul 2020 23:23:54 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730021AbgGMNXV (ORCPT ); Mon, 13 Jul 2020 09:23:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729821AbgGMNXR (ORCPT ); Mon, 13 Jul 2020 09:23:17 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58A83C061794; Mon, 13 Jul 2020 06:23:17 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id y10so17169951eje.1; Mon, 13 Jul 2020 06:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=srnOr+oWrll92VFUDRSxv+y9DkOgl2yMHs+bARSxTtw=; b=hA2Advwg9sPYlSG9PVyUZ2WxXF2yoKE51xpWubaLGvH0fSblpcRpOX7e6gGzjKV04x PMFVOsT0MkAAWHx/FNBm7u+ko/ASFkGJxc26fYHAg1vB6uPjWj33Ye1n4cHZrpXXbaRx nhZM8JRv3BAsf3daoqySITIQioWtOixUOHScO7N/T+1fau8RNPEchPtffv6+cIY97p0A eAJh12CTy0jakb/slMUfM+jjHRINUVVY3p9U6FLZ1gVHvv7eFB+K1zWa5We3M/VrwWjy YYy9yms4BEUIE0AFFnl6IE4d3AA4Egtge7EmhM4QLUcjfFMwcjEwHeibMNPRKjAO2aqm rosw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=srnOr+oWrll92VFUDRSxv+y9DkOgl2yMHs+bARSxTtw=; b=hGGltrDQCz4rJiNdm+QMwbqH3VMr1GAepcuh2BhT1zWejKcPdyOP8etxWCp6AlTCZp bTUKJ5QUkvXjUHiXnobW3gXdvzMri9alN6HEyM1bcCeK0J1+MYcXh+Rchyfl5QDo4zid GwjRJlBl21LuvY8l9jtidppqg/ikK+X2M9tuMoOCN+gSbepCyME4kSSdxgWK2lglkh4C 4Qdt9kIR+xVXZpU2CIEMCoCrajo4sfE3eh++HRAR4RGMbhjcE5xUPj3FmqzUqTvyZGNL xS6a69yszMdh0nHUXArnnJ34a+ACK322fVr06GWjKomIvypDkQB+9FlbhqxqsIh0d8zF /SeQ== X-Gm-Message-State: AOAM533uFVmwy6Q4VfmJ8d5Q0bW4dOvZhQc4/BbSeEy7l2LpVqNHcs67 k9bMkXLgO0fMilrWUFpoLTU= X-Google-Smtp-Source: ABdhPJzvG9XEXrWjvWtZEu7yzcF9rZLh2zOC+Ra/3eYp8pyZIsCiFH715AqPn92Kt0ycrF58CyNztg== X-Received: by 2002:a17:906:743:: with SMTP id z3mr9388063ejb.216.1594646596068; Mon, 13 Jul 2020 06:23:16 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:15 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Thomas Bogendoerfer Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org Subject: [RFC PATCH 29/35] mips: Tidy Success/Failure checks Date: Mon, 13 Jul 2020 14:22:41 +0200 Message-Id: <20200713122247.10985-30-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unnecessary check for 0. Signed-off-by: "Saheed O. Bolarinwa" --- This patch depends on PATCH 28/35 arch/mips/pci/ops-bcm63xx.c | 2 +- arch/mips/pci/pci-ar2315.c | 5 ++--- arch/mips/txx9/generic/pci.c | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/mips/pci/ops-bcm63xx.c b/arch/mips/pci/ops-bcm63xx.c index 3e88e4869f37..f2810af4fa24 100644 --- a/arch/mips/pci/ops-bcm63xx.c +++ b/arch/mips/pci/ops-bcm63xx.c @@ -295,7 +295,7 @@ static int fake_cb_bridge_write(int where, int size, u32 val) int ret; ret = fake_cb_bridge_read((where & ~0x3), 4, &data); - if (ret != 0) + if (ret) return ret; data = preprocess_write(data, val, where, size); diff --git a/arch/mips/pci/pci-ar2315.c b/arch/mips/pci/pci-ar2315.c index 2268b63d20e8..c2b9e62fbc18 100644 --- a/arch/mips/pci/pci-ar2315.c +++ b/arch/mips/pci/pci-ar2315.c @@ -259,8 +259,7 @@ static int ar2315_pci_cfg_access(struct ar2315_pci_ctrl *apc, unsigned devfn, ar2315_pci_reg_mask(apc, AR2315_PCI_MISC_CONFIG, AR2315_PCIMISC_CFG_SEL, 0); - return isr & AR2315_PCI_INT_ABORT ? PCIBIOS_DEVICE_NOT_FOUND : - 0; + return isr & AR2315_PCI_INT_ABORT ? PCIBIOS_DEVICE_NOT_FOUND : 0; } static inline int ar2315_pci_local_cfg_rd(struct ar2315_pci_ctrl *apc, @@ -311,7 +310,7 @@ static int ar2315_pci_host_setup(struct ar2315_pci_ctrl *apc) u32 id; res = ar2315_pci_local_cfg_rd(apc, devfn, PCI_VENDOR_ID, &id); - if (res != 0 || id != AR2315_PCI_HOST_DEVID) + if (res || id != AR2315_PCI_HOST_DEVID) return -ENODEV; /* Program MBARs */ diff --git a/arch/mips/txx9/generic/pci.c b/arch/mips/txx9/generic/pci.c index bdff45b6b57d..9da38f8fa036 100644 --- a/arch/mips/txx9/generic/pci.c +++ b/arch/mips/txx9/generic/pci.c @@ -61,8 +61,7 @@ int __init txx9_pci66_check(struct pci_controller *hose, int top_bus, if (PCI_FUNC(pci_devfn)) continue; if (early_read_config_word(hose, top_bus, current_bus, - pci_devfn, PCI_VENDOR_ID, &vid) != - 0) + pci_devfn, PCI_VENDOR_ID, &vid)) continue; if (vid == 0xffff) continue; From patchwork Mon Jul 13 12:22:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327971 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=bzzU4rig; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B549f2ddFz9sTh for ; Mon, 13 Jul 2020 23:24:06 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730115AbgGMNYD (ORCPT ); Mon, 13 Jul 2020 09:24:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730019AbgGMNXU (ORCPT ); Mon, 13 Jul 2020 09:23:20 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86DA9C061755; Mon, 13 Jul 2020 06:23:18 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id dr13so17160086ejc.3; Mon, 13 Jul 2020 06:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ySb4cVyYF18JeJj5T0tFW5w6nctyAdZFTa9nqX2wG3w=; b=bzzU4rigZM9VgRrJDuA8G5wyBzew6OWrk1bRB1hncHk2DuUfRSXS9DugQIKc+P3SL2 4q/JI8q53ZGvCgnkAgEVAwL2QWxLBuEmO6jpKHwClHiE+ceDHaXRFPmv3UeTlaDhUSpV Qd9OKdINsDyM83qMCnxqiVA17fifLRggAWNQsyb5vPCCVL1srTdbmNuNqUaJRmhsPYyp zJYRYPPNLE+A98f3jqiDrGLhVKlUw2xIDzN+eRfrWuJKy/NDKGQivQMgwjVEJHHqAEQ1 YR5OC7esz4U91cA6VE8pdCHKVv1BLtr+EzJZsU41cXjZ672C4P+VU0M4ULWWghne2yto z+UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ySb4cVyYF18JeJj5T0tFW5w6nctyAdZFTa9nqX2wG3w=; b=iLtbqfdYgCDHXI/Ns9fcjnNAlo3ZxDV/CAtxESQr4AVSmwd2OAHp7YaHNU0H9jQ/JY 8On93cmMZHQxq3gff7kezpln9U0KThQOh1UNSoVLVJlQ+jGyt4w5xle+4kXUk+sscWhd ZFkqazMrIBfORQoY1jUuLw7jWCG9rXQU+PDaNp1iOQzjNJMh5Vt6UnCLTprBe+B9voKO GUUqaIb3mav62XlxXR+15jxugHKx5yfLyl3drLvJYZSh2lTLPPCbo4GWVpVjkF8o56gw FzASDcu8LB1aS+YjGqXYAo4ZU241tOinChDP8ibP21CAGKmfhBdkDJmSfdUtnt5tHzkI rr6Q== X-Gm-Message-State: AOAM5335EscPJVlLI1NFSVivKG1hYyGDtAdVkEVwpmSZfMtdn03j2en1 g38Wu4sZ/fHfRmigYoVrlhA= X-Google-Smtp-Source: ABdhPJz3ndHhmUstEcyV1mn6y1reXaOd6GVIU3cHrLl2Y08PMWPQUjU3IZX1hl4wZmswvHyE2N4Y6Q== X-Received: by 2002:a17:906:4dd4:: with SMTP id f20mr77157529ejw.170.1594646597332; Mon, 13 Jul 2020 06:23:17 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:16 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Michal Simek Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 30/35] microblaze: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:42 +0200 Message-Id: <20200713122247.10985-31-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- arch/microblaze/pci/indirect_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/microblaze/pci/indirect_pci.c b/arch/microblaze/pci/indirect_pci.c index 1caf7d3e0eef..1f04a1f2c30b 100644 --- a/arch/microblaze/pci/indirect_pci.c +++ b/arch/microblaze/pci/indirect_pci.c @@ -65,7 +65,7 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset, *val = in_le32(cfg_data); break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int @@ -132,7 +132,7 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static struct pci_ops indirect_pci_ops = { From patchwork Mon Jul 13 12:22:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327974 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=n80txyCo; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B549v2sfNz9sTS for ; Mon, 13 Jul 2020 23:24:19 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730020AbgGMNYE (ORCPT ); Mon, 13 Jul 2020 09:24:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729996AbgGMNXU (ORCPT ); Mon, 13 Jul 2020 09:23:20 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D64C8C061794; Mon, 13 Jul 2020 06:23:19 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id z17so13652904edr.9; Mon, 13 Jul 2020 06:23:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8wbmK+ya6vHJSgI+MTiDhQKWZMMzmthLgMh2OY4MZvM=; b=n80txyCowMGw0agwpHO34CYMBjnaTUgBZm0NF31BEIRCoPc1JqzuQF5NChyyvnmjJv EUpvNZnOiq6UM7e6uY2eMEmBZq65ptv7RYBcTij58bTpkCJzq0njvYzGReCEwrmNV5RI 5gtzm53oXNXlrL6ExBGPj0YysnmlxyLW4c9ytpXGynG/qwDZkUmE2y1FObO5mcUV0L/0 wXMj7CkivYgSB0vhRcKAC9l7aIrh8DGiSAPr8YYTB/t+l2Pe9+0FjBbrXbqkKWATAoxQ Kl2j3veZd4XTP+PnTPMw3T8UA5mOfMyZf+oQlFVmZaEyzIH8DysrASAyAUCQ0M2aVWw3 3lyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8wbmK+ya6vHJSgI+MTiDhQKWZMMzmthLgMh2OY4MZvM=; b=t3sfUcvwZ7unvGUAFVq0G4zRb4pzfT0WTom9ypUUzGY0V8lyTxVrR4X9Qq+JP2U0vJ 0UxEnkiGGcqzN4tF65oSXneoEQo5Kkw3x5yIHD9xW9d1hXzIFHu4URin6QCOUKxUpnz9 fUbiA8h6xiQ+9FzxpLsOuYd5xCCWtuSw/07ePXUhM6ctzcqgUmwT4wka9EZKlv+EAMMz Zm5Sxq8aDrXsc4XgG5gOXiptfJZub/sb19Hj3OKV4ZGyiGHr1xIeQoiG/wxovDA7kORq vxrJA2UNOzct72xK7EKpdBWH/1mKxSu2v9QPxmGcTdWIdhrtzvYD0sPf1uwu5SGsY8Et j6Yw== X-Gm-Message-State: AOAM532+rzb7izcMAhVlokfpSk0XmOj+d4K+Qk4V/rg91LfNIPHl5OMG UXKHDc2DRRM1ajSvxmUPAnc= X-Google-Smtp-Source: ABdhPJy+Hs7Ue1IFdlNyMdXk8xV3FtdPl2STdVdjCaLLSaMCCO1/ac6jRmx114IfgaO4SRqNDdJKtg== X-Received: by 2002:a05:6402:1ca6:: with SMTP id cz6mr70531295edb.171.1594646598609; Mon, 13 Jul 2020 06:23:18 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:18 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Greg Ungerer , Geert Uytterhoeven Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org Subject: [RFC PATCH 31/35] m68k: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:43 +0200 Message-Id: <20200713122247.10985-32-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- arch/m68k/coldfire/pci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/m68k/coldfire/pci.c b/arch/m68k/coldfire/pci.c index 84eab0f5e00a..ecd11a19487a 100644 --- a/arch/m68k/coldfire/pci.c +++ b/arch/m68k/coldfire/pci.c @@ -64,7 +64,7 @@ static int mcf_pci_readconfig(struct pci_bus *bus, unsigned int devfn, if (bus->number == 0) { if (mcf_host_slot2sid[PCI_SLOT(devfn)] == 0) - return PCIBIOS_SUCCESSFUL; + return 0; } addr = mcf_mk_pcicar(bus->number, devfn, where); @@ -86,7 +86,7 @@ static int mcf_pci_readconfig(struct pci_bus *bus, unsigned int devfn, __raw_writel(0, PCICAR); __raw_readl(PCICAR); - return PCIBIOS_SUCCESSFUL; + return 0; } static int mcf_pci_writeconfig(struct pci_bus *bus, unsigned int devfn, @@ -96,7 +96,7 @@ static int mcf_pci_writeconfig(struct pci_bus *bus, unsigned int devfn, if (bus->number == 0) { if (mcf_host_slot2sid[PCI_SLOT(devfn)] == 0) - return PCIBIOS_SUCCESSFUL; + return 0; } addr = mcf_mk_pcicar(bus->number, devfn, where); @@ -118,7 +118,7 @@ static int mcf_pci_writeconfig(struct pci_bus *bus, unsigned int devfn, __raw_writel(0, PCICAR); __raw_readl(PCICAR); - return PCIBIOS_SUCCESSFUL; + return 0; } static struct pci_ops mcf_pci_ops = { From patchwork Mon Jul 13 12:22:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327970 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=m0hv7peU; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B549c4tz7z9sTb for ; Mon, 13 Jul 2020 23:24:04 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730099AbgGMNXw (ORCPT ); Mon, 13 Jul 2020 09:23:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730022AbgGMNXV (ORCPT ); Mon, 13 Jul 2020 09:23:21 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26A1FC08C5DD; Mon, 13 Jul 2020 06:23:21 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id f12so17133187eja.9; Mon, 13 Jul 2020 06:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oKjzi2ECxC66M2cq5pSDhTnWy5R7cPGASuD1MUUpNKk=; b=m0hv7peUSoEu1HaED1ilH8q2Yvulbgnr8sEk5ujyQpvD2p2giyiLRwEFXl2DmoMR1L XpcpPwScY6D58mgiZ/Ioslm2LleFhnPHY4LNRAaYlXM0gQLIXclEPx8E9LZTylNuIdoi gppHKD9BY4vUbMYQ1S5C5e/enekD0lYTju5DkXO12ZsDuacG6qrYtX33osQMsQPPi1xL fSx/AgLZCj+tZr81MFm0dlzvtuPxHL6e69BGtQkAgmNfQx7rYukjqvgrlWhLTejMylPX DDluL/N8T+pb9MgV1jSM43ngBwL9/AwqgSSU9XHNcC10szF7x10BAZe3IB9lZmNTYc2a 17kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oKjzi2ECxC66M2cq5pSDhTnWy5R7cPGASuD1MUUpNKk=; b=lcf0aVSgIrXyiOgXi3g4yA2kDKbUc2uLxSWvkoCQN6Iu047JTPtyUWsPx8h7ZkU505 MEWWw1byOrD0UWhoUHEssWz1h4IXqn2SGiK55Bv11TzB62BaK3gcGS6yObkwevetCQ8N 0PkqaY0mSln2eaKOAgaF9N4NtyM+1xWbc0GBHN+HQi3caP+CBlbCbWtP5Rlw6pK5pCfD W1Gm24EsBAXDjdey1RYcmGt7wj3AD2+Egj50q1MbacFyxjhvn7XyZtLJkrnTN2tEMsKv gCa13O9ndFd5MoxLWfnvhdi4QKFK8sWk+2zR1cOAKpCyWXHDUi8MxTURKhajYHlNFay3 5jAQ== X-Gm-Message-State: AOAM531Xu9i8TLrU+7iTLDg/2q2rJfP4kUHGp09GNZE7pwbyu5clw2QE 7mLQChRamk1BW9t3vEYR6W0= X-Google-Smtp-Source: ABdhPJw9vhhuR0dTOcWCGfHHtV7ehKWAbkfQuFQnlHmgFmQHxUAxscgm05NwJQ/bOktQDl+dNWLj/A== X-Received: by 2002:a17:906:1756:: with SMTP id d22mr7116853eje.29.1594646599804; Mon, 13 Jul 2020 06:23:19 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:19 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Russell King Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 32/35] arm/PCI: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:44 +0200 Message-Id: <20200713122247.10985-33-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- arch/arm/common/it8152.c | 4 ++-- arch/arm/mach-cns3xxx/pcie.c | 2 +- arch/arm/mach-footbridge/dc21285.c | 4 ++-- arch/arm/mach-iop32x/pci.c | 6 +++--- arch/arm/mach-ixp4xx/common-pci.c | 8 ++++---- arch/arm/mach-orion5x/pci.c | 4 ++-- arch/arm/plat-orion/pcie.c | 8 ++++---- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/arch/arm/common/it8152.c b/arch/arm/common/it8152.c index 9ec740cac469..331911b627c4 100644 --- a/arch/arm/common/it8152.c +++ b/arch/arm/common/it8152.c @@ -186,7 +186,7 @@ static int it8152_pci_read_config(struct pci_bus *bus, *value = v; - return PCIBIOS_SUCCESSFUL; + return 0; } static int it8152_pci_write_config(struct pci_bus *bus, @@ -216,7 +216,7 @@ static int it8152_pci_write_config(struct pci_bus *bus, __raw_writel((addr + where), IT8152_PCI_CFG_ADDR); __raw_writel((v | vtemp), IT8152_PCI_CFG_DATA); - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops it8152_ops = { diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c index e92fbd679dfb..7020071a2dc5 100644 --- a/arch/arm/mach-cns3xxx/pcie.c +++ b/arch/arm/mach-cns3xxx/pcie.c @@ -92,7 +92,7 @@ static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn, ret = pci_generic_config_read(bus, devfn, where, size, val); - if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn && + if (ret == 0 && !bus->number && !devfn && (where & 0xffc) == PCI_CLASS_REVISION) /* * RC's class is 0xb, but Linux PCI driver needs 0x604 diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c index 416462e3f5d6..5ad78b38c659 100644 --- a/arch/arm/mach-footbridge/dc21285.c +++ b/arch/arm/mach-footbridge/dc21285.c @@ -86,7 +86,7 @@ dc21285_read_config(struct pci_bus *bus, unsigned int devfn, int where, return -1; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int @@ -121,7 +121,7 @@ dc21285_write_config(struct pci_bus *bus, unsigned int devfn, int where, return -1; } - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops dc21285_ops = { diff --git a/arch/arm/mach-iop32x/pci.c b/arch/arm/mach-iop32x/pci.c index ab0010dc3145..a29d33ce20c8 100644 --- a/arch/arm/mach-iop32x/pci.c +++ b/arch/arm/mach-iop32x/pci.c @@ -118,7 +118,7 @@ iop3xx_read_config(struct pci_bus *bus, unsigned int devfn, int where, *value = val; - return PCIBIOS_SUCCESSFUL; + return 0; } static int @@ -131,7 +131,7 @@ iop3xx_write_config(struct pci_bus *bus, unsigned int devfn, int where, if (size != 4) { val = iop3xx_read(addr); if (iop3xx_pci_status()) - return PCIBIOS_SUCCESSFUL; + return 0; where = (where & 3) * 8; @@ -154,7 +154,7 @@ iop3xx_write_config(struct pci_bus *bus, unsigned int devfn, int where, "r" (IOP3XX_OCCAR), "r" (IOP3XX_OCCDR)); } - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops iop3xx_ops = { diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c index 893c19c254e3..f7cd535d4971 100644 --- a/arch/arm/mach-ixp4xx/common-pci.c +++ b/arch/arm/mach-ixp4xx/common-pci.c @@ -208,7 +208,7 @@ static int local_read_config(int where, int size, u32 *value) crp_read(where & ~3, &data); *value = (data >> (8*n)) & bytemask[size]; pr_debug("local_read_config read %#x\n", *value); - return PCIBIOS_SUCCESSFUL; + return 0; } static int local_write_config(int where, int size, u32 value) @@ -221,7 +221,7 @@ static int local_write_config(int where, int size, u32 value) return PCIBIOS_BAD_REGISTER_NUMBER; data = value << (8*n); crp_write((where & ~3) | byte_enables, data); - return PCIBIOS_SUCCESSFUL; + return 0; } static u32 byte_lane_enable_bits(u32 n, int size) @@ -255,7 +255,7 @@ static int ixp4xx_pci_read_config(struct pci_bus *bus, unsigned int devfn, int w *value = (data >> (8*n)) & bytemask[size]; pr_debug("read_config_byte read %#x\n", *value); - return PCIBIOS_SUCCESSFUL; + return 0; } static int ixp4xx_pci_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) @@ -276,7 +276,7 @@ static int ixp4xx_pci_write_config(struct pci_bus *bus, unsigned int devfn, int if (ixp4xx_pci_write(addr, byte_enables | NP_CMD_CONFIGWRITE, data)) return PCIBIOS_DEVICE_NOT_FOUND; - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops ixp4xx_ops = { diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c index 76951bfbacf5..2b587225e244 100644 --- a/arch/arm/mach-orion5x/pci.c +++ b/arch/arm/mach-orion5x/pci.c @@ -289,14 +289,14 @@ static int orion5x_pci_hw_rd_conf(int bus, int dev, u32 func, spin_unlock_irqrestore(&orion5x_pci_lock, flags); - return PCIBIOS_SUCCESSFUL; + return 0; } static int orion5x_pci_hw_wr_conf(int bus, int dev, u32 func, u32 where, u32 size, u32 val) { unsigned long flags; - int ret = PCIBIOS_SUCCESSFUL; + int ret = 0; spin_lock_irqsave(&orion5x_pci_lock, flags); diff --git a/arch/arm/plat-orion/pcie.c b/arch/arm/plat-orion/pcie.c index 8b8c06d2e9c4..6fb142f893ac 100644 --- a/arch/arm/plat-orion/pcie.c +++ b/arch/arm/plat-orion/pcie.c @@ -221,7 +221,7 @@ int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus, else if (size == 2) *val = (*val >> (8 * (where & 3))) & 0xffff; - return PCIBIOS_SUCCESSFUL; + return 0; } int orion_pcie_rd_conf_tlp(void __iomem *base, struct pci_bus *bus, @@ -244,7 +244,7 @@ int orion_pcie_rd_conf_tlp(void __iomem *base, struct pci_bus *bus, else if (size == 2) *val = (*val >> (8 * (where & 3))) & 0xffff; - return PCIBIOS_SUCCESSFUL; + return 0; } int orion_pcie_rd_conf_wa(void __iomem *wa_base, struct pci_bus *bus, @@ -260,13 +260,13 @@ int orion_pcie_rd_conf_wa(void __iomem *wa_base, struct pci_bus *bus, else if (size == 2) *val = (*val >> (8 * (where & 3))) & 0xffff; - return PCIBIOS_SUCCESSFUL; + return 0; } int orion_pcie_wr_conf(void __iomem *base, struct pci_bus *bus, u32 devfn, int where, int size, u32 val) { - int ret = PCIBIOS_SUCCESSFUL; + int ret = 0; writel(PCIE_CONF_BUS(bus->number) | PCIE_CONF_DEV(PCI_SLOT(devfn)) | From patchwork Mon Jul 13 12:22:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327967 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=NJ0hp1NN; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54971HBzz9sRN for ; Mon, 13 Jul 2020 23:23:39 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729856AbgGMNXi (ORCPT ); Mon, 13 Jul 2020 09:23:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730033AbgGMNXW (ORCPT ); Mon, 13 Jul 2020 09:23:22 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 296C4C08C5DE; Mon, 13 Jul 2020 06:23:22 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id n26so17186390ejx.0; Mon, 13 Jul 2020 06:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Q0DdfK+UqqJL8YcIl12EqmY6PSz1+/PN6RVfEMMF3Q4=; b=NJ0hp1NNApuQU8bw6tjVSWHitDg1vIDtFUaeiDmwx+ow60WBbHEGBeAnEHj2j8qP02 osWR34BF9/0x8PP9hyxdf/f30PfvtWe+O+aml4jtazke07Tlc8rIfTA/0UyD53kV/T0S rWlpmKn5qM3eaFqMksBujvyYkHysClu8JPEN4xHZOp3xZ5xRgzdKkinh7WhCxvY5JY3Y fi7mzT8DuGLOGVZz2ptsFk4NskphYU8XMgi3rCJu7VPwP/nDmOJP6fv3IlmWScA3Jgip NZMp29fPPm1OhZBhqAwiUhNo+exFWu5DYVBfDT19KBqUrNYPzkbNZqWnzLY0/B5iuezX 3aBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Q0DdfK+UqqJL8YcIl12EqmY6PSz1+/PN6RVfEMMF3Q4=; b=mTFbGknyNZ9ExnaULfz7Ix6NSGub33vS45L3Pnmw/b2uNeEdjAyWD/UfAI+LYBHxEv LwRVoHx/3U7lBkLcyL1AlIgj5ZkNao0lIZqn3bsBOErxcpDXZllqwCCrGAeXguCvOz/G 5kD7oz5AGOutffnrRkYC8yDvfknRC9TH1umc6vYulAZlx8FlBTu8L7h+2eHklZ6yF9Wm 5F73dagXNKjDuQt7ZCGRvStFcD0YlrFx1nBPRK5iOaeX4iDEBn78K+eGv3qwAwTGS1lp kSb4KwbfR+nHh5IIxN8jXs0jWW6WqX34G+ExC1E4YqwrNwu67b9RKvJWM4hjVzv9RRUT ZuDQ== X-Gm-Message-State: AOAM532YPIyu38NF5RYEyJN3K9/IF4RAQD9BE2cLY6AkTFb8GvtnhRFM hNBOBZfxq6GC09BK5UaaO1gtB825jeqzCA== X-Google-Smtp-Source: ABdhPJwnEBexXFGQz22NWjdykgIfoLXjIHNBfzIIKQCDH2Im79N2tI7W18NL0nmBRmj7cAZNYPAT3w== X-Received: by 2002:a17:906:9387:: with SMTP id l7mr70963250ejx.274.1594646600908; Mon, 13 Jul 2020 06:23:20 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:20 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Russell King Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 33/35] arm/PCI: Tidy Success/Failure checks Date: Mon, 13 Jul 2020 14:22:45 +0200 Message-Id: <20200713122247.10985-34-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unnecessary check for 0. Signed-off-by: "Saheed O. Bolarinwa" --- This patch depends on PATCH 32/35 arch/arm/mach-cns3xxx/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c index 7020071a2dc5..c249d4cbf4f0 100644 --- a/arch/arm/mach-cns3xxx/pcie.c +++ b/arch/arm/mach-cns3xxx/pcie.c @@ -92,7 +92,7 @@ static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn, ret = pci_generic_config_read(bus, devfn, where, size, val); - if (ret == 0 && !bus->number && !devfn && + if (!ret && !bus->number && !devfn && (where & 0xffc) == PCI_CLASS_REVISION) /* * RC's class is 0xb, but Linux PCI driver needs 0x604 From patchwork Mon Jul 13 12:22:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327966 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Mx+B1kxc; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54944m7Fz9sRN for ; Mon, 13 Jul 2020 23:23:36 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730040AbgGMNXY (ORCPT ); Mon, 13 Jul 2020 09:23:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729821AbgGMNXX (ORCPT ); Mon, 13 Jul 2020 09:23:23 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C43EC061755; Mon, 13 Jul 2020 06:23:23 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id g20so13696619edm.4; Mon, 13 Jul 2020 06:23:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ewjye1h5mtnawh2b0AOy7diBdGFlRi1J1uZVkQ1ixro=; b=Mx+B1kxcYcsPVJySOuS4d7N3uwuf5I6uMC0zHSUAL7ZWfvZUlQF5NQZ0aFLz5I0Bhq gxmCdhWwq5HmX9AmIw06Rna+b//mOgyX6KAyM+CYVT+0xSFmrIZwDYuOXugeDIDM0gDP aInN5wj1Va1MCb1iogxcIzNjP4mJd7znHUSr2BajRZOc1bindC8LNZx+mmuBiurjvRol gA42M50Ze7Dg6mZxyeigQumPZ/jsYiOWKy77ccH4igWM/s758GiuqLXvuv0YS+MTDEPj CamZBn3Pcwwwk6lk6uk/ukorqPz9GVntJaklhFdFhwtlp8vbfEOmsBu6nf3NY6CSMVa2 6oHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ewjye1h5mtnawh2b0AOy7diBdGFlRi1J1uZVkQ1ixro=; b=NwERSWjThK+kAyN29Hx44dZrtiYL4PMQrU4rF45czMjTC2arNP40WAoNrrzKoaTX7q uEMzPzNDLIyLgcmEMK6++X21DjCzIJLQsG9y/znUjyuAW3OUf8SH2WqY1mt65VTy79Lw KsKNADpQPXeulA2TShibC1eL8PgGP1gX+vDoMCEcu6KrJU+7V+VcTQzEEOtmhlC+jf2y TWcc785AcEv9YE2u3CddOS5RBRhehkRgR047vmMPjxF7V1AuEmREVWXybHdyrXtOPe4h 9pclzggdfP1KdNOr/rcgclQOOXDovf/jtAMgHGmGA2hySmgEZAoNfgvkslGFUNlHFQuN FMIw== X-Gm-Message-State: AOAM530HCpwFe+1qOAX9GZkRLVV+berke78CGX2HVqZvbFOOEd4N2Spg wi7nq0tj5tcb5LRsALRrAEk= X-Google-Smtp-Source: ABdhPJwjdCWmc5evl0WZ4tmvx/vOYmbbbwhXM2CIMv4V3vgcByzOPoi35qyT2hVPjVo+uxs6LAX+3Q== X-Received: by 2002:a05:6402:359:: with SMTP id r25mr66129414edw.177.1594646602240; Mon, 13 Jul 2020 06:23:22 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:21 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Richard Henderson , Ivan Kokshaysky , Matt Turner Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 34/35] PCI: Change PCIBIOS_SUCCESSFUL to 0 Date: Mon, 13 Jul 2020 14:22:46 +0200 Message-Id: <20200713122247.10985-35-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In reference to the PCI spec (Chapter 2), PCIBIOS* is an x86 concept. Their scope should be limited within arch/x86. Change all PCIBIOS_SUCCESSFUL to 0 Signed-off-by: "Saheed O. Bolarinwa" --- arch/alpha/kernel/core_apecs.c | 4 ++-- arch/alpha/kernel/core_cia.c | 4 ++-- arch/alpha/kernel/core_irongate.c | 4 ++-- arch/alpha/kernel/core_lca.c | 4 ++-- arch/alpha/kernel/core_marvel.c | 4 ++-- arch/alpha/kernel/core_mcpcia.c | 4 ++-- arch/alpha/kernel/core_polaris.c | 4 ++-- arch/alpha/kernel/core_t2.c | 4 ++-- arch/alpha/kernel/core_titan.c | 4 ++-- arch/alpha/kernel/core_tsunami.c | 4 ++-- arch/alpha/kernel/core_wildfire.c | 4 ++-- arch/alpha/kernel/sys_miata.c | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/arch/alpha/kernel/core_apecs.c b/arch/alpha/kernel/core_apecs.c index 6df765ff2b10..d74d78d92434 100644 --- a/arch/alpha/kernel/core_apecs.c +++ b/arch/alpha/kernel/core_apecs.c @@ -287,7 +287,7 @@ apecs_read_config(struct pci_bus *bus, unsigned int devfn, int where, shift = (where & 3) * 8; addr = (pci_addr << 5) + mask + APECS_CONF; *value = conf_read(addr, type1) >> (shift); - return PCIBIOS_SUCCESSFUL; + return 0; } static int @@ -304,7 +304,7 @@ apecs_write_config(struct pci_bus *bus, unsigned int devfn, int where, mask = (size - 1) * 8; addr = (pci_addr << 5) + mask + APECS_CONF; conf_write(addr, value << ((where & 3) * 8), type1); - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops apecs_pci_ops = diff --git a/arch/alpha/kernel/core_cia.c b/arch/alpha/kernel/core_cia.c index f489170201c3..25300bc19c48 100644 --- a/arch/alpha/kernel/core_cia.c +++ b/arch/alpha/kernel/core_cia.c @@ -221,7 +221,7 @@ cia_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size, shift = (where & 3) * 8; addr = (pci_addr << 5) + mask + CIA_CONF; *value = conf_read(addr, type1) >> (shift); - return PCIBIOS_SUCCESSFUL; + return 0; } static int @@ -238,7 +238,7 @@ cia_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size, mask = (size - 1) * 8; addr = (pci_addr << 5) + mask + CIA_CONF; conf_write(addr, value << ((where & 3) * 8), type1); - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops cia_pci_ops = diff --git a/arch/alpha/kernel/core_irongate.c b/arch/alpha/kernel/core_irongate.c index a9fd133a7fb2..858a2293c786 100644 --- a/arch/alpha/kernel/core_irongate.c +++ b/arch/alpha/kernel/core_irongate.c @@ -121,7 +121,7 @@ irongate_read_config(struct pci_bus *bus, unsigned int devfn, int where, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int @@ -152,7 +152,7 @@ irongate_write_config(struct pci_bus *bus, unsigned int devfn, int where, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops irongate_pci_ops = diff --git a/arch/alpha/kernel/core_lca.c b/arch/alpha/kernel/core_lca.c index 57e0750419f2..a7a00d73e2c5 100644 --- a/arch/alpha/kernel/core_lca.c +++ b/arch/alpha/kernel/core_lca.c @@ -213,7 +213,7 @@ lca_read_config(struct pci_bus *bus, unsigned int devfn, int where, mask = (size - 1) * 8; addr = (pci_addr << 5) + mask + LCA_CONF; *value = conf_read(addr) >> (shift); - return PCIBIOS_SUCCESSFUL; + return 0; } static int @@ -229,7 +229,7 @@ lca_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size, mask = (size - 1) * 8; addr = (pci_addr << 5) + mask + LCA_CONF; conf_write(addr, value << ((where & 3) * 8)); - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops lca_pci_ops = diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c index 1db9d0eb2922..c076b97a9961 100644 --- a/arch/alpha/kernel/core_marvel.c +++ b/arch/alpha/kernel/core_marvel.c @@ -561,7 +561,7 @@ marvel_read_config(struct pci_bus *bus, unsigned int devfn, int where, return PCIBIOS_FUNC_NOT_SUPPORTED; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int @@ -593,7 +593,7 @@ marvel_write_config(struct pci_bus *bus, unsigned int devfn, int where, return PCIBIOS_FUNC_NOT_SUPPORTED; } - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops marvel_pci_ops = diff --git a/arch/alpha/kernel/core_mcpcia.c b/arch/alpha/kernel/core_mcpcia.c index 74b1d018124c..fdb6d055bcc0 100644 --- a/arch/alpha/kernel/core_mcpcia.c +++ b/arch/alpha/kernel/core_mcpcia.c @@ -216,7 +216,7 @@ mcpcia_read_config(struct pci_bus *bus, unsigned int devfn, int where, *value = w; break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int @@ -233,7 +233,7 @@ mcpcia_write_config(struct pci_bus *bus, unsigned int devfn, int where, addr |= (size - 1) * 8; value = __kernel_insql(value, where & 3); conf_write(addr, value, type1, hose); - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops mcpcia_pci_ops = diff --git a/arch/alpha/kernel/core_polaris.c b/arch/alpha/kernel/core_polaris.c index 75d622d96ff2..345b9d5a116f 100644 --- a/arch/alpha/kernel/core_polaris.c +++ b/arch/alpha/kernel/core_polaris.c @@ -102,7 +102,7 @@ polaris_read_config(struct pci_bus *bus, unsigned int devfn, int where, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } @@ -134,7 +134,7 @@ polaris_write_config(struct pci_bus *bus, unsigned int devfn, int where, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops polaris_pci_ops = diff --git a/arch/alpha/kernel/core_t2.c b/arch/alpha/kernel/core_t2.c index 98d5b6ff8a76..0bbf9b028c11 100644 --- a/arch/alpha/kernel/core_t2.c +++ b/arch/alpha/kernel/core_t2.c @@ -296,7 +296,7 @@ t2_read_config(struct pci_bus *bus, unsigned int devfn, int where, shift = (where & 3) * 8; addr = (pci_addr << 5) + mask + T2_CONF; *value = conf_read(addr, type1) >> (shift); - return PCIBIOS_SUCCESSFUL; + return 0; } static int @@ -313,7 +313,7 @@ t2_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size, mask = (size - 1) * 8; addr = (pci_addr << 5) + mask + T2_CONF; conf_write(addr, value << ((where & 3) * 8), type1); - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops t2_pci_ops = diff --git a/arch/alpha/kernel/core_titan.c b/arch/alpha/kernel/core_titan.c index 2a2820fb1be6..aac94708a226 100644 --- a/arch/alpha/kernel/core_titan.c +++ b/arch/alpha/kernel/core_titan.c @@ -158,7 +158,7 @@ titan_read_config(struct pci_bus *bus, unsigned int devfn, int where, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int @@ -189,7 +189,7 @@ titan_write_config(struct pci_bus *bus, unsigned int devfn, int where, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops titan_pci_ops = diff --git a/arch/alpha/kernel/core_tsunami.c b/arch/alpha/kernel/core_tsunami.c index fc1ab73f23de..88fe80a8b41a 100644 --- a/arch/alpha/kernel/core_tsunami.c +++ b/arch/alpha/kernel/core_tsunami.c @@ -134,7 +134,7 @@ tsunami_read_config(struct pci_bus *bus, unsigned int devfn, int where, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int @@ -165,7 +165,7 @@ tsunami_write_config(struct pci_bus *bus, unsigned int devfn, int where, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops tsunami_pci_ops = diff --git a/arch/alpha/kernel/core_wildfire.c b/arch/alpha/kernel/core_wildfire.c index e8d3b033018d..012ec2f5b675 100644 --- a/arch/alpha/kernel/core_wildfire.c +++ b/arch/alpha/kernel/core_wildfire.c @@ -400,7 +400,7 @@ wildfire_read_config(struct pci_bus *bus, unsigned int devfn, int where, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } static int @@ -431,7 +431,7 @@ wildfire_write_config(struct pci_bus *bus, unsigned int devfn, int where, break; } - return PCIBIOS_SUCCESSFUL; + return 0; } struct pci_ops wildfire_pci_ops = diff --git a/arch/alpha/kernel/sys_miata.c b/arch/alpha/kernel/sys_miata.c index e1bee8f84c58..1b4c03ac34d8 100644 --- a/arch/alpha/kernel/sys_miata.c +++ b/arch/alpha/kernel/sys_miata.c @@ -185,7 +185,7 @@ miata_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) if((slot == 7) && (PCI_FUNC(dev->devfn) == 3)) { u8 irq=0; struct pci_dev *pdev = pci_get_slot(dev->bus, dev->devfn & ~7); - if(pdev == NULL || pci_read_config_byte(pdev, 0x40,&irq) != PCIBIOS_SUCCESSFUL) { + if (pdev == NULL || pci_read_config_byte(pdev, 0x40, &irq) != 0) { pci_dev_put(pdev); return -1; } From patchwork Mon Jul 13 12:22:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saheed O. Bolarinwa" X-Patchwork-Id: 1327965 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=gSWxYJ9b; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4B54935x2tz9sTK for ; Mon, 13 Jul 2020 23:23:35 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730052AbgGMNX1 (ORCPT ); Mon, 13 Jul 2020 09:23:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730045AbgGMNXZ (ORCPT ); Mon, 13 Jul 2020 09:23:25 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C23E7C061755; Mon, 13 Jul 2020 06:23:24 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id f12so17133529eja.9; Mon, 13 Jul 2020 06:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ogb36sa6vQqtiEyWjTGxiNgWIm0WCLEYPRrILza4y+A=; b=gSWxYJ9bQdXtfjpV5tTR8o48guQJpHgLZf/AFrheK3RnuqHSN8PTPjtDsp1el2JhLA xFCqfnmY4I7S2CJAQ1NmuTzbhZ+piSkoZznsvy3Ns6sv6mxGXQY1LdtWlLP+9RnLbvXe r/Z3B8mPu7oFnRhOq8liQCkwx28YatrK0EbWmFhCqq/6Rr79MhPcZV4WnSI65ji95OpV ms24mXH2uX3XY+qu+zM38pKy89l+0Gj1XPT4jmw8tkzOC0+cpGPcRFakRw5saJjkZrdH lY4jJJb8LP1Ym3wBB9vuW3lr9lDBYXspDKgKgVf6kbF4xOtHe02GGveSvba0Tbzeq0Zz tSPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ogb36sa6vQqtiEyWjTGxiNgWIm0WCLEYPRrILza4y+A=; b=Wh28Jd0x3OCWzsv47ogDDKPj98/4x+x7bcwkfJX5WNgfvevfWp2uFXKaW1nhJCIg6T MAF5pbj8TfQ+OMj/W07n+wyuq3BaZ+AniuXWErgceqjwkmMJqDwEYz/3cIxqkpO4TW+n JbQKAJ8qfcbVvc4mnrmzNs/BoD4SMQrECG0l12PxrXj2vJX0Tf+m8yRjUUNfodkhdoR4 6LGb5CM4DwN5FaFzPeSlMDIM+58/Dgeryg+kCPeTolSqz7uK+hQdEu1b7c4E8RoOxCH9 5cKcCfiIIQkPGg2bYwszuaY3vzXn7GgC7nT3GdiN5l5kk3GbbJji7OClEWhVoNDdpfyK UhIw== X-Gm-Message-State: AOAM533TpyGxBpxrmeC90F5/a+o/IuhZvsE2754rcbd9XOyk2BA3uCBS c86YRKHkQcptoI+cxJJ3k1c= X-Google-Smtp-Source: ABdhPJwwo3WT8dxUL0Kf6TWRHS0OPQZfA5A+WaxpTkL2dVH32LbSdz8Gf2rnEGSvvqVJFQLgzS7Lig== X-Received: by 2002:a17:906:7c8:: with SMTP id m8mr73051911ejc.527.1594646603546; Mon, 13 Jul 2020 06:23:23 -0700 (PDT) Received: from net.saheed (54007186.dsl.pool.telekom.hu. [84.0.113.134]) by smtp.gmail.com with ESMTPSA id n9sm11806540edr.46.2020.07.13.06.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:23:23 -0700 (PDT) From: "Saheed O. Bolarinwa" To: helgaas@kernel.org, Richard Henderson , Ivan Kokshaysky , Matt Turner Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 35/35] alpha: Tidy Success/Failure checks Date: Mon, 13 Jul 2020 14:22:47 +0200 Message-Id: <20200713122247.10985-36-refactormyself@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200713122247.10985-1-refactormyself@gmail.com> References: <20200713122247.10985-1-refactormyself@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unnecessary check for 0. Signed-off-by: "Saheed O. Bolarinwa" --- This patch depends on 34/35 arch/alpha/kernel/sys_miata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/alpha/kernel/sys_miata.c b/arch/alpha/kernel/sys_miata.c index 1b4c03ac34d8..539f803c1614 100644 --- a/arch/alpha/kernel/sys_miata.c +++ b/arch/alpha/kernel/sys_miata.c @@ -185,7 +185,7 @@ miata_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) if((slot == 7) && (PCI_FUNC(dev->devfn) == 3)) { u8 irq=0; struct pci_dev *pdev = pci_get_slot(dev->bus, dev->devfn & ~7); - if (pdev == NULL || pci_read_config_byte(pdev, 0x40, &irq) != 0) { + if (pdev == NULL || pci_read_config_byte(pdev, 0x40, &irq)) { pci_dev_put(pdev); return -1; }