Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1557473
| From | Borislav Petkov <bp@alien8.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v7 5/7] perf/amd/iommu: Clean up perf_iommu_enable_event |
| Date | 2017-01-12 15:20 +0100 |
| Message-ID | <sYOop-4Za-3@gated-at.bofh.it> (permalink) |
| References | <sY5Ul-2zr-9@gated-at.bofh.it> <sYOop-4Za-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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 <peterz@infradead.org>
> Cc: Borislav Petkov <bp@alien8.de>
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---
> 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.
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH v7 5/7] perf/amd/iommu: Clean up perf_iommu_enable_event Borislav Petkov <bp@alien8.de> - 2017-01-12 15:20 +0100
csiph-web