[PATCH] workqueue: fix memory leak in wq_numa_init()

2018-08-05 Thread Yi Wang
The 'tbl' variable may leak when return in function wq_numa_init(), and this patch fixes this. Signed-off-by: Yi Wang Reviewed-by: Jiang Biao --- kernel/workqueue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 78b1920..9321a05 10

[PATCH] x86/apic: fix two slight indenting

2018-07-26 Thread Yi Wang
There are two inconsistent indenting in calibrate_APIC_clock() and activate_managed(). Remove the surplus TAB. Signed-off-by: Yi Wang Reviewed-by: Jiang Biao --- arch/x86/kernel/apic/apic.c | 2 +- arch/x86/kernel/apic/vector.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff

[PATCH] sched/topology: check variable group before dereferenced

2018-07-22 Thread Yi Wang
dereference. Signed-off-by: Yi Wang Reviewed-by: Jiang Biao --- kernel/sched/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 5ac724b..c7cf87c 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c

[PATCH] timer: Fix coding style

2018-07-15 Thread Yi Wang
From: Yi Wang There are two tab at the end of function trigger_dyntick_cpu(), so remove one and correct indentation. Signed-off-by: Yi Wang Reviewed-by: Jiang Biao --- kernel/time/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/timer.c b/kernel/time

[PATCH] soc/fsl/qe: fix err handling of ucc_of_parse_tdm

2018-11-21 Thread Yi Wang
From: Wen Yang Currently there are 2 problems with the ucc_of_parse_tdm function: 1,a possible null pointer dereference in ucc_of_parse_tdm, detected by the semantic patch deref_null.cocci, with the following warning: drivers/soc/fsl/qe/qe_tdm.c:177:21-24: ERROR: pdev is NULL but dereferenced. 2,

[PATCH] sched/rt: Fix -Wmissing-prototypes warnings

2018-11-12 Thread Yi Wang
We get a warning when building kernel with W=1: kernel/sched/rt.c:626:6: warning: no previous prototype for ‘sched_rt_bandwidth_account’ [-Wmissing-prototypes] bool sched_rt_bandwidth_account(struct rt_rq *rt_rq) Add the missing declaration to fix this. Signed-off-by: Yi Wang --- kernel

[PATCH] x86/irq: Fix -Wmissing-prototypes warning for init_IRQ()

2018-11-12 Thread Yi Wang
We get a warning when building kernel with W=1: arch/x86/kernel/irqinit.c:79:13: warning: no previous prototype for ‘init_IRQ’ [-Wmissing-prototypes] void __init init_IRQ(void) ^ Add the missing declaration in head file to fix this. Signed-off-by: Yi Wang --- arch/x86/include

[PATCH] x86/tsc: Fix -Wmissing-prototypes warning for calibrate_delay_is_known()

2018-11-12 Thread Yi Wang
: Yi Wang --- arch/x86/include/asm/tsc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h index eb5bbfe..8a0c25c 100644 --- a/arch/x86/include/asm/tsc.h +++ b/arch/x86/include/asm/tsc.h @@ -35,6 +35,7 @@ static inline cycles_t get_cycles

[PATCH] x86/process: Fix some -Wmissing-prototypes warnings

2018-11-12 Thread Yi Wang
/kernel/process.c:784:6: warning: no previous prototype for ‘do_arch_prctl_common’ [-Wmissing-prototypes] Add the missing including files to fix this. Signed-off-by: Yi Wang --- arch/x86/kernel/process.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/process.c b/arch/x86

[PATCH] fork: Fix two -Wmissing-prototypes warnings

2018-11-12 Thread Yi Wang
fix this. Signed-off-by: Yi Wang --- arch/x86/include/asm/thread_info.h | 1 + include/linux/sched/task.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index 2ff2a30..8621036 100644 --- a/arch/x86/include/asm

[PATCH v2] fork: Fix some -Wmissing-prototypes warnings

2018-11-13 Thread Yi Wang
this. Also, remove arch_release_thread_stack() completely because no arch seems to implement it since bb9d81264 (arch: remove tile port). Signed-off-by: Yi Wang --- v2: remove arch_release_thread_stack(). Thanks to Rasmus. --- include/linux/sched/task.h | 2 ++ init/main.c| 1

[PATCH] sched/deadline: Fix indent in pick_next_task_dl()

2018-08-15 Thread Yi Wang
Substitute spaces with tab before the call of function dequeue_pushable_dl_task(). Signed-off-by: Yi Wang Reviewed-by: Jiang Biao --- kernel/sched/deadline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 997ea7b

[PATCH] x86/kvm/vmx: Fix coding style in vmx_setup_l1d_flush()

2018-08-15 Thread Yi Wang
Substitute spaces with tab. No functional changes. Signed-off-by: Yi Wang Reviewed-by: Jiang Biao --- arch/x86/kvm/vmx.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 46b428c0..ef712b2 100644 --- a/arch/x86

