[tip: x86/sgx] x86/sgx: Mark sgx_vepc_vm_ops static

2021-04-12 Thread tip-bot2 for Wei Yongjun
The following commit has been merged into the x86/sgx branch of tip:

Commit-ID: 523caed9efbb049339706b124185c9358c1b6477
Gitweb:
https://git.kernel.org/tip/523caed9efbb049339706b124185c9358c1b6477
Author:Wei Yongjun 
AuthorDate:Mon, 12 Apr 2021 16:00:23 
Committer: Borislav Petkov 
CommitterDate: Mon, 12 Apr 2021 19:48:32 +02:00

x86/sgx: Mark sgx_vepc_vm_ops static

Fix the following sparse warning:

  arch/x86/kernel/cpu/sgx/virt.c:95:35: warning:
symbol 'sgx_vepc_vm_ops' was not declared. Should it be static?

This symbol is not used outside of virt.c so mark it static.

 [ bp: Massage commit message. ]

Reported-by: Hulk Robot 
Signed-off-by: Wei Yongjun 
Signed-off-by: Borislav Petkov 
Link: https://lkml.kernel.org/r/20210412160023.193850-1-weiyongj...@huawei.com
---
 arch/x86/kernel/cpu/sgx/virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/sgx/virt.c b/arch/x86/kernel/cpu/sgx/virt.c
index 7d221ea..6ad165a 100644
--- a/arch/x86/kernel/cpu/sgx/virt.c
+++ b/arch/x86/kernel/cpu/sgx/virt.c
@@ -92,7 +92,7 @@ static vm_fault_t sgx_vepc_fault(struct vm_fault *vmf)
return VM_FAULT_SIGBUS;
 }
 
