# Re: \[PATCH 01/15\] arm: perf: cleanup cppcheck shifting error

- From: Peter Zijlstra \<peterz@infradead.org\>
- Date: 2019-06-24 07:11:57 
- List: netdev
- Page: https://ratatoskr.run/netdev/2019/06/5637489
- Thread: https://ratatoskr.run/netdev/2019/06/5637122/t.md

```text
On Sun, Jun 23, 2019 at 10:12:59PM +0700, Phong Tran wrote:
> fix "Shifting signed 32-bit value by 31 bits is undefined behaviour
> errors"
> 
> [arch/arm/kernel/perf_event_v7.c:1080]: (error) Shifting signed 32-bit
> value by 31 bits is undefined behaviour
> [arch/arm/kernel/perf_event_v7.c:1436]: (error) Shifting signed 32-bit
> value by 31 bits is undefined behaviour
> [arch/arm/kernel/perf_event_v7.c:1783]: (error) Shifting signed 32-bit
> value by 31 bits is undefined behaviour

I don't think that is true; the kernel uses -fno-strict-overflow (which
implies -fwrapv) and that takes away all the signed UB.
```
