From patchwork Mon Oct 12 12:45:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11832463 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 422C7109B for ; Mon, 12 Oct 2020 12:46:42 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 12A242076E for ; Mon, 12 Oct 2020 12:46:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LoZqtaFZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 12A242076E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.5925.15387 (Exim 4.92) (envelope-from ) id 1kRxCd-0002e1-VB; Mon, 12 Oct 2020 12:45:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 5925.15387; Mon, 12 Oct 2020 12:45:23 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kRxCd-0002dq-R3; Mon, 12 Oct 2020 12:45:23 +0000 Received: by outflank-mailman (input) for mailman id 5925; Mon, 12 Oct 2020 12:45:22 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kRxCc-0002cA-QF for xen-devel@lists.xenproject.org; Mon, 12 Oct 2020 12:45:22 +0000 Received: from us-smtp-delivery-124.mimecast.com (unknown [63.128.21.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 47b22cc0-726e-4604-916d-836074c798f4; Mon, 12 Oct 2020 12:45:18 +0000 (UTC) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-146-ZTed8B7mMT2VgJR1qKIMtQ-1; Mon, 12 Oct 2020 08:45:16 -0400 Received: by mail-wr1-f69.google.com with SMTP id r8so1941961wrp.5 for ; Mon, 12 Oct 2020 05:45:16 -0700 (PDT) Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id f6sm11016383wru.50.2020.10.12.05.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 05:45:14 -0700 (PDT) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kRxCc-0002cA-QF for xen-devel@lists.xenproject.org; Mon, 12 Oct 2020 12:45:22 +0000 X-Inumbo-ID: 47b22cc0-726e-4604-916d-836074c798f4 Received: from us-smtp-delivery-124.mimecast.com (unknown [63.128.21.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 47b22cc0-726e-4604-916d-836074c798f4; Mon, 12 Oct 2020 12:45:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602506718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bwG8iSHLZW0tTYCnl2ic6/t6qmfYl8jGlMpgEnOotCs=; b=LoZqtaFZ14PMiVG5YwWZDLriI0xjyU7gGSiWQDnxzOKLHb3cwadDmXh61qzcP0A40ySUE2 MdBHKQ2YyjyqH2/HvUpEO+g/Lj8MJVewGgFov7OAbbgBhTP9E7hVojhpHOr9/MiNsDaQfr 5mQmXpW3qfQOevb7Xa+m/mWEKiM/jJg= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-146-ZTed8B7mMT2VgJR1qKIMtQ-1; Mon, 12 Oct 2020 08:45:16 -0400 X-MC-Unique: ZTed8B7mMT2VgJR1qKIMtQ-1 Received: by mail-wr1-f69.google.com with SMTP id r8so1941961wrp.5 for ; Mon, 12 Oct 2020 05:45:16 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=bwG8iSHLZW0tTYCnl2ic6/t6qmfYl8jGlMpgEnOotCs=; b=PEGS2VG6nLVSQGMPuYGKhrprPynHlFS9z2eO3q7PdJhSCQ2Buud0LMRy/R7lEFasOY mboqhm5t2SboNEjnwmcu2eiN8fygnEDXoQB0U0yX0AwdEi/J7ovI4ANov3gcSMsTI3oS lhEBla/YNRydoMF6R5QB55oJPuFFFW2V1/eidXxRGSqsRZJFtL+hgb4exIeHkTbLlpE3 3/dhY6ZFeZzu9CrhaHmomO76lz5yiBG72NLEg0ALr9NXtEyL703uRELeyz6tqcz5lTuN A1CyqLDQkPeBWDqpUQ8uWIO0wJImQ5hmQQCHQxsH0+P/V2HWw9fsRITsboQ66j8pIcDm 0SyA== X-Gm-Message-State: AOAM532qndwIchDvDaxB/ZBwbTM20TLzhmh79FFxoBluYBG68dXdaAof 5Dy7aexgAHo7qdEv34JZzVH1OuY9Af0kIe/0Tb7lljW0JDyxyE/42Re4fZ8dJIyOZlWu8GkaAr9 7iOzXDwoMnkDtVmuI+/hISbf/5N0= X-Received: by 2002:adf:dd46:: with SMTP id u6mr29753240wrm.295.1602506715238; Mon, 12 Oct 2020 05:45:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyueR4JjpNH2sLzfTjSqD0R65Ts5ka4vohHBW3dn4ShgyH1BUlk0MTIhNUHnqavD80ySjglhw== X-Received: by 2002:adf:dd46:: with SMTP id u6mr29753217wrm.295.1602506715091; Mon, 12 Oct 2020 05:45:15 -0700 (PDT) Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id f6sm11016383wru.50.2020.10.12.05.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 05:45:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-ppc@nongnu.org, qemu-trivial@nongnu.org, Paul Durrant , Aurelien Jarno , qemu-arm@nongnu.org, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Eduardo Habkost , Jiaxun Yang , Yoshinori Sato , =?utf-8?q?C=C3=A9dric_Le_Goate?= =?utf-8?q?r?= , David Gibson , Stefano Stabellini , Helge Deller , Anthony Perard , Richard Henderson , Aleksandar Markovic , xen-devel@lists.xenproject.org, Aleksandar Rikalo , Marcel Apfelbaum , Mark Cave-Ayland , Paolo Bonzini , Huacai Chen Subject: [PATCH 1/5] hw/pci-host/bonito: Make PCI_ADDR() macro more readable Date: Mon, 12 Oct 2020 14:45:02 +0200 Message-Id: <20201012124506.3406909-2-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201012124506.3406909-1-philmd@redhat.com> References: <20201012124506.3406909-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com From: Philippe Mathieu-Daudé The PCI_ADDR() macro use generic PCI fields shifted by 8-bit. Rewrite it extracting the shift operation one layer. Signed-off-by: Philippe Mathieu-Daudé --- hw/pci-host/bonito.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index a99eced0657..abb3ee86769 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -196,8 +196,8 @@ FIELD(BONGENCFG, PCIQUEUE, 12, 1) #define PCI_IDSEL_VIA686B (1 << PCI_IDSEL_VIA686B_BIT) #define PCI_ADDR(busno , devno , funno , regno) \ - ((((busno) << 16) & 0xff0000) + (((devno) << 11) & 0xf800) + \ - (((funno) << 8) & 0x700) + (regno)) + ((((busno) << 8) & 0xff00) + (((devno) << 3) & 0xf8) + \ + (((funno) & 0x7) << 8) + (regno)) typedef struct BonitoState BonitoState;