[PATCH] virtio:linux:kernel:NULL check after kmalloc is needed

2019-01-07 Thread Yi Wang
From: "huang.zijiang" NULL check is needed because kmalloc maybe return NULL. Signed-off-by: huang.zijiang --- tools/virtio/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h index 7ef45a4..2afcad8 100644 --- a/tools/v

[PATCH] x86:kernel:e820c:kmemdup instead of duplicating its function

2019-01-07 Thread Yi Wang
From: "huang.zijiang" kmemdup has implemented the function that kmalloc() and memcpy(). Signed-off-by: huang.zijiang --- arch/x86/kernel/e820.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 50895c2..a687d10 10

[PATCH] fsl/fman: avoid sleeping in atomic context while adding an address

2019-01-03 Thread Yi Wang
From: Junhua Huang dev_set_rx_mode will call function pointer mac_dev->add_hash_mac_addr while holding spin_lock_bh. The function pointer points to memac_add_hash_mac_address when ethernet type is fman-memac, which will kmalloc use GFP_KERNEL flag. / # ifconfig eth2 192.168.1.168 [ 576.604544]

[PATCH] x86/hyper-v: Fix indent in hv_do_fast_hypercall16()

2018-10-29 Thread Yi Wang
Remove the surplus TAB in hv_do_fast_hypercall16(). Signed-off-by: Yi Wang --- arch/x86/include/asm/mshyperv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h index 0d6271c..1d0a777 100644 --- a/arch/x86

[PATCH] clk: boston: fix possible memory leak in clk_boston_setup()

2018-10-29 Thread Yi Wang
'onecell' is malloced in clk_boston_setup(), but not be freed before leaving from the error handling cases. Signed-off-by: Yi Wang --- drivers/clk/imgtec/clk-boston.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/clk/imgtec/clk-boston.c b/d

[PATCH v2] clk: boston: fix possible memory leak in clk_boston_setup()

2018-10-29 Thread Yi Wang
'onecell' is malloced in clk_boston_setup(), but is not freed before leaving from the error handling cases. Signed-off-by: Yi Wang --- v2: fix syntax issue in comment, thanks to Sergei. drivers/clk/imgtec/clk-boston.c | 11 --- 1 file changed, 8 insertions(+), 3 deletion

[PATCH v3 0/2] fix memory leak and unregister issue in clk_boston_setup()

2018-10-31 Thread Yi Wang
This fix two issues in clk_boston_setup() function: - possible memory leak of 'onecell' - registered clks not unregister when error happens Changes from v2: - include smatch to the commit - unregister clks which registered before going out Yi Wang (2): clk: boston: fix possible memo

[PATCH v3 1/2] clk: boston: fix possible memory leak in clk_boston_setup()

2018-10-31 Thread Yi Wang
ible memory leak of 'onecell' 'onecell' is malloced in clk_boston_setup(), but not be freed before leaving from the error handling cases. Signed-off-by: Yi Wang --- drivers/clk/imgtec/clk-boston.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff -

[PATCH v3 2/2] clk: boston: unregister clks on failure in clk_boston_setup()

2018-10-31 Thread Yi Wang
The registered clks should unregister when something wrong happens before going out in function clk_boston_setup(). Signed-off-by: Yi Wang --- drivers/clk/imgtec/clk-boston.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/clk/imgtec/clk-boston.c

[PATCH] x86/irq: fix build warning in irq.c

2018-11-06 Thread Yi Wang
smp_kvm_posted_intr_wakeup_ipi(struct pt_regs *regs) ^ arch/x86/kernel/irq.c:328:16: warning: no previous prototype for ‘smp_kvm_posted_intr_nested_ipi’ [-Wmissing-prototypes] __visible void smp_kvm_posted_intr_nested_ipi(struct pt_regs *regs) ^ Signed-off-by: Yi Wang --- arch

[PATCH] cpuset: remove set but not used variable 'cs'

2018-11-06 Thread Yi Wang
This fixes the following warning: kernel/cgroup/cpuset.c: In function ‘cpuset_cancel_attach’: kernel/cgroup/cpuset.c:1501:17: warning: variable ‘cs’ set but not used [-Wunused-but-set-variable] struct cpuset *cs; ^ Signed-off-by: Yi Wang --- kernel/cgroup/cpuset.c | 2 -- 1

[PATCH 0/3] x86/cpu: fix some prototype warning

2018-11-07 Thread Yi Wang
This series of patch fix some prototype warning because of missing include file. Yi Wang (3): x86/cpu: fix prototype warning in cacheinfo.c x86/cpu: fix prototype warning in scattered.c x86/cpu: fix prototype warning in topology.c arch/x86/kernel/cpu/cacheinfo.c | 1 + arch/x86/kernel/cpu

[PATCH 3/3] x86/cpu: fix prototype warning in topology.c