-const struct vm_operations_struct sgx_vepc_vm_ops = {
+static const struct vm_operations_struct sgx_vepc_vm_ops = {
.fault = sgx_vepc_fault,
 };
 


[tip: timers/core] clocksource/drivers/ingenic_ost: Fix return value check in ingenic_ost_probe()

2021-04-09 Thread tip-bot2 for Wei Yongjun
The following commit has been merged into the timers/core branch of tip:

Commit-ID: 2a65f7e2772613debd03fa2492e76a635aa04545
Gitweb:
https://git.kernel.org/tip/2a65f7e2772613debd03fa2492e76a635aa04545
Author:Wei Yongjun 
AuthorDate:Mon, 08 Mar 2021 12:30:31 
Committer: Daniel Lezcano 
CommitterDate: Thu, 08 Apr 2021 13:24:15 +02:00

clocksource/drivers/ingenic_ost: Fix return value check in ingenic_ost_probe()

In case of error, the function device_node_to_regmap() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().

Fixes: ca7b72b5a5f2 ("clocksource: Add driver for the Ingenic JZ47xx OST")
Reported-by: Hulk Robot 
Signed-off-by: Wei Yongjun 
Signed-off-by: Daniel Lezcano 
Link: https://lore.kernel.org/r/20210308123031.2285083-1-weiyongj...@huawei.com
---
 drivers/clocksource/ingenic-ost.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/ingenic-ost.c 
b/drivers/clocksource/ingenic-ost.c
index d2d6646..06d2575 100644
--- a/drivers/clocksource/ingenic-ost.c
+++ b/drivers/clocksource/ingenic-ost.c
@@ -88,9 +88,9 @@ static int __init ingenic_ost_probe(struct platform_device 
*pdev)
return PTR_ERR(ost->regs);
 
map = device_node_to_regmap(dev->parent->of_node);
-   if (!map) {
+   if (IS_ERR(map)) {
dev_err(dev, "regmap not found");
-   return -EINVAL;
+   return PTR_ERR(map);
}
 
ost->clk = devm_clk_get(dev, "ost");


[tip: x86/core] x86/kprobes: Move 'inline' to the beginning of the kprobe_is_ss() declaration

2021-03-25 Thread tip-bot2 for Wei Yongjun
The following commit has been merged into the x86/core branch of tip:

Commit-ID: 2304d14db6595bea5292bece06c4c625b12d8f89
Gitweb:
https://git.kernel.org/tip/2304d14db6595bea5292bece06c4c625b12d8f89
Author:Wei Yongjun 
AuthorDate:Wed, 24 Mar 2021 14:45:02 
Committer: Ingo Molnar 
CommitterDate: Thu, 25 Mar 2021 13:07:58 +01:00

x86/kprobes: Move 'inline' to the beginning of the kprobe_is_ss() declaration

Address this GCC warning:

  arch/x86/kernel/kprobes/core.c:940:1:
   warning: 'inline' is not at beginning of declaration 
[-Wold-style-declaration]
940 | static int nokprobe_inline kprobe_is_ss(struct kprobe_ctlblk *kcb)
| ^~

[ mingo: Tidied up the changelog. ]

Fixes: 6256e668b7af: ("x86/kprobes: Use int3 instead of debug trap for 
single-step")
Reported-by: Hulk Robot 
Signed-off-by: Wei Yongjun 
Signed-off-by: Ingo Molnar 
Acked-by: Masami Hiramatsu 
Link: https://lore.kernel.org/r/20210324144502.1154883-1-weiyongj...@huawei.com
---
 arch/x86/kernel/kprobes/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index 922a6e2..dd09021 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -940,7 +940,7 @@ static int reenter_kprobe(struct kprobe *p, struct pt_regs 
*regs,
 }
 NOKPROBE_SYMBOL(reenter_kprobe);
 
-static int nokprobe_inline kprobe_is_ss(struct kprobe_ctlblk *kcb)
+static nokprobe_inline int kprobe_is_ss(struct kprobe_ctlblk *kcb)
 {
return (kcb->kprobe_status == KPROBE_HIT_SS ||
kcb->kprobe_status == KPROBE_REENTER);


[tip: core/rcu] locktorture: Make function torture_percpu_rwsem_init() static

2020-10-09 Thread tip-bot2 for Wei Yongjun
The following commit has been merged into the core/rcu branch of tip:

Commit-ID: d49bed9abc3454bd123cbe974ecbeae119701b92
Gitweb:
https://git.kernel.org/tip/d49bed9abc3454bd123cbe974ecbeae119701b92
Author:Wei Yongjun 
AuthorDate:Fri, 03 Jul 2020 13:05:27 +08:00
Committer: Paul E. McKenney 
CommitterDate: Mon, 24 Aug 2020 18:45:32 -07:00

locktorture: Make function torture_percpu_rwsem_init() static

The sparse tool complains as follows:

kernel/locking/locktorture.c:569:6: warning:
 symbol 'torture_percpu_rwsem_init' was not declared. Should it be static?

And this function is not used outside of locktorture.c,
so this commit marks it static.

Signed-off-by: Wei Yongjun 
Signed-off-by: Paul E. McKenney 
---
 kernel/locking/locktorture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
index 9cfa5e8..62d215b 100644
--- a/kernel/locking/locktorture.c
+++ b/kernel/locking/locktorture.c
@@ -566,7 +566,7 @@ static struct lock_torture_ops rwsem_lock_ops = {
 #include 
 static struct percpu_rw_semaphore pcpu_rwsem;
 
-void torture_percpu_rwsem_init(void)
+static void torture_percpu_rwsem_init(void)
 {
BUG_ON(percpu_init_rwsem(_rwsem));
 }


[tip: core/rcu] scftorture: Make symbol 'scf_torture_rand' static

2020-10-09 Thread tip-bot2 for Wei Yongjun
The following commit has been merged into the core/rcu branch of tip:

Commit-ID: 9a52a574676f8d4aa55f69319231ce6c343b00bb
Gitweb:
https://git.kernel.org/tip/9a52a574676f8d4aa55f69319231ce6c343b00bb
Author:Wei Yongjun 
AuthorDate:Thu, 02 Jul 2020 09:56:50 -07:00
Committer: Paul E. McKenney 
CommitterDate: Mon, 24 Aug 2020 18:38:36 -07:00

scftorture: Make symbol 'scf_torture_rand' static

The sparse tool complains as follows

kernel/scftorture.c:124:1: warning:
 symbol '__pcpu_scope_scf_torture_rand' was not declared. Should it be static?

And this per-CPU variable is not used outside of scftorture.c,
so this commit marks it static.

Reported-by: Hulk Robot 
Signed-off-by: Wei Yongjun 
Signed-off-by: Paul E. McKenney 
---
 kernel/scftorture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/scftorture.c b/kernel/scftorture.c
index 8349681..9180de7 100644
--- a/kernel/scftorture.c
+++ b/kernel/scftorture.c
@@ -134,7 +134,7 @@ static atomic_t n_alloc_errs;
 static bool scfdone;
 static char *bangstr = "";
 
-DEFINE_TORTURE_RANDOM_PERCPU(scf_torture_rand);
+static DEFINE_TORTURE_RANDOM_PERCPU(scf_torture_rand);
 
 // Print torture statistics.  Caller must ensure serialization.
 static void scf_torture_stats_print(void)


[tip: core/rcu] smp: Make symbol 'csd_bug_count' static

2020-10-09 Thread tip-bot2 for Wei Yongjun
The following commit has been merged into the core/rcu branch of tip:

Commit-ID: 2b722160f1a7929f38dfb648c7bbb45f96e65a5b
Gitweb:
https://git.kernel.org/tip/2b722160f1a7929f38dfb648c7bbb45f96e65a5b
Author:Wei Yongjun 
AuthorDate:Mon, 06 Jul 2020 21:49:41 +08:00
Committer: Paul E. McKenney 
CommitterDate: Fri, 04 Sep 2020 11:53:12 -07:00

smp: Make symbol 'csd_bug_count' static

The sparse tool complains as follows:

kernel/smp.c:107:10: warning:
 symbol 'csd_bug_count' was not declared. Should it be static?

Because variable is not used outside of smp.c, this commit marks it
static.

Reported-by: Hulk Robot 
Signed-off-by: Wei Yongjun 
Signed-off-by: Paul E. McKenney 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Thomas Gleixner 
Cc: Sebastian Andrzej Siewior 
---
 kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/smp.c b/kernel/smp.c
index c5d3188..b25383d 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -106,7 +106,7 @@ static DEFINE_PER_CPU(smp_call_func_t, cur_csd_func);
 static DEFINE_PER_CPU(void *, cur_csd_info);
 
 #define CSD_LOCK_TIMEOUT (5ULL * NSEC_PER_SEC)
-atomic_t csd_bug_count = ATOMIC_INIT(0);
+static atomic_t csd_bug_count = ATOMIC_INIT(0);
 
 /* Record current CSD work for current CPU, NULL to erase. */
 static void csd_lock_record(call_single_data_t *csd)


[tip: locking/kcsan] kcsan: Use GFP_ATOMIC under spin lock

2020-05-08 Thread tip-bot2 for Wei Yongjun
The following commit has been merged into the locking/kcsan branch of tip:

Commit-ID: 52785b6ae8eded7ac99d65c92d989b702e5b4376
Gitweb:
https://git.kernel.org/tip/52785b6ae8eded7ac99d65c92d989b702e5b4376
Author:Wei Yongjun 
AuthorDate:Fri, 17 Apr 2020 02:58:37 
Committer: Paul E. McKenney 
CommitterDate: Mon, 27 Apr 2020 11:10:10 -07:00

kcsan: Use GFP_ATOMIC under spin lock

A spin lock is held in insert_report_filterlist(), so the krealloc()
should use GFP_ATOMIC.  This commit therefore makes this change.

Reviewed-by: Marco Elver 
Signed-off-by: Wei Yongjun 
Signed-off-by: Paul E. McKenney 
---
 kernel/kcsan/debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/kcsan/debugfs.c b/kernel/kcsan/debugfs.c
index 1a08664..023e49c 100644
--- a/kernel/kcsan/debugfs.c
+++ b/kernel/kcsan/debugfs.c
@@ -230,7 +230,7 @@ static ssize_t insert_report_filterlist(const char *func)
/* initial allocation */
report_filterlist.addrs =
kmalloc_array(report_filterlist.size,
- sizeof(unsigned long), GFP_KERNEL);
+ sizeof(unsigned long), GFP_ATOMIC);
if (report_filterlist.addrs == NULL) {
ret = -ENOMEM;
goto out;
@@ -240,7 +240,7 @@ static ssize_t insert_report_filterlist(const char *func)
size_t new_size = report_filterlist.size * 2;
unsigned long *new_addrs =
krealloc(report_filterlist.addrs,
-new_size * sizeof(unsigned long), GFP_KERNEL);
+new_size * sizeof(unsigned long), GFP_ATOMIC);
 
if (new_addrs == NULL) {
/* leave filterlist itself untouched */