From fc44c0ba389a4baa9a533568635e2c3f90190e75 Mon Sep 17 00:00:00 2001 From: Jordan Crouse Date: Thu, 30 Jul 2020 15:14:53 -0600 Subject: [PATCH] msm_rtb: Don't lose the __user tag on relaxed reads/writes The RTB logging was accidently losing the __user tag from I/O operation addresses which caused the static analysis tools to be upset. Force a void * address for the logger but leave the original address untouched for the actual operation. Change-Id: Ic0dedbad38a49d6bfd9e102f91bbf9ae21c4c14c Signed-off-by: Jordan Crouse --- include/linux/msm_rtb.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/linux/msm_rtb.h b/include/linux/msm_rtb.h index 391c266705a0..c88502d629e2 100644 --- a/include/linux/msm_rtb.h +++ b/include/linux/msm_rtb.h @@ -69,11 +69,10 @@ int uncached_logk(enum logk_event_type log_type, void *data); /* Override the #defines in asm/io.h with the logged ones */ #define __raw_read_logged(a, _l, _t) ({ \ _t __a; \ - void *_addr = (void *)(a); \ int _ret; \ - _ret = uncached_logk(LOGK_READL, _addr); \ + _ret = uncached_logk(LOGK_READL, (__force void *) a); \ ETB_WAYPOINT; \ - __a = __raw_read##_l(_addr); \ + __a = __raw_read##_l(a); \ if (_ret) \ LOG_BARRIER; \ __a; \ @@ -136,10 +135,9 @@ int uncached_logk(enum logk_event_type log_type, void *data); #define __raw_write_logged(v, a, _t) ({ \ int _ret; \ - void *_addr = (void *)(a); \ - _ret = uncached_logk(LOGK_WRITEL, _addr); \ + _ret = uncached_logk(LOGK_WRITEL, (__force void *) a); \ ETB_WAYPOINT; \ - __raw_write##_t((v), _addr); \ + __raw_write##_t((v), a); \ if (_ret) \ LOG_BARRIER; \ })