2018-11-07 Thread Yi Wang
-off-by: Yi Wang --- arch/x86/kernel/cpu/topology.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/cpu/topology.c b/arch/x86/kernel/cpu/topology.c index 71ca064..8f6c784 100644 --- a/arch/x86/kernel/cpu/topology.c +++ b/arch/x86/kernel/cpu/topology.c @@ -10,6 +10,8

[PATCH 1/3] x86/cpu: fix prototype warning in cacheinfo.c

2018-11-07 Thread Yi Wang
-off-by: Yi Wang --- arch/x86/kernel/cpu/cacheinfo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/cpu/cacheinfo.c b/arch/x86/kernel/cpu/cacheinfo.c index dc1b934..5bafd93 100644 --- a/arch/x86/kernel/cpu/cacheinfo.c +++ b/arch/x86/kernel/cpu/cacheinfo.c @@ -19,6 +19,7

[PATCH 2/3] x86/cpu: fix prototype warning in scattered.c

2018-11-07 Thread Yi Wang
-off-by: Yi Wang --- arch/x86/kernel/cpu/scattered.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c index 772c219..5b6866f 100644 --- a/arch/x86/kernel/cpu/scattered.c +++ b/arch/x86/kernel/cpu/scattered.c @@ -9,6 +9,8

[PATCH v2] x86/cpu: fix prototype warning

2018-11-07 Thread Yi Wang
/x86/kernel/cpu/topology.c:25:5: warning: no previous prototype for ‘detect_extended_topology_early’ [-Wmissing-prototypes] arch/x86/kernel/cpu/topology.c:57:5: warning: no previous prototype for ‘detect_extended_topology’ [-Wmissing-prototypes] Signed-off-by: Yi Wang --- v2: merge the series into

[PATCH] x86/kvm/vmx: fix old-style function declaration

2018-11-07 Thread Yi Wang
ot at beginning of declaration [-Wold-style-declaration] arch/x86/kvm/vmx.c:5985:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration] arch/x86/kvm/vmx.c:6023:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration] Signed-off-by: Yi

[PATCH] sched/fair: make some function static

2018-11-07 Thread Yi Wang
totype for ‘task_tick_numa’ [-Wmissing-prototypes] kernel/sched/fair.c:3548:6: warning: no previous prototype for ‘sync_entity_load_avg’ [-Wmissing-prototypes] kernel/sched/fair.c:3561:6: warning: no previous prototype for ‘remove_entity_load_avg’ [-Wmissing-prototypes] Signed-off-by: Yi Wang -

[PATCH] KVM: x86: fix empty-body warnings

2018-11-08 Thread Yi Wang
empty-body] arch/x86/kvm/lapic.c:1936:65: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] arch/x86/kvm/lapic.c:1975:44: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] Rework the debug helper macro to get rid of these warnings. Signed-

[RESEND PATCH] sched/fair: fix a comment in task_numa_fault()

2018-11-04 Thread Yi Wang
Fix the comment in task_numa_fault() to avoid confusing. Signed-off-by: Yi Wang Reviewed-by: Xi Xu --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 908c9cd..6430c0a 100644 --- a/kernel/sched/fair.c

[PATCH] sched/numa: fix choosing isolated CPUs when task_numa_migrate()

2018-10-21 Thread Yi Wang
checking the load_balance_mask. Signed-off-by: Yi Wang Reviewed-by: Yi Liu --- kernel/sched/fair.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 908c9cd..0fa0cee 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1709,6

[PATCH] sched/fair: fix a comment in task_numa_fault()

2018-10-22 Thread Yi Wang
Fix the comment in task_numa_fault() to avoid confusing. Signed-off-by: Yi Wang Reviewed-by: Xi Xu --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 908c9cd..6430c0a 100644 --- a/kernel/sched/fair.c

[PATCH v2] misc: mic: Remove the error message as the call will print it

2020-05-30 Thread Yi Wang
From: Liao Pingfang The message should just be dropped as the call will print the failure message anyway. Signed-off-by: Liao Pingfang --- changes in v2: remove the message instead of changing it. drivers/misc/mic/host/mic_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/misc

[PATCH] fs: Fix some comments in open.c and read_write.c

2020-08-12 Thread Yi Wang
From: Liao Pingfang Correct comments in open.c, since the parameter(opened/cred) is not used anymore. Also correct size to maxsize in read_write.c. Signed-off-by: Liao Pingfang Signed-off-by: Yi Wang --- fs/open.c | 2 -- fs/read_write.c | 2 +- 2 files changed, 1 insertion(+), 3

[PATCH] virtio_pci_modern: Fix the comment of virtio_pci_find_capability()

2020-08-03 Thread Yi Wang
From: Liao Pingfang Fix the comment of virtio_pci_find_capability() by adding missing comment for the last parameter: bars. Fixes: 59a5b0f7bf74 ("virtio-pci: alloc only resources actually used.") Signed-off-by: Liao Pingfang Signed-off-by: Yi Wang --- drivers/virtio/virtio_pci_mo

