Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp481755rwb; Wed, 28 Sep 2022 05:30:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4oK0RzYovpC8lKH1Nh2MIANnW3bGCXJS6e6d1RtBSo4qBAUxai4rp6aOIOuYfmindaV7RW X-Received: by 2002:a17:907:16a5:b0:782:8fd0:88f6 with SMTP id hc37-20020a17090716a500b007828fd088f6mr23790283ejc.476.1664368222261; Wed, 28 Sep 2022 05:30:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664368222; cv=none; d=google.com; s=arc-20160816; b=Hz5Ye14zgSEmK2RJ+Vsn6E21Useg2LeLtl/04JxooJbAgkOKMVV3abLEfkAlMWrHu/ V4R7jJHKLBy3HNYs5JQViAQNRCCprShuWXi/mjwAtSb97+2cCYLsyJnIkosFz8r+UDWY LCGsjS6vtseOeBy1nrVH9xzWWZxtSHhpK713rg+WrWPSTjk1PpgTkxu6Mtswz2hPXpH+ htfF4gBdyZpzdq6cXP1kSRnDyV0hunLBTzZhFigkGVpgb4c1MtOlf96nIUF4Hdcl33w/ 9XBLSd1OOt6GX34T21/sgSa3GtvgCJEzGbP95HJsxJA7zOfb4MsBpKV5zvd+VMy/q73S 79Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=iWzQyaj4pcz9LGIVnb0/quuZ9NoEYGR73W7Fi3A8aFo=; b=Y2Nfe521rb/KqHmTSTGffqeL7Gm+uLpXFqud/42ICBrK8qgvXgMft6dmPV0kdlTuxk xbmTF1fgMu/nC4ld705APS7ui2y5fjvDHIl61P3HESVoIUnqoShG5XEgtrnNQaMWpLlp 0Sdge0r+zSO3tLO3TMz/nDMF9TTaPX9KTCUKRqaZdrlqA2wsyknNTNf6cmSHrVVaFCKT P6tgSL9aWIWSlqtwJgtlxUpgyqBsnyk/1fsZRHUGGaLmieYm1BFy+QzB0ToePzV7zEeb FrRvQ18VwchtX5CqHT3xNn6H8Lwu63Ay0PRNkVn3jaSCKdl8b0qkxbLNbeORu/BBYlln bhuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gj8g8FWk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i32-20020a0564020f2000b00457d6203a0bsi3271046eda.62.2022.09.28.05.29.53; Wed, 28 Sep 2022 05:30:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gj8g8FWk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233488AbiI1MZy (ORCPT + 99 others); Wed, 28 Sep 2022 08:25:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233468AbiI1MZw (ORCPT ); Wed, 28 Sep 2022 08:25:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F65E8E4E7; Wed, 28 Sep 2022 05:25:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4FB70B82038; Wed, 28 Sep 2022 12:25:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3E0DC433C1; Wed, 28 Sep 2022 12:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664367949; bh=HxjRtE7qJ8SnB2Cpy1WN7fiG48wE2ef95Ior+9SMHi4=; h=From:To:Cc:Subject:Date:From; b=Gj8g8FWku3S4xd/aAMVTwd8KkXul7xp8os0OiiVAQPp6zUgyDZ1yO8uZxf+u62zCy KcLg0SlFxKpGmUTmm4iDmdSsqWBCBLEvC5yxtWgnrkVPSmHJsZDv+MhpkRPf+ETn12 FZ4Yy9Wx2VfT/SJaM7Hyu5jfJHsqOkoBh5uHujOJflYbGI8wgQ2XUt2tmeACjF9tM/ w1XYwZKey4RlFd1D+onFB6SsuCnU/aeb+zfArpNwLsRBeE0JIgooF4pU5bzMW4buue rNI8i41FWhxvfX4+FIOea1iCKey876bzV/3No+gPZfBJTfm0F93e1LCL2ZJ2BcFcX9 90tYdOEdUIP1w== Received: by pali.im (Postfix) id BFA207DE; Wed, 28 Sep 2022 14:25:45 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Linus Walleij , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PCI: ixp4xx: Use PCI_CONF1_ADDRESS() macro Date: Wed, 28 Sep 2022 14:25:39 +0200 Message-Id: <20220928122539.15116-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Simplify pci-ixp4xx.c driver code and use new PCI_CONF1_ADDRESS() macro for accessing PCI config space. Signed-off-by: Pali Rohár --- drivers/pci/controller/pci-ixp4xx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/pci-ixp4xx.c b/drivers/pci/controller/pci-ixp4xx.c index 654ac4a82beb..c83b5ae0b017 100644 --- a/drivers/pci/controller/pci-ixp4xx.c +++ b/drivers/pci/controller/pci-ixp4xx.c @@ -188,12 +188,13 @@ static u32 ixp4xx_config_addr(u8 bus_num, u16 devfn, int where) /* Root bus is always 0 in this hardware */ if (bus_num == 0) { /* type 0 */ - return BIT(32-PCI_SLOT(devfn)) | ((PCI_FUNC(devfn)) << 8) | - (where & ~3); + return (PCI_CONF1_ADDRESS(0, 0, PCI_FUNC(devfn), where) & + ~PCI_CONF1_ENABLE) | BIT(32-PCI_SLOT(devfn)); } else { /* type 1 */ - return (bus_num << 16) | ((PCI_SLOT(devfn)) << 11) | - ((PCI_FUNC(devfn)) << 8) | (where & ~3) | 1; + return (PCI_CONF1_ADDRESS(bus_num, PCI_SLOT(devfn), + PCI_FUNC(devfn), where) & + ~PCI_CONF1_ENABLE) | 1; } } -- 2.20.1