From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750747AbdALOPN (ORCPT ); Thu, 12 Jan 2017 09:15:13 -0500 Received: from mail.skyhub.de ([78.46.96.112]:39385 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750733AbdALOPL (ORCPT ); Thu, 12 Jan 2017 09:15:11 -0500 Date: Thu, 12 Jan 2017 15:14:57 +0100 From: Borislav Petkov To: Suravee Suthikulpanit Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, joro@8bytes.org, peterz@infradead.org, mingo@redhat.com Subject: Re: [PATCH v7 5/7] perf/amd/iommu: Clean up perf_iommu_enable_event Message-ID: <20170112141457.aavaiabb5nerj3c3@pd.tnic> References: <1484019227-11473-1-git-send-email-Suravee.Suthikulpanit@amd.com> <1484019227-11473-6-git-send-email-Suravee.Suthikulpanit@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1484019227-11473-6-git-send-email-Suravee.Suthikulpanit@amd.com> User-Agent: NeoMutt/20161014 (1.7.1) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 09, 2017 at 09:33:45PM -0600, Suravee Suthikulpanit wrote: > 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: Peter Zijlstra > Cc: Borislav Petkov > Signed-off-by: Suravee Suthikulpanit > --- > arch/x86/events/amd/iommu.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/arch/x86/events/amd/iommu.c b/arch/x86/events/amd/iommu.c > index 9bff41d..2403c78 100644 > --- a/arch/x86/events/amd/iommu.c > +++ b/arch/x86/events/amd/iommu.c > @@ -258,21 +258,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, ®); > } > -- Ah ok, you're doing it here, good. For the next version of the patchset, please reorder all cleanups first and then the patches adding functional changes/new features. Thanks. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.