[PATCH] ipv6: Not to probe neighbourless routes

2019-08-27 Thread Yi Wang
From: Cheng Lin Originally, Router Reachability Probing require a neighbour entry existed. Commit 2152caea7196 ("ipv6: Do not depend on rt->n in rt6_probe().") removed the requirement for a neighbour entry. And commit f547fac624be ("ipv6: rate-limit probes for neighbourless routes") adds rate-lim

[PATCH] mm/oom_kill.c: fox oom_cpuset_eligible() comment

2019-08-27 Thread Yi Wang
Commit ac311a14c682 ("oom: decouple mems_allowed from oom_unkillable_task") changed the function has_intersects_mems_allowed() to oom_cpuset_eligible(), but didn't change the comment meanwhile. Let's fix this. Signed-off-by: Yi Wang --- mm/oom_kill.c | 2 +- 1 file change

[PATCH v2] ipv6: Not to probe neighbourless routes

2019-08-27 Thread Yi Wang
From: Cheng Lin Originally, Router Reachability Probing require a neighbour entry existed. Commit 2152caea7196 ("ipv6: Do not depend on rt->n in rt6_probe().") removed the requirement for a neighbour entry. And commit f547fac624be ("ipv6: rate-limit probes for neighbourless routes") adds rate-lim

[PATCH] mm: fix -Wmissing-prototypes warnings

2019-08-28 Thread Yi Wang
We get two warnings when build kernel W=1: mm/shuffle.c:36:12: warning: no previous prototype for ‘shuffle_show’ [-Wmissing-prototypes] mm/sparse.c:220:6: warning: no previous prototype for ‘subsection_mask_set’ [-Wmissing-prototypes] Make the function static to fix this. Signed-off-by: Yi Wang

[PATCH] x86/kvm: Fix -Wmissing-prototypes warnings

2019-10-09 Thread Yi Wang
file can fix this. Signed-off-by: Yi Wang --- arch/x86/kernel/kvm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index e820568..32ef1ee 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -33,6 +33,7 @@ #include #include

[PATCH] uprobes/x86: fix arch_uprobe_analyze_insn() comment

2019-10-23 Thread Yi Wang
Fix parameter name in comment and adjust the order. No functional change. Signed-off-by: Yi Wang --- arch/x86/kernel/uprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c index 8cd745e..15e5aad 100644 --- a/arch/x86

[PATCH] x86/mce/amd: fix -Wmissing-prototypes warnings

2019-10-23 Thread Yi Wang
We get two warnings when build kernel W=1: arch/x86/kernel/cpu/mce/amd.c:586:6: warning: no previous prototype for ‘disable_err_thresholding’ [-Wmissing-prototypes] Make the function static to fix this. Signed-off-by: Yi Wang --- arch/x86/kernel/cpu/mce/amd.c | 2 +- 1 file changed, 1

[PATCH] x86/apic: fix apic_id_is_primary_thread() comment

2019-10-23 Thread Yi Wang
No functional change. Signed-off-by: Yi Wang --- arch/x86/kernel/apic/apic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 9e2dd2b..aefd970 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic

[PATCH] irq/irqdomain: __irq_domain_alloc_fwnode comment

2019-10-19 Thread Yi Wang
Commit b977fcf477c1 ("irqdomain/debugfs: Use PAs to generate fwnode names") changed the parameter of __irq_domain_alloc_fwnode(), but didn't change the comment meanwhile. This patch can fix this. Signed-off-by: Yi Wang --- kernel/irq/irqdomain.c | 2 +- 1 file changed, 1

[PATCH] rcu/rcu_segcblist: fix -Wmissing-prototypes warnings

2019-10-20 Thread Yi Wang
/rcu_segcblist.c:137:6: warning: no previous prototype for ‘rcu_segcblist_xchg_len’ [-Wmissing-prototypes] Commit eda669a6a2c5 ("rcu/nocb: Atomic ->len field in rcu_segcblist structure") introduced this, and make the functions static to fix them. Signed-off-by: Yi Wang --- kernel/rcu/rcu_se

[PATCH] posix-cpu-timers: fix two trivial comments

2019-10-21 Thread Yi Wang
o modify the comment. This patch can fix this. Signed-off-by: Yi Wang --- kernel/time/posix-cpu-timers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c index 92a4319..617b919 100644 --- a/kernel/time/posi

[PATCH] net: sched: taprio: fix -Wmissing-prototypes warnings

2019-10-21 Thread Yi Wang
We get one warnings when build kernel W=1: net/sched/sch_taprio.c:1155:6: warning: no previous prototype for ‘taprio_offload_config_changed’ [-Wmissing-prototypes] Make the function static to fix this. Signed-off-by: Yi Wang --- net/sched/sch_taprio.c | 2 +- 1 file changed, 1 insertion(+), 1

[RESEND][PATCH net-next] net: sched: taprio: fix -Wmissing-prototypes warnings

