]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ARM: 8873/1: perf: cleanup cppcheck shifting warning
authorPhong Tran <tranmanphong@gmail.com>
Thu, 27 Jun 2019 15:37:24 +0000 (16:37 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Fri, 23 Aug 2019 10:38:46 +0000 (11:38 +0100)
There is error from cppcheck tool.
"Shifting signed 32-bit value by 31 bits is undefined behaviour errors"

This error is false positive.
change to use BIT() macro for improvement.

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/kernel/perf_event_v7.c

index a4fb0f8b8f84a96544977bf0c31b49d6e93c714a..2924d7910b106bd10f16364852ebee0f87190367 100644 (file)
@@ -697,9 +697,9 @@ static struct attribute_group armv7_pmuv2_events_attr_group = {
 /*
  * Event filters for PMUv2
  */
-#define        ARMV7_EXCLUDE_PL1       (1 << 31)
-#define        ARMV7_EXCLUDE_USER      (1 << 30)
-#define        ARMV7_INCLUDE_HYP       (1 << 27)
+#define        ARMV7_EXCLUDE_PL1       BIT(31)
+#define        ARMV7_EXCLUDE_USER      BIT(30)
+#define        ARMV7_INCLUDE_HYP       BIT(27)
 
 /*
  * Secure debug enable reg