提交 dea8fe99 编写于 作者: D Daniel Bristot de Oliveira 提交者: Zheng Zengkai

trace/osnoise: Make interval u64 on osnoise_main

mainline inclusion
from mainline-v5.14-rc1
commit 2a81afa3
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4G64B
CVE: NA

-------------------------------------------------

kernel test robot reported:

  >> kernel/trace/trace_osnoise.c:966:3: warning: comparison of distinct
     pointer types ('typeof ((interval)) *' (aka 'long long *') and
     'uint64_t *' (aka 'unsigned long long *'))
     [-Wcompare-distinct-pointer-types]
                   do_div(interval, USEC_PER_MSEC);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/div64.h:228:28: note: expanded from macro 'do_div'
           (void)(((typeof((n)) *)0) == ((uint64_t *)0));  \
                  ~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~

As interval cannot be negative because sample_period >= sample_runtime,
making interval u64 on osnoise_main() is enough to fix this problem.

Link: https://lkml.kernel.org/r/4ae1e7780563598563de079a3ef6d4d10b5f5546.1624872608.git.bristot@redhat.com

Fixes: bce29ac9 ("trace: Add osnoise tracer")
Reported-by: Nkernel test robot <lkp@intel.com>
Signed-off-by: NDaniel Bristot de Oliveira <bristot@redhat.com>
Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 6c7e28a1
......@@ -1233,7 +1233,7 @@ static struct cpumask save_cpumask;
*/
static int osnoise_main(void *data)
{
s64 interval;
u64 interval;
while (!kthread_should_stop()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册