2019-10-21 Thread Yi Wang
We get one warnings when build kernel W=1: net/sched/sch_taprio.c:1155:6: warning: no previous prototype for ‘taprio_offload_config_changed’ [-Wmissing-prototypes] Make the function static to fix this. Signed-off-by: Yi Wang Acked-by: Vinicius Costa Gomes --- net/sched/sch_taprio.c | 2 +- 1

[PATCH v2] x86/boot/e820: Use kmemdup instead of duplicating its function

2019-01-11 Thread Yi Wang
From: "Huang Zijiang" changes since v1: redo the patch based on suggestions from Boris. v1 link:https://lkml.org/lkml/2019/1/8/30 kmemdup is the same function as kmalloc() + memcpy(). Signed-off-by: Huang Zijiang --- arch/x86/kernel/e820.c | 9 +++-- 1 file changed, 3 insertions(+

[PATCH] [next] kvm: vmx: fix some -Wmissing-prototypes warnings

2019-01-20 Thread Yi Wang
static to fix this. Signed-off-by: Yi Wang --- arch/x86/kvm/vmx/nested.c | 2 +- arch/x86/kvm/vmx/vmx.c| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index 2616bd2..f8af511 100644 --- a/arch/x86/kvm/vmx/nested.c

[PATCH v2] [next] KVM: lapic: allow set apic debug dynamically

2019-05-09 Thread Yi Wang
There are many functions invoke apic_debug(), which is defined a null function by default, and that's incovenient for debuging lapic. This patch allows setting apic debug according to add a apic_dbg parameter of kvm. Signed-off-by: Yi Wang --- v2: change apic_dbg to bool and tag __read_m

[PATCH] kvm: vmx: Fix -Wmissing-prototypes warnings

2019-05-19 Thread Yi Wang
We get a warning when build kernel W=1: arch/x86/kvm/vmx/vmx.c:6365:6: warning: no previous prototype for ‘vmx_update_host_rsp’ [-Wmissing-prototypes] void vmx_update_host_rsp(struct vcpu_vmx *vmx, unsigned long host_rsp) Add the missing declaration to fix this. Signed-off-by: Yi Wang

[PATCH] [next] KVM: lapic: allow setting apic debug dynamically

2019-05-06 Thread Yi Wang
There are many functions invoke apic_debug(), which is defined as a null function by default, and that's incovenient for debuging lapic. This patch allows setting apic debug according to add a apic_dbg parameter of kvm. Signed-off-by: Yi Wang --- arch/x86/kvm/lapic.c | 7 ++- 1

[PATCH] sched/fair: fix coccinelle warnings

2019-07-14 Thread Yi Wang
This fixes the following coccinelle warning: ./kernel/sched/fair.c:8688:9-10: WARNING: return of 0/1 in function 'voluntary_active_balance' with return type bool Return type bool instead of 0/1. Signed-off-by: Yi Wang --- kernel/sched/fair.c | 8 1 file changed, 4 insert

[PATCH] x86/e820: fix coccinelle warnings

2019-07-14 Thread Yi Wang
This fixes the following coccinelle warning: ./arch/x86/kernel/e820.c:89:9-10: WARNING: return of 0/1 in function '_e820__mapped_any' with return type bool Return type bool instead of 0/1. Signed-off-by: Yi Wang --- arch/x86/kernel/e820.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH] kvm: vmx: fix coccinelle warnings

2019-07-14 Thread Yi Wang
This fixes the following coccinelle warning: WARNING: return of 0/1 in function 'vmx_need_emulation_on_page_fault' with return type bool Return false instead of 0. Signed-off-by: Yi Wang --- arch/x86/kvm/vmx/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH] kvm: x86: some tsc debug cleanup

2019-07-14 Thread Yi Wang
Hi Paolo, Would you help to review this patch, plz? Many thanks. --- Best wishes Yi Wang > 在 2019年7月6日,01:10,Yi Wang 写道: > > There are some pr_debug in TSC code, which may have > been no use, so remove them as Paolo suggested. > > Signed-off-by: Yi Wang > --- >

Re: [PATCH] kvm: x86: ioapic and apic debug macros cleanup

2019-07-14 Thread Yi Wang
Hi Paolo, Would you help to review this patch, plz? Many thanks. --- Best wishes Yi Wang > 在 2019年7月6日,01:08,Yi Wang 写道: > > The ioapic_debug and apic_debug have been not used > for years, and kvm tracepoints are enough for debugging, > so remove them as Paolo suggested. >

[PATCH] remove the initrd resource in /proc/iomem as the initrd has freed the reserved memblock.

2019-07-02 Thread Yi Wang
From: Junhua Huang The 'commit 50d7ba36b916 ("arm64: export memblock_reserve()d regions via /proc/iomem")' show the reserved memblock in /proc/iomem. But the initrd's reserved memblock will be freed in free_initrd_mem(), which executes after the reserve_memblock_reserved_regions(). So there are

