From patchwork Tue Feb 23 14:12:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Suthikulpanit, Suravee" X-Patchwork-Id: 62714 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1856630lbl; Tue, 23 Feb 2016 06:20:30 -0800 (PST) X-Received: by 10.66.244.194 with SMTP id xi2mr46263206pac.139.1456237230285; Tue, 23 Feb 2016 06:20:30 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qm5si47607123pac.13.2016.02.23.06.20.29; Tue, 23 Feb 2016 06:20:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753564AbcBWOU1 (ORCPT + 30 others); Tue, 23 Feb 2016 09:20:27 -0500 Received: from mail-bl2on0057.outbound.protection.outlook.com ([65.55.169.57]:10944 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753293AbcBWOOc (ORCPT ); Tue, 23 Feb 2016 09:14:32 -0500 Authentication-Results: 8bytes.org; dkim=none (message not signed) header.d=none; 8bytes.org; dmarc=none action=none header.from=amd.com; Received: from localhost.localdomain (124.121.8.20) by BLUPR12MB0436.namprd12.prod.outlook.com (10.162.92.141) with Microsoft SMTP Server (TLS) id 15.1.409.15; Tue, 23 Feb 2016 14:14:20 +0000 From: Suravee Suthikulpanit To: , , , , CC: , , , , , "Suravee Suthikulpanit" , Suravee Suthikulpanit Subject: [PATCH V5 06/10] perf/amd/iommu: Clean up perf_iommu_enable_event Date: Tue, 23 Feb 2016 08:12:40 -0600 Message-ID: <1456236764-1569-7-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1456236764-1569-1-git-send-email-Suravee.Suthikulpanit@amd.com> References: <1456236764-1569-1-git-send-email-Suravee.Suthikulpanit@amd.com> MIME-Version: 1.0 X-Originating-IP: [124.121.8.20] X-ClientProxiedBy: HKNPR06CA0045.apcprd06.prod.outlook.com (10.141.16.35) To BLUPR12MB0436.namprd12.prod.outlook.com (25.162.92.141) X-MS-Office365-Filtering-Correlation-Id: 3ac64579-21be-4f91-1e52-08d33c5ba517 X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0436; 2:uyy0kGojpDXf0+fsT3VSW89MukRTGh1JEp+cLgb82fly7Hxe04r3ZeVVduWFzAQ7/dX+rL0kRGZE8uLZcSwLS+jotyzug9ZpMnB5Fy3IAnSxXfa92HOuVgvdTMCTzaLEzAco/IveI/gvM21S87ydjrHJ6+Bpr86wBKvBOuyrsVt6oCRcqWJrK/MQL4ZyLMkQ; 3:g3imlBe/1PPotRDdyDrbnpWMVrUtn9CRmO0ivR99Okn+FsUBfsRWMc2+2fIetWljSyltOoPICKiP5dsfhlDu6gcVZCF8dz35l97HqWU8Byw5Gd3Ebf+aSlbVick2R13i; 25:8zfrju1BJ63mKGTCeU3CNB/oDOe2V1lG7ztyNngWCywJGFgbpvqmKQDySl6Rp21528Y4laon0toyH00+qQxRSjPMlGtp8laHkK3LCTBNJRUd7cvspC2EGFt5a1DrTJKZwDCrVxs/CeRvALRDlpMnS+F4FesaxFFlepyB/hbZ99Uj242La+j4prER+xvvlOjF7Y8dNicnmOm9v5tZi8SFqgK0IiPHqD1DzmkEn5paWnEo06fzBliIpoFezty19WgW0jEr02dX633awVB8Pul0Obdp3SgseRDoyt3S0tVDHfd32DWRT1MEge0aJ2EmxH25BLjb+4FGXcNWuI3WTaPiHa+UQzAnqFBSIiaoj8t4UxI= X-Microsoft-Antispam: UriScan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399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:BLUPR12MB0436; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0436; X-Forefront-PRVS: 08617F610C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(5004730100002)(48376002)(77096005)(4326007)(2950100001)(2906002)(3846002)(6116002)(42186005)(5008740100001)(19580405001)(1096002)(19580395003)(86362001)(40100003)(50466002)(586003)(122386002)(36756003)(76176999)(5001960100002)(47776003)(66066001)(50986999)(5001770100001)(189998001)(229853001)(50226001)(87976001)(92566002)(2201001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0436; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0436; 23:fi+qB9lex4QgroNa3VQVeC4SUEsZaIwupgkM+mYJZ/SHUkgCo75CzdEo3o5GEu2MTlRGZherYg9BX8bEIq4Lzp3fPzohTr4Yk004szJs7SGWT6p69XLk+fr+y3boVHmjzbYBPAdVfDmTGGypE5VHQQAJPdfU9Iak5ikleFbjFY8r7t30sLz3IxoCYeXjX2i0amGs75+QS20NVUxEi/Oah3+SOBFnxOQ/sDaurTWrSG8Rj03U87I0jU//43U/4VutQNE0LUI21lZZSXcGMl9296dfwmTVfZbLB/ArvulXUKdp0we3ZjtRA+hwM3OSxTF69gGf4thexShHf9t1nhYtcq8/khVBcUcSAEJJETX0ejWbY6JiB6jguxiHVmn9vBJke8QitdhJN4r73HAcEPNIUiLRPi/iui1ad1alQT4TUsdhlsFSKclhTccaCaLTvfTR5Oxof0unUYWBZ31Mnpn6kF4fZi+qmSuN5ieXlOusa1uUhuafBFcwq4B86jgssQIxzGe/gzzPtPx+eMf9QvpyGkvQyGMAciOeRdHnf61HmD28y0vNPVJEXSRRrSNudzRqZDGEw1EqCG8v8GpKUwvOAfl8ozW3sieVYR5Un2TglD+LvMDsRzS7L84Vz1MDW8q3Stxmlx19bHsPeC/Lq/+6cBJMxQPCSKNE0yssBt6k87eGqMUaer45GTkWARFWtX1asPv/GC+KcdQqztczONnBEwKjugu0f8jrYBDbR515SOcOU6XOlmrb7DQjI7dSUhIb6aOeraMhiLBYSmOLAWFJlwfeAQ++g1m2IAv7oeh9dqij4a/7dEggCvzeL+YH8FAlAf/GNB9XbXaxROueGFuuSqdagsLPya4yUM5n+oyTrXTQBTj/PK0P3ZboFZHKMT5dvERVGjPKkjUKMLHjssTyib4DSGw25vi6KLMTGNjUqtdBv3LSJc6fah+ydrRsK0pL X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0436; 5:QFr9VgRpEyebAeUnkUbgaiItSjZI353YTL6UdF2P74yYbmQ491rzc5XbFfl3q9W1CcSpC3SCSdXM7oJ1nAeuB5VWZN5VngWe1OJgMTDr7Fhi8xfoXWw/UgivqkxTTSjDJppQkPQ92zywvdpAdqFBAQ==; 24:sYgxH4iYt2O4TuCAvjommx5OXZflKineR4DCRKP1naburfHx6X665+WGVlYTsIq7Rrn1cRydwBObT73gYJ+C6y5r0tIFvhR8IUI1DeQPzYM=; 20:/qkq6nUowztQBDkhA+ewVOTtX1kJVm8ixyXdcND1Jr3LwRtLpBUm5DGZBRCWl9neSggBTQ3BeYV7xsFlDPrgPzHBX2pBLnXy64gYaNG9Ghvkj8Bj5xTv83RGxuWYE2U+Er0To/zc0oQ8FS/XuzNwqmTnIcFd2E1+vWmghnFzraAYMXwb+l8Dl/turWU1jYZ4Nn3VdCVSLZA+4tkQmZbahV4oSrbTOB03/Lrip2KxpsVlZRKsJdWzD8NqMJmGdU6N X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2016 14:14:20.7096 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0436 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch cleans up: * Various bitwise operations in perf_iommu_enable_event * Make use macros BIT(x) This should not affect logic and functionality. Cc: Borislav Petkov Signed-off-by: Suravee Suthikulpanit --- arch/x86/events/amd/iommu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 1.9.1 diff --git a/arch/x86/events/amd/iommu.c b/arch/x86/events/amd/iommu.c index ee7b4d3..1a678b9 100644 --- a/arch/x86/events/amd/iommu.c +++ b/arch/x86/events/amd/iommu.c @@ -253,21 +253,21 @@ static void perf_iommu_enable_event(struct perf_event *ev) amd_iommu_pc_set_reg(0, devid, bank, cntr, IOMMU_PC_COUNTER_SRC_REG, ®); - reg = 0ULL | devid | (_GET_DEVID_MASK(ev) << 32); + reg = devid | (_GET_DEVID_MASK(ev) << 32); if (reg) - reg |= (1UL << 31); + reg |= BIT(31); amd_iommu_pc_set_reg(0, devid, bank, cntr, IOMMU_PC_DEVID_MATCH_REG, ®); - reg = 0ULL | _GET_PASID(ev) | (_GET_PASID_MASK(ev) << 32); + reg = _GET_PASID(ev) | (_GET_PASID_MASK(ev) << 32); if (reg) - reg |= (1UL << 31); + reg |= BIT(31); amd_iommu_pc_set_reg(0, devid, bank, cntr, IOMMU_PC_PASID_MATCH_REG, ®); - reg = 0ULL | _GET_DOMID(ev) | (_GET_DOMID_MASK(ev) << 32); + reg = _GET_DOMID(ev) | (_GET_DOMID_MASK(ev) << 32); if (reg) - reg |= (1UL << 31); + reg |= BIT(31); amd_iommu_pc_set_reg(0, devid, bank, cntr, IOMMU_PC_DOMID_MATCH_REG, ®); }