Commit c185f1cd authored by Leo Yan's avatar Leo Yan Committed by Arnaldo Carvalho de Melo
Browse files

perf arm-spe: Include bitops.h for BIT() macro



Include header linux/bitops.h, directly use its BIT() macro and remove
the self defined macros.

Committer notes:

Use BIT_ULL() instead of BIT to build on 32-bit arches as mentioned in
review by Andre Przywara <andre.przywara@arm.com>. I noticed the build
failure when crossbuilding to arm32 from x86_64.

Signed-off-by: default avatarLeo Yan <leo.yan@linaro.org>
Reviewed-by: default avatarAndre Przywara <andre.przywara@arm.com>
Link: https://lore.kernel.org/r/20201111071149.815-2-leo.yan@linaro.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 40714c58
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <linux/bitops.h>
#include <linux/compiler.h>
#include <linux/zalloc.h>

@@ -21,10 +22,6 @@

#include "arm-spe-decoder.h"

#ifndef BIT
#define BIT(n)		(1UL << (n))
#endif

static u64 arm_spe_calc_ip(int index, u64 payload)
{
	u8 *addr = (u8 *)&payload;
+3 −4
Original line number Diff line number Diff line
@@ -8,13 +8,12 @@
#include <string.h>
#include <endian.h>
#include <byteswap.h>
#include <linux/bitops.h>

#include "arm-spe-pkt-decoder.h"

#define BIT(n)		(1ULL << (n))

#define NS_FLAG		BIT(63)
#define EL_FLAG		(BIT(62) | BIT(61))
#define NS_FLAG		BIT_ULL(63)
#define EL_FLAG		(BIT_ULL(62) | BIT_ULL(61))

#define SPE_HEADER0_PAD			0x0
#define SPE_HEADER0_END			0x1