[PATCH] arm64: mm: free the initrd reserved memblock in a aligned manner

2019-07-03 Thread Yi Wang
From: Junhua Huang We should free the reserved memblock in an aligned manner because the initrd reserves the memblock in an aligned manner in arm64_memblock_init(). Otherwise there are some fragments in memblock_reserved regions. e.g.: /sys/kernel/debug/memblock # cat reserved 0: 0x000

[PATCH 0/4] kvm: x86: introduce CONFIG_KVM_DEBUG

2019-06-30 Thread Yi Wang
This series introduce CONFIG_KVM_DEBUG, using which we can make the invoking *_debug in KVM simly and uniform. FYI: the former discussion can been found in: https://www.spinics.net/lists/kvm/msg187026.html Yi Wang (4): kvm: x86: Add CONFIG_KVM_DEBUG kvm: x86: allow set apic and ioapic debug

[PATCH 3/4] kvm: x86: replace MMU_DEBUG with CONFIG_KVM_DEBUG

2019-06-30 Thread Yi Wang
As CONFIG_KVM_DEBUG has been introduced in the former patch, it's better to replace MMU_DEBUG with CONFIG_KVM_DEBUG. Signed-off-by: Yi Wang --- arch/x86/kvm/mmu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 1e

[PATCH 4/4] kvm: x86: convert TSC pr_debugs to be gated by CONFIG_KVM_DEBUG

2019-06-30 Thread Yi Wang
There are some pr_debug in TSC code, which may affect performance, so it may make sense to wrap them using a new macro tsc_debug which takes effect only when CONFIG_KVM_DEBUG is defined. Signed-off-by: Yi Wang --- arch/x86/kvm/x86.c | 18 -- 1 file changed, 12 insertions(+), 6

[PATCH 2/4] kvm: x86: allow set apic and ioapic debug dynamically

2019-06-30 Thread Yi Wang
There are two *_debug() macros in kvm apic source file: - ioapic_debug, which is disable using #if 0 - apic_debug, which is commented Maybe it's better to control these two macros using CONFIG_KVM_DEBUG, which can be set in make menuconfig. Signed-off-by: Yi Wang --- arch/x86/kvm/ioapic.

[PATCH 1/4] kvm: x86: Add CONFIG_KVM_DEBUG

2019-06-30 Thread Yi Wang
There are some *_debug functions in KVM, it may be better to introduce CONFIG_DEBUG_KVM to replace the *_debug macro, which can avoid bloating and slowing KVM, as Sean suggested. Signed-off-by: Yi Wang --- arch/x86/kvm/Kconfig | 8 1 file changed, 8 insertions(+) diff --git a/arch/x86

[PATCH 2/2] sched: fix unlikely use of sched_info_on()

2019-07-04 Thread Yi Wang
sched_info_on() is called with unlikely hint, however, the test is to be true when make defconfig. So replace unlikely with likely. Signed-off-by: Yi Wang --- kernel/sched/stats.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/stats.h b/kernel/sched

[PATCH 0/2] fix likely hint of sched_info_on()

2019-07-04 Thread Yi Wang
When make defconfig, CONFIG_SCHEDSTATS is set to be y, so sched_info_on() is 'likely' to be true. However, some functions invoke this function with unlikely hint or use no hint. Let's fix this. Yi Wang (2): kvm: x86: add likely to sched_info_on() sched: fix unlikely use o

[PATCH 1/2] kvm: x86: add likely to sched_info_on()

2019-07-04 Thread Yi Wang
The condition to test is likely() to be true when make defconfig. Add the hint. Signed-off-by: Yi Wang --- arch/x86/kvm/cpuid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 4992e7c..64fff41 100644 --- a/arch/x86/kvm

[PATCH v2] sched: fix unlikely use of sched_info_on()

2019-07-04 Thread Yi Wang
sched_info_on() is called with unlikely hint, however, the test is to be a constant(1) on which compiler will do nothing when make defconfig, so remove the hint. Also, fix a lack of {}. Signed-off-by: Yi Wang --- v2: remove the hint rather than replace with likely, and fix a coding style

[PATCH] kvm: x86: ioapic and apic debug macros cleanup

2019-07-05 Thread Yi Wang
The ioapic_debug and apic_debug have been not used for years, and kvm tracepoints are enough for debugging, so remove them as Paolo suggested. However, there may be something wrong when pv evi get/put user, so it's better to retain some log there. Signed-off-by: Yi Wang --- arch/x8

[PATCH] kvm: x86: some tsc debug cleanup

2019-07-05 Thread Yi Wang
There are some pr_debug in TSC code, which may have been no use, so remove them as Paolo suggested. Signed-off-by: Yi Wang --- arch/x86/kvm/x86.c | 8 1 file changed, 8 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index fafd81d..86f9861 100644 --- a/arch/x86/kvm

[PATCH] kvm: x86: Fix -Wmissing-prototypes warnings

2019-07-06 Thread Yi Wang
/x86/kvm/irq.h, which is not included by eventfd.c. Remove the declaration to kvm_host.h can fix this. Signed-off-by: Yi Wang --- arch/x86/kvm/irq.h | 1 - include/linux/kvm_host.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h

[PATCH] kvm: x86: Use DEFINE_DEBUGFS_ATTRIBUTE for debugfs files

2019-07-22 Thread Yi Wang
: WARNING: vcpu_tsc_scaling_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE ./arch/x86/kvm/debugfs.c:49:0-23: WARNING: vcpu_tsc_scaling_frac_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE Use DEFINE_DEBUGFS_ATTRIBUTE() rather than DEFINE_SIMPLE_ATTRIBUTE() to fix this. Signed-off-by: Yi

[PATCH v2] kvm: x86: Fix -Wmissing-prototypes warnings

2019-07-09 Thread Yi Wang
arch/x86/kvm/irq.h, which is not included by eventfd.c. Considering kvm_arch_irqfd_allowed() is a weakly defined function in eventfd.c, remove the declaration to kvm_host.h can fix this. Signed-off-by: Yi Wang Reviewed-by: Sean Christopherson --- v2: add comments about the reason. --- arch/x86/kvm

[PATCH v2] kvm: x86: Fix -Wmissing-prototypes warnings

2019-07-09 Thread Yi Wang
arch/x86/kvm/irq.h, which is not included by eventfd.c. Considering kvm_arch_irqfd_allowed() is a weakly defined function in eventfd.c, remove the declaration to kvm_host.h can fix this. Signed-off-by: Yi Wang Reviewed-by: Sean Christopherson --- v2: add comments about the reason. --- arch/x86/kvm

[PATCH] KVM: x86: fix failure of injecting exceptions in x86_emulate_instruction

2018-09-06 Thread Yi Wang
, which won't be called before invoking inject_emulated_exception() in the 6ea6e84309ca. This patch fix this issue. Signed-off-by: Yi Wang Reviewed-by: Xi Xu --- arch/x86/kvm/emulate.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x8

[PATCH v2] net: atm: Remove the error message according to the atomic context

2020-06-10 Thread Yi Wang
From: Liao Pingfang Looking into the context (atomic!) and the error message should be dropped. Signed-off-by: Liao Pingfang --- Changes in v2: drop the error message instead of changing it. net/atm/lec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/atm/lec.c b/net/atm/lec.c index c

[PATCH v2] btrfs: Remove unnecessary failure messages during memory allocation

2020-06-10 Thread Yi Wang
From: Liao Pingfang As there is a dump_stack() done on memory allocation failures, these messages might as well be deleted instead. Signed-off-by: Liao Pingfang --- Changes in v2: Remove these error messages instead of changing them. fs/btrfs/check-integrity.c | 9 - 1 file changed, 9

[PATCH] ASoC: fsl: mpc8610_hpcd: Add missing of_node_put()

2020-07-07 Thread Yi Wang
From: Liao Pingfang After finishing using device node got from of_find_compatible_node(), of_node_put() needs to be called. Signed-off-by: Liao Pingfang --- sound/soc/fsl/mpc8610_hpcd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_h

[PATCH v3] net: atm: Remove the error message according to the atomic context

2020-06-12 Thread Yi Wang
From: Liao Pingfang Looking into the context (atomic!) and the error message should be dropped. Signed-off-by: Liao Pingfang --- Changes in v3: remove {} as there is only one statement left. net/atm/lec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/atm/lec.c b/n

[PATCH] scsi: ppa: Remove superfluous breaks

2020-07-14 Thread Yi Wang
From: Liao Pingfang Remove superfluous breaks, as there is a "return" before them. Signed-off-by: Liao Pingfang Signed-off-by: Yi Wang --- drivers/scsi/ppa.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c index a406cc8..0ae800c 10

[PATCH] scsi: imm: Remove superfluous breaks

2020-07-14 Thread Yi Wang
From: Liao Pingfang Remove superfluous breaks, as there is a "return" before them. Signed-off-by: Liao Pingfang Signed-off-by: Yi Wang --- drivers/scsi/imm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c index 2519fb7..1459b14 10

[PATCH] ipc/shm.c: Remove the superfluous break

2020-07-14 Thread Yi Wang
From: Liao Pingfang Remove the superfuous break, as there is a 'return' before it. Signed-off-by: Liao Pingfang Signed-off-by: Yi Wang --- ipc/shm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ipc/shm.c b/ipc/shm.c index 0a6dd94..fbf369fa 100644 --- a/ipc/shm.c +++ b

[PATCH] cifs: Remove the superfluous break

2020-07-14 Thread Yi Wang
From: Liao Pingfang Remove the superfuous break, as there is a 'return' before it. Signed-off-by: Liao Pingfang Signed-off-by: Yi Wang --- fs/cifs/sess.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 5d05bd2..6708ab0 100644 --- a/fs/c

[PATCH] net: atm: Replace kmalloc with kzalloc in the error message

2020-05-28 Thread Yi Wang
From: Liao Pingfang Use kzalloc instead of kmalloc in the error message according to the previous kzalloc() call. Signed-off-by: Liao Pingfang --- net/atm/lec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/atm/lec.c b/net/atm/lec.c index ca37f5a..33033d7 100644 --- a

[PATCH] powerpc/nvram: Replace kmalloc with kzalloc in the error message

2020-05-28 Thread Yi Wang
From: Liao Pingfang Use kzalloc instead of kmalloc in the error message according to the previous kzalloc() call. Signed-off-by: Liao Pingfang --- arch/powerpc/kernel/nvram_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/ke

[PATCH] PCI: Replace kmalloc with kzalloc in the comment/message

2020-05-28 Thread Yi Wang
From: Liao Pingfang Use kzalloc instead of kmalloc in the comment/message according to the previous kzalloc() call. Signed-off-by: Liao Pingfang --- drivers/pci/hotplug/ibmphp_pci.c | 2 +- drivers/pci/setup-bus.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/

[PATCH] scsi: esas2r: Replace kzalloc with kmalloc in the log message

2020-05-28 Thread Yi Wang
From: Liao Pingfang Use kmalloc instead of kzalloc in the log message according to the previous kmalloc() call. Signed-off-by: Liao Pingfang --- drivers/scsi/esas2r/esas2r_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/esas2r/esas2r_main.c b/driver

[PATCH] misc: mic: Replace kmalloc with kzalloc in the error message

2020-05-28 Thread Yi Wang
From: Liao Pingfang Use kzalloc instead of kmalloc in the error message according to the previous kzalloc() call. Signed-off-by: Liao Pingfang --- drivers/misc/mic/host/mic_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/mic/host/mic_main.c b/drivers/mis

[PATCH] reiserfs: Replace kmalloc with kcalloc in the comment

2020-05-28 Thread Yi Wang
From: Liao Pingfang Use kcalloc instead of kmalloc in the comment according to the previous kcalloc() call. Signed-off-by: Liao Pingfang --- fs/reiserfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 6419e6d..21ad762

[PATCH] btrfs: Replace kmalloc with kzalloc in the error message

2020-05-28 Thread Yi Wang
From: Liao Pingfang Use kzalloc instead of kmalloc in the error message according to the previous kzalloc() call. Signed-off-by: Liao Pingfang --- fs/btrfs/check-integrity.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/fs/btrfs/check-integrity.c b/fs/b

[PATCH v2] zram: add restriction on dynamic zram device creation

2020-09-04 Thread Yi Wang
From: zhanglin Add max_num_devices to limit dynamic zram device creation to prevent potential OOM Signed-off-by: zhanglin Signed-off-by: Yi Wang --- v1->v2: change hard-coded initial max_num_devices into configurable way. drivers/block/zram/Kconfig| 7 +++ drivers/block/z

[PATCH] zram: add restriction on dynamic zram device creation

2020-08-31 Thread Yi Wang
From: zhanglin Add max_num_devices to limit dynamic zram device creation to prevent potential OOM Signed-off-by: zhanglin --- drivers/block/zram/zram_drv.c | 26 +++--- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/b

[PATCH] PCI: Replace kmalloc with kzalloc in the comment/message

2020-07-09 Thread Yi Wang
From: Liao Pingfang Use kzalloc instead of kmalloc in the comment/message according to the previous kzalloc() call. Signed-off-by: Liao Pingfang Signed-off-by: Yi Wang --- drivers/pci/hotplug/ibmphp_pci.c | 2 +- drivers/pci/setup-bus.c | 2 +- 2 files changed, 2 insertions(+), 2

[PATCH v2] ARM: milbeaut: Fix possible device node reference leak

2020-07-24 Thread Yi Wang
: Yi Wang --- Changes in v2: improve the subject and description of this commit. arch/arm/mach-milbeaut/platsmp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-milbeaut/platsmp.c b/arch/arm/mach-milbeaut/platsmp.c index 3ea880f..1f1ff21 100644 --- a/arch/arm/mach-milbeaut

[PATCH] block: Fix reference count leak in blk_integrity_add

2020-07-24 Thread Yi Wang
From: Liao Pingfang kobject_init_and_add() takes reference even when it fails. If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Signed-off-by: Liao Pingfang Signed-off-by: Yi Wang --- block/blk-integrity.c | 4 +++- 1

[PATCH] sh: sh4: Fix reference count leak in sq_dev_add

2020-07-24 Thread Yi Wang
From: Liao Pingfang kobject_init_and_add() takes reference even when it fails. If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Signed-off-by: Liao Pingfang Signed-off-by: Yi Wang --- arch/sh/kernel/cpu/sh4/sq.c | 2

  1   2   3   4   5   >