[tip:perf/urgent] perf cs-etm: Remove errnoeous ERR_PTR() usage in cs_etm__process_auxtrace_info
Commit-ID: edc82a99437a93c36b0ae18eb6daac0097fc6bd3 Gitweb: https://git.kernel.org/tip/edc82a99437a93c36b0ae18eb6daac0097fc6bd3 Author: YueHaibing AuthorDate: Thu, 21 Mar 2019 10:31:21 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 11 Jul 2019 12:42:46 -0300 perf cs-etm: Remove errnoeous ERR_PTR() usage in cs_etm__process_auxtrace_info intlist__findnew() doesn't uses ERR_PTR() as a return mechanism so its callers shouldn't try to extract the error using PTR_ERR( ret) from intlist__findnew(), make cs_etm__process_auxtrace_info return -ENOMEM instead. Signed-off-by: YueHaibing Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: linux-arm-ker...@lists.infradead.org Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata") Link: http://lkml.kernel.org/r/20190321023122.21332-2-yuehaib...@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/cs-etm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 67b88b599a53..2e9f5bc45550 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -2460,7 +2460,7 @@ int cs_etm__process_auxtrace_info(union perf_event *event, /* Something went wrong, no need to continue */ if (!inode) { - err = PTR_ERR(inode); + err = -ENOMEM; goto err_free_metadata; }
[tip:perf/urgent] perf cs-etm: Return errcode in cs_etm__process_auxtrace_info()
Commit-ID: 6285bd151b95aa28d6de9b8b9249702681f059d2 Gitweb: https://git.kernel.org/tip/6285bd151b95aa28d6de9b8b9249702681f059d2 Author: YueHaibing AuthorDate: Thu, 21 Mar 2019 10:31:22 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 11 Jul 2019 12:45:02 -0300 perf cs-etm: Return errcode in cs_etm__process_auxtrace_info() The 'err' variable is set in the error path, but it's not returned to callers. Don't always return -EINVAL, return err. Signed-off-by: YueHaibing Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: linux-arm-ker...@lists.infradead.org Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata") Link: http://lkml.kernel.org/r/20190321023122.21332-3-yuehaib...@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/cs-etm.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 2e9f5bc45550..3d1c34fc4d68 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -2517,8 +2517,10 @@ int cs_etm__process_auxtrace_info(union perf_event *event, session->auxtrace = >auxtrace; etm->unknown_thread = thread__new(9, 9); - if (!etm->unknown_thread) + if (!etm->unknown_thread) { + err = -ENOMEM; goto err_free_queues; + } /* * Initialize list node so that at thread__zput() we can avoid @@ -2530,8 +2532,10 @@ int cs_etm__process_auxtrace_info(union perf_event *event, if (err) goto err_delete_thread; - if (thread__init_map_groups(etm->unknown_thread, etm->machine)) + if (thread__init_map_groups(etm->unknown_thread, etm->machine)) { + err = -ENOMEM; goto err_delete_thread; + } if (dump_trace) { cs_etm__print_auxtrace_info(auxtrace_info->priv, num_cpu); @@ -2575,5 +2579,5 @@ err_free_traceid_list: err_free_hdr: zfree(); - return -EINVAL; + return err; }
[tip:core/rslib] rslib: Make some functions static
Commit-ID: ede7c247abfaeef62484cfff320b072ec2b1dca0 Gitweb: https://git.kernel.org/tip/ede7c247abfaeef62484cfff320b072ec2b1dca0 Author: YueHaibing AuthorDate: Tue, 2 Jul 2019 14:18:47 +0800 Committer: Thomas Gleixner CommitDate: Tue, 2 Jul 2019 08:41:37 +0200 rslib: Make some functions static Fix sparse warnings: lib/reed_solomon/test_rslib.c:313:5: warning: symbol 'ex_rs_helper' was not declared. Should it be static? lib/reed_solomon/test_rslib.c:349:5: warning: symbol 'exercise_rs' was not declared. Should it be static? lib/reed_solomon/test_rslib.c:407:5: warning: symbol 'exercise_rs_bc' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: YueHaibing Signed-off-by: Thomas Gleixner Cc: Link: https://lkml.kernel.org/r/20190702061847.26060-1-yuehaib...@huawei.com --- lib/reed_solomon/test_rslib.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/reed_solomon/test_rslib.c b/lib/reed_solomon/test_rslib.c index eb62e0393c80..4eb29f365ece 100644 --- a/lib/reed_solomon/test_rslib.c +++ b/lib/reed_solomon/test_rslib.c @@ -310,8 +310,8 @@ static void test_uc(struct rs_control *rs, int len, int errs, stat->nwords += trials; } -int ex_rs_helper(struct rs_control *rs, struct wspace *ws, - int len, int trials, int method) +static int ex_rs_helper(struct rs_control *rs, struct wspace *ws, + int len, int trials, int method) { static const char * const desc[] = { "Testing correction buffer interface...", @@ -346,8 +346,8 @@ int ex_rs_helper(struct rs_control *rs, struct wspace *ws, return retval; } -int exercise_rs(struct rs_control *rs, struct wspace *ws, - int len, int trials) +static int exercise_rs(struct rs_control *rs, struct wspace *ws, + int len, int trials) { int retval = 0; @@ -404,8 +404,8 @@ static void test_bc(struct rs_control *rs, int len, int errs, stat->nwords += trials; } -int exercise_rs_bc(struct rs_control *rs, struct wspace *ws, - int len, int trials) +static int exercise_rs_bc(struct rs_control *rs, struct wspace *ws, + int len, int trials) { struct bcstat stat = {0, 0, 0, 0}; int nroots = rs->codec->nroots;
[tip:locking/core] x86/jump_label: Make tp_vec_nr static
Commit-ID: bf10c97adbd0dc8fa65c35d5b0c0dc281a68ac8e Gitweb: https://git.kernel.org/tip/bf10c97adbd0dc8fa65c35d5b0c0dc281a68ac8e Author: YueHaibing AuthorDate: Tue, 25 Jun 2019 11:45:48 +0800 Committer: Thomas Gleixner CommitDate: Tue, 25 Jun 2019 09:22:14 +0200 x86/jump_label: Make tp_vec_nr static Fix sparse warning: arch/x86/kernel/jump_label.c:106:5: warning: symbol 'tp_vec_nr' was not declared. Should it be static? It's only used in jump_label.c, so make it static. Fixes: ba54f0c3f7c4 ("x86/jump_label: Batch jump label updates") Reported-by: Hulk Robot Signed-off-by: YueHaibing Signed-off-by: Thomas Gleixner Cc: Cc: Cc: Cc: Cc: Link: https://lkml.kernel.org/r/20190625034548.26392-1-yuehaib...@huawei.com --- arch/x86/kernel/jump_label.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/jump_label.c b/arch/x86/kernel/jump_label.c index ea13808bf6da..044053235302 100644 --- a/arch/x86/kernel/jump_label.c +++ b/arch/x86/kernel/jump_label.c @@ -103,7 +103,7 @@ void arch_jump_label_transform(struct jump_entry *entry, #define TP_VEC_MAX (PAGE_SIZE / sizeof(struct text_poke_loc)) static struct text_poke_loc tp_vec[TP_VEC_MAX]; -int tp_vec_nr = 0; +static int tp_vec_nr; bool arch_jump_label_transform_queue(struct jump_entry *entry, enum jump_label_type type)
[tip:x86/cleanups] x86/amd_nb: Make hygon_nb_misc_ids static
Commit-ID: 025e32048f39e24d8ddf9369d679644ea2bdcce6 Gitweb: https://git.kernel.org/tip/025e32048f39e24d8ddf9369d679644ea2bdcce6 Author: YueHaibing AuthorDate: Fri, 14 Jun 2019 23:54:41 +0800 Committer: Borislav Petkov CommitDate: Fri, 14 Jun 2019 20:25:58 +0200 x86/amd_nb: Make hygon_nb_misc_ids static Fix the following sparse warning: arch/x86/kernel/amd_nb.c:74:28: warning: symbol 'hygon_nb_misc_ids' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: YueHaibing Signed-off-by: Borislav Petkov Cc: Bjorn Helgaas Cc: Brian Woods Cc: Guenter Roeck Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Pu Wen Cc: Thomas Gleixner Cc: x86-ml Link: https://lkml.kernel.org/r/20190614155441.22076-1-yuehaib...@huawei.com --- arch/x86/kernel/amd_nb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c index cc51275c8759..922e8fd5426f 100644 --- a/arch/x86/kernel/amd_nb.c +++ b/arch/x86/kernel/amd_nb.c @@ -71,7 +71,7 @@ static const struct pci_device_id hygon_root_ids[] = { {} }; -const struct pci_device_id hygon_nb_misc_ids[] = { +static const struct pci_device_id hygon_nb_misc_ids[] = { { PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) }, {} };
[tip:ras/core] x86/mce: Fix debugfs_simple_attr.cocci warnings
Commit-ID: 28156d7678431312b463361b23a218a1b5645ba5 Gitweb: https://git.kernel.org/tip/28156d7678431312b463361b23a218a1b5645ba5 Author: YueHaibing AuthorDate: Fri, 28 Dec 2018 07:24:13 + Committer: Ingo Molnar CommitDate: Fri, 19 Apr 2019 19:25:08 +0200 x86/mce: Fix debugfs_simple_attr.cocci warnings Use DEFINE_DEBUGFS_ATTRIBUTE() rather than DEFINE_SIMPLE_ATTRIBUTE() for debugfs files. Semantic patch information: Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file() imposes some significant overhead as compared to DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe(). Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci Signed-off-by: YueHaibing Cc: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Tony Luck Cc: Vishal Verma Cc: Yazen Ghannam Cc: kernel-janit...@vger.kernel.org Link: http://lkml.kernel.org/r/1545981853-70877-1-git-send-email-yuehaib...@huawei.com Signed-off-by: Ingo Molnar --- arch/x86/kernel/cpu/mce/core.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index 58925e7ccb27..3e081428117c 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -2429,8 +2429,8 @@ static int fake_panic_set(void *data, u64 val) return 0; } -DEFINE_SIMPLE_ATTRIBUTE(fake_panic_fops, fake_panic_get, - fake_panic_set, "%llu\n"); +DEFINE_DEBUGFS_ATTRIBUTE(fake_panic_fops, fake_panic_get, fake_panic_set, +"%llu\n"); static int __init mcheck_debugfs_init(void) { @@ -2439,8 +2439,8 @@ static int __init mcheck_debugfs_init(void) dmce = mce_get_debugfs_dir(); if (!dmce) return -ENOMEM; - ffake_panic = debugfs_create_file("fake_panic", 0444, dmce, NULL, - _panic_fops); + ffake_panic = debugfs_create_file_unsafe("fake_panic", 0444, dmce, +NULL, _panic_fops); if (!ffake_panic) return -ENOMEM;
[tip:sched/core] sched/core: Make some functions static
Commit-ID: b1546edcf2aab710a5afc98d65c948a4bfac0353 Gitweb: https://git.kernel.org/tip/b1546edcf2aab710a5afc98d65c948a4bfac0353 Author: YueHaibing AuthorDate: Thu, 18 Apr 2019 22:47:13 +0800 Committer: Ingo Molnar CommitDate: Thu, 18 Apr 2019 20:28:02 +0200 sched/core: Make some functions static Fix these sparse warnings: kernel/sched/core.c:6577:11: warning: symbol 'min_cfs_quota_period' was not declared. Should it be static? kernel/sched/core.c:6657:5: warning: symbol 'tg_set_cfs_quota' was not declared. Should it be static? kernel/sched/core.c:6670:6: warning: symbol 'tg_get_cfs_quota' was not declared. Should it be static? kernel/sched/core.c:6683:5: warning: symbol 'tg_set_cfs_period' was not declared. Should it be static? kernel/sched/core.c:6693:6: warning: symbol 'tg_get_cfs_period' was not declared. Should it be static? kernel/sched/fair.c:2596:6: warning: symbol 'task_tick_numa' was not declared. Should it be static? Signed-off-by: YueHaibing Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20190418144713.34332-1-yuehaib...@huawei.com Signed-off-by: Ingo Molnar --- kernel/sched/core.c | 10 +- kernel/sched/fair.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f4838b78b9f9..8b64ef0d5589 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6522,7 +6522,7 @@ static u64 cpu_shares_read_u64(struct cgroup_subsys_state *css, static DEFINE_MUTEX(cfs_constraints_mutex); const u64 max_cfs_quota_period = 1 * NSEC_PER_SEC; /* 1s */ -const u64 min_cfs_quota_period = 1 * NSEC_PER_MSEC; /* 1ms */ +static const u64 min_cfs_quota_period = 1 * NSEC_PER_MSEC; /* 1ms */ static int __cfs_schedulable(struct task_group *tg, u64 period, u64 runtime); @@ -6602,7 +6602,7 @@ out_unlock: return ret; } -int tg_set_cfs_quota(struct task_group *tg, long cfs_quota_us) +static int tg_set_cfs_quota(struct task_group *tg, long cfs_quota_us) { u64 quota, period; @@ -6615,7 +6615,7 @@ int tg_set_cfs_quota(struct task_group *tg, long cfs_quota_us) return tg_set_cfs_bandwidth(tg, period, quota); } -long tg_get_cfs_quota(struct task_group *tg) +static long tg_get_cfs_quota(struct task_group *tg) { u64 quota_us; @@ -6628,7 +6628,7 @@ long tg_get_cfs_quota(struct task_group *tg) return quota_us; } -int tg_set_cfs_period(struct task_group *tg, long cfs_period_us) +static int tg_set_cfs_period(struct task_group *tg, long cfs_period_us) { u64 quota, period; @@ -6638,7 +6638,7 @@ int tg_set_cfs_period(struct task_group *tg, long cfs_period_us) return tg_set_cfs_bandwidth(tg, period, quota); } -long tg_get_cfs_period(struct task_group *tg) +static long tg_get_cfs_period(struct task_group *tg) { u64 cfs_period_us; diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e5b100b6ba4e..13bafe350abf 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2593,7 +2593,7 @@ out: /* * Drive the periodic memory faults.. */ -void task_tick_numa(struct rq *rq, struct task_struct *curr) +static void task_tick_numa(struct rq *rq, struct task_struct *curr) { struct callback_head *work = >numa_work; u64 period, now;
[tip:sched/core] sched/core: Make some functions static
Commit-ID: 16e671afb70f28eb189136d1395c59dafecd270a Gitweb: https://git.kernel.org/tip/16e671afb70f28eb189136d1395c59dafecd270a Author: YueHaibing AuthorDate: Fri, 22 Mar 2019 22:31:53 +0800 Committer: Ingo Molnar CommitDate: Thu, 18 Apr 2019 14:19:25 +0200 sched/core: Make some functions static Fix these sparse warnings: kernel/sched/core.c:6576:11: warning: symbol 'max_cfs_quota_period' was not declared. Should it be static? kernel/sched/core.c:6577:11: warning: symbol 'min_cfs_quota_period' was not declared. Should it be static? kernel/sched/core.c:6657:5: warning: symbol 'tg_set_cfs_quota' was not declared. Should it be static? kernel/sched/core.c:6670:6: warning: symbol 'tg_get_cfs_quota' was not declared. Should it be static? kernel/sched/core.c:6683:5: warning: symbol 'tg_set_cfs_period' was not declared. Should it be static? kernel/sched/core.c:6693:6: warning: symbol 'tg_get_cfs_period' was not declared. Should it be static? kernel/sched/fair.c:2596:6: warning: symbol 'task_tick_numa' was not declared. Should it be static? Signed-off-by: YueHaibing Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20190322143153.14416-1-yuehaib...@huawei.com Signed-off-by: Ingo Molnar --- kernel/sched/core.c | 12 ++-- kernel/sched/fair.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f4838b78b9f9..7f2a5fd316f8 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6521,8 +6521,8 @@ static u64 cpu_shares_read_u64(struct cgroup_subsys_state *css, #ifdef CONFIG_CFS_BANDWIDTH static DEFINE_MUTEX(cfs_constraints_mutex); -const u64 max_cfs_quota_period = 1 * NSEC_PER_SEC; /* 1s */ -const u64 min_cfs_quota_period = 1 * NSEC_PER_MSEC; /* 1ms */ +static const u64 max_cfs_quota_period = 1 * NSEC_PER_SEC; /* 1s */ +static const u64 min_cfs_quota_period = 1 * NSEC_PER_MSEC; /* 1ms */ static int __cfs_schedulable(struct task_group *tg, u64 period, u64 runtime); @@ -6602,7 +6602,7 @@ out_unlock: return ret; } -int tg_set_cfs_quota(struct task_group *tg, long cfs_quota_us) +static int tg_set_cfs_quota(struct task_group *tg, long cfs_quota_us) { u64 quota, period; @@ -6615,7 +6615,7 @@ int tg_set_cfs_quota(struct task_group *tg, long cfs_quota_us) return tg_set_cfs_bandwidth(tg, period, quota); } -long tg_get_cfs_quota(struct task_group *tg) +static long tg_get_cfs_quota(struct task_group *tg) { u64 quota_us; @@ -6628,7 +6628,7 @@ long tg_get_cfs_quota(struct task_group *tg) return quota_us; } -int tg_set_cfs_period(struct task_group *tg, long cfs_period_us) +static int tg_set_cfs_period(struct task_group *tg, long cfs_period_us) { u64 quota, period; @@ -6638,7 +6638,7 @@ int tg_set_cfs_period(struct task_group *tg, long cfs_period_us) return tg_set_cfs_bandwidth(tg, period, quota); } -long tg_get_cfs_period(struct task_group *tg) +static long tg_get_cfs_period(struct task_group *tg) { u64 cfs_period_us; diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e5b100b6ba4e..13bafe350abf 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2593,7 +2593,7 @@ out: /* * Drive the periodic memory faults.. */ -void task_tick_numa(struct rq *rq, struct task_struct *curr) +static void task_tick_numa(struct rq *rq, struct task_struct *curr) { struct callback_head *work = >numa_work; u64 period, now;
[tip:sched/core] sched/fair: Make sync_entity_load_avg() and remove_entity_load_avg() static
Commit-ID: 71b47eaf6fb29b7f9722dc1646c26eb8a96e0a6d Gitweb: https://git.kernel.org/tip/71b47eaf6fb29b7f9722dc1646c26eb8a96e0a6d Author: YueHaibing AuthorDate: Wed, 20 Mar 2019 21:38:39 +0800 Committer: Ingo Molnar CommitDate: Wed, 3 Apr 2019 12:34:31 +0200 sched/fair: Make sync_entity_load_avg() and remove_entity_load_avg() static Fix these sparse warnigs: kernel/sched/fair.c:3570:6: warning: symbol 'sync_entity_load_avg' was not declared. Should it be static? kernel/sched/fair.c:3583:6: warning: symbol 'remove_entity_load_avg' was not declared. Should it be static? Signed-off-by: YueHaibing Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/20190320133839.21392-1-yuehaib...@huawei.com Signed-off-by: Ingo Molnar --- 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 40bd1e27b1b7..ed7f5f8107b7 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3567,7 +3567,7 @@ static inline u64 cfs_rq_last_update_time(struct cfs_rq *cfs_rq) * Synchronize entity load avg of dequeued entity without locking * the previous rq. */ -void sync_entity_load_avg(struct sched_entity *se) +static void sync_entity_load_avg(struct sched_entity *se) { struct cfs_rq *cfs_rq = cfs_rq_of(se); u64 last_update_time; @@ -3580,7 +3580,7 @@ void sync_entity_load_avg(struct sched_entity *se) * Task first catches up with cfs_rq, and then subtract * itself from the cfs_rq (task must be off the queue now). */ -void remove_entity_load_avg(struct sched_entity *se) +static void remove_entity_load_avg(struct sched_entity *se) { struct cfs_rq *cfs_rq = cfs_rq_of(se); unsigned long flags;
[tip:sched/core] sched/fair: Make sync_entity_load_avg() and remove_entity_load_avg() static
Commit-ID: ed1681a83e3530445a595231419305c863b7fb7f Gitweb: https://git.kernel.org/tip/ed1681a83e3530445a595231419305c863b7fb7f Author: YueHaibing AuthorDate: Wed, 20 Mar 2019 21:38:39 +0800 Committer: Ingo Molnar CommitDate: Wed, 3 Apr 2019 09:51:05 +0200 sched/fair: Make sync_entity_load_avg() and remove_entity_load_avg() static Fix these sparse warnigs: kernel/sched/fair.c:3570:6: warning: symbol 'sync_entity_load_avg' was not declared. Should it be static? kernel/sched/fair.c:3583:6: warning: symbol 'remove_entity_load_avg' was not declared. Should it be static? Signed-off-by: YueHaibing Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/20190320133839.21392-1-yuehaib...@huawei.com Signed-off-by: Ingo Molnar --- 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 d4cce633eac8..f766c3364246 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3567,7 +3567,7 @@ static inline u64 cfs_rq_last_update_time(struct cfs_rq *cfs_rq) * Synchronize entity load avg of dequeued entity without locking * the previous rq. */ -void sync_entity_load_avg(struct sched_entity *se) +static void sync_entity_load_avg(struct sched_entity *se) { struct cfs_rq *cfs_rq = cfs_rq_of(se); u64 last_update_time; @@ -3580,7 +3580,7 @@ void sync_entity_load_avg(struct sched_entity *se) * Task first catches up with cfs_rq, and then subtract * itself from the cfs_rq (task must be off the queue now). */ -void remove_entity_load_avg(struct sched_entity *se) +static void remove_entity_load_avg(struct sched_entity *se) { struct cfs_rq *cfs_rq = cfs_rq_of(se); unsigned long flags;
[tip:timers/urgent] clocksource/drivers/clps711x: Make clps711x_clksrc_init() static
Commit-ID: d18a7408d7be0f34a120d99051ed5187d9727728 Gitweb: https://git.kernel.org/tip/d18a7408d7be0f34a120d99051ed5187d9727728 Author: YueHaibing AuthorDate: Fri, 22 Mar 2019 22:37:08 +0800 Committer: Thomas Gleixner CommitDate: Fri, 22 Mar 2019 22:59:32 +0100 clocksource/drivers/clps711x: Make clps711x_clksrc_init() static Fix sparse warning: drivers/clocksource/clps711x-timer.c:96:13: warning: symbol 'clps711x_clksrc_init' was not declared. Should it be static? Signed-off-by: YueHaibing Signed-off-by: Thomas Gleixner Cc: Cc: Cc: Link: https://lkml.kernel.org/r/20190322143708.12716-1-yuehaib...@huawei.com --- drivers/clocksource/clps711x-timer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/clps711x-timer.c b/drivers/clocksource/clps711x-timer.c index a8dd80576c95..cdc251524f5e 100644 --- a/drivers/clocksource/clps711x-timer.c +++ b/drivers/clocksource/clps711x-timer.c @@ -93,8 +93,9 @@ static int __init _clps711x_clkevt_init(struct clk *clock, void __iomem *base, "clps711x-timer", clkevt); } -void __init clps711x_clksrc_init(void __iomem *tc1_base, void __iomem *tc2_base, -unsigned int irq) +static void __init clps711x_clksrc_init(void __iomem *tc1_base, + void __iomem *tc2_base, + unsigned int irq) { struct clk *tc1 = clk_get_sys("clps711x-timer.0", NULL); struct clk *tc2 = clk_get_sys("clps711x-timer.1", NULL);
[tip:timers/urgent] clocksource/drivers/mips-gic-timer: Make gic_compare_irqaction static
Commit-ID: 9039de4034775f4420bf01fa879f8c04b3cd6bba Gitweb: https://git.kernel.org/tip/9039de4034775f4420bf01fa879f8c04b3cd6bba Author: YueHaibing AuthorDate: Fri, 22 Mar 2019 22:43:59 +0800 Committer: Thomas Gleixner CommitDate: Fri, 22 Mar 2019 22:59:33 +0100 clocksource/drivers/mips-gic-timer: Make gic_compare_irqaction static Fix sparse warning: drivers/clocksource/mips-gic-timer.c:70:18: warning: symbol 'gic_compare_irqaction' was not declared. Should it be static? Signed-off-by: YueHaibing Signed-off-by: Thomas Gleixner Cc: Link: https://lkml.kernel.org/r/20190322144359.19516-1-yuehaib...@huawei.com --- drivers/clocksource/mips-gic-timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c index 54f8a331b53a..37671a5d4ed9 100644 --- a/drivers/clocksource/mips-gic-timer.c +++ b/drivers/clocksource/mips-gic-timer.c @@ -67,7 +67,7 @@ static irqreturn_t gic_compare_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -struct irqaction gic_compare_irqaction = { +static struct irqaction gic_compare_irqaction = { .handler = gic_compare_interrupt, .percpu_dev_id = _clockevent_device, .flags = IRQF_PERCPU | IRQF_TIMER,
[tip:timers/urgent] clocksource/drivers/timer-ti-dm: Make omap_dm_timer_set_load_start() static
Commit-ID: 008258d995a637c77c10a5d087d134eed49a6572 Gitweb: https://git.kernel.org/tip/008258d995a637c77c10a5d087d134eed49a6572 Author: YueHaibing AuthorDate: Fri, 22 Mar 2019 22:43:02 +0800 Committer: Thomas Gleixner CommitDate: Fri, 22 Mar 2019 22:59:33 +0100 clocksource/drivers/timer-ti-dm: Make omap_dm_timer_set_load_start() static Fix sparse warning: drivers/clocksource/timer-ti-dm.c:589:5: warning: symbol 'omap_dm_timer_set_load_start' was not declared. Should it be static? Signed-off-by: YueHaibing Signed-off-by: Thomas Gleixner Cc: Link: https://lkml.kernel.org/r/20190322144302.6704-1-yuehaib...@huawei.com --- drivers/clocksource/timer-ti-dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c index c364027638e1..3352da6ed61f 100644 --- a/drivers/clocksource/timer-ti-dm.c +++ b/drivers/clocksource/timer-ti-dm.c @@ -586,8 +586,8 @@ static int omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, } /* Optimized set_load which removes costly spin wait in timer_start */ -int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload, -unsigned int load) +static int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, + int autoreload, unsigned int load) { u32 l;
[tip:timers/urgent] clocksource/drivers/tcb_clksrc: Make tc_clksrc_suspend/resume() static
Commit-ID: bddee90af621914f08a03d546419fc293e9140d8 Gitweb: https://git.kernel.org/tip/bddee90af621914f08a03d546419fc293e9140d8 Author: YueHaibing AuthorDate: Fri, 22 Mar 2019 22:39:40 +0800 Committer: Thomas Gleixner CommitDate: Fri, 22 Mar 2019 22:59:33 +0100 clocksource/drivers/tcb_clksrc: Make tc_clksrc_suspend/resume() static Fix sparse warnings: drivers/clocksource/tcb_clksrc.c:74:6: warning: symbol 'tc_clksrc_suspend' was not declared. Should it be static? drivers/clocksource/tcb_clksrc.c:89:6: warning: symbol 'tc_clksrc_resume' was not declared. Should it be static? Signed-off-by: YueHaibing Signed-off-by: Thomas Gleixner Cc: Cc: Cc: Link: https://lkml.kernel.org/r/20190322143940.12396-1-yuehaib...@huawei.com --- drivers/clocksource/tcb_clksrc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c index 43f4d5c4d6fa..f987027ca566 100644 --- a/drivers/clocksource/tcb_clksrc.c +++ b/drivers/clocksource/tcb_clksrc.c @@ -71,7 +71,7 @@ static u64 tc_get_cycles32(struct clocksource *cs) return readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV)); } -void tc_clksrc_suspend(struct clocksource *cs) +static void tc_clksrc_suspend(struct clocksource *cs) { int i; @@ -86,7 +86,7 @@ void tc_clksrc_suspend(struct clocksource *cs) bmr_cache = readl(tcaddr + ATMEL_TC_BMR); } -void tc_clksrc_resume(struct clocksource *cs) +static void tc_clksrc_resume(struct clocksource *cs) { int i;
[tip:irq/urgent] irqchip/irq-mvebu-sei: Make mvebu_sei_ap806_caps static
Commit-ID: f27b744baaa646a7c0a01443cc0d8b4787cac2f7 Gitweb: https://git.kernel.org/tip/f27b744baaa646a7c0a01443cc0d8b4787cac2f7 Author: YueHaibing AuthorDate: Thu, 21 Mar 2019 23:14:48 +0800 Committer: Thomas Gleixner CommitDate: Thu, 21 Mar 2019 16:43:00 +0100 irqchip/irq-mvebu-sei: Make mvebu_sei_ap806_caps static Fix sparse warning: drivers/irqchip/irq-mvebu-sei.c:481:23: warning: symbol 'mvebu_sei_ap806_caps' was not declared. Should it be static? Signed-off-by: YueHaibing Signed-off-by: Thomas Gleixner Cc: Cc: Cc: Cc: Cc: Cc: Link: https://lkml.kernel.org/r/20190321151448.15600-1-yuehaib...@huawei.com --- drivers/irqchip/irq-mvebu-sei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-mvebu-sei.c b/drivers/irqchip/irq-mvebu-sei.c index add4c9c934c8..18832ccc8ff8 100644 --- a/drivers/irqchip/irq-mvebu-sei.c +++ b/drivers/irqchip/irq-mvebu-sei.c @@ -478,7 +478,7 @@ dispose_irq: return ret; } -struct mvebu_sei_caps mvebu_sei_ap806_caps = { +static struct mvebu_sei_caps mvebu_sei_ap806_caps = { .ap_range = { .first = 0, .size = 21,
[tip:perf/core] perf: Remove duplicated workqueue.h include from perf_event.h
Commit-ID: cf5c6c211b7e9eb4f4219f83671432c9ef257187 Gitweb: https://git.kernel.org/tip/cf5c6c211b7e9eb4f4219f83671432c9ef257187 Author: YueHaibing AuthorDate: Thu, 17 Jan 2019 15:25:04 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 21 Jan 2019 15:15:57 -0300 perf: Remove duplicated workqueue.h include from perf_event.h It is already included a little bit higher up in that file. Signed-off-by: YueHaibing Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20190117072504.14428-1-yuehaib...@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- include/linux/perf_event.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index cec02dc63b51..f8ec36197718 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -53,7 +53,6 @@ struct perf_guest_info_callbacks { #include #include #include -#include #include #include
[tip:timers/core] ntp: Remove duplicated include
Commit-ID: 07daef8b41e0d9e7802a448f6766504e7641a234 Gitweb: https://git.kernel.org/tip/07daef8b41e0d9e7802a448f6766504e7641a234 Author: YueHaibing AuthorDate: Sun, 9 Dec 2018 14:22:25 +0800 Committer: Thomas Gleixner CommitDate: Tue, 18 Dec 2018 12:59:33 +0100 ntp: Remove duplicated include Signed-off-by: YueHaibing Signed-off-by: Thomas Gleixner Cc: Cc: Link: https://lkml.kernel.org/r/20181209062225.4344-1-yuehaib...@huawei.com --- kernel/time/ntp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index c5e0cba3b39c..bc3a3c37ec9c 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c @@ -17,7 +17,6 @@ #include #include #include -#include #include "ntp_internal.h" #include "timekeeping_internal.h"
[tip:perf/core] x86/cpu: Drop pointless static qualifier in punit_dev_state_show()
Commit-ID: f703fd374ef8fb06e46713b326d255e20d6278ad Gitweb: https://git.kernel.org/tip/f703fd374ef8fb06e46713b326d255e20d6278ad Author: YueHaibing AuthorDate: Fri, 12 Oct 2018 10:40:22 + Committer: Ingo Molnar CommitDate: Fri, 12 Oct 2018 12:48:44 +0200 x86/cpu: Drop pointless static qualifier in punit_dev_state_show() There is no need to have the 'struct dentry *dev_state' variable static since new value always be assigned before use it. Signed-off-by: YueHaibing Cc: Andy Shevchenko Cc: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: kernel-janit...@vger.kernel.org Link: http://lkml.kernel.org/r/1539340822-117563-1-git-send-email-yuehaib...@huawei.com Signed-off-by: Ingo Molnar --- arch/x86/platform/atom/punit_atom_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/platform/atom/punit_atom_debug.c b/arch/x86/platform/atom/punit_atom_debug.c index 41dae0f0d898..6cb6076223ba 100644 --- a/arch/x86/platform/atom/punit_atom_debug.c +++ b/arch/x86/platform/atom/punit_atom_debug.c @@ -115,7 +115,7 @@ static struct dentry *punit_dbg_file; static int punit_dbgfs_register(struct punit_device *punit_device) { - static struct dentry *dev_state; + struct dentry *dev_state; punit_dbg_file = debugfs_create_dir("punit_atom", NULL); if (!punit_dbg_file)
[tip:perf/core] x86/cpu: Drop pointless static qualifier in punit_dev_state_show()
Commit-ID: f703fd374ef8fb06e46713b326d255e20d6278ad Gitweb: https://git.kernel.org/tip/f703fd374ef8fb06e46713b326d255e20d6278ad Author: YueHaibing AuthorDate: Fri, 12 Oct 2018 10:40:22 + Committer: Ingo Molnar CommitDate: Fri, 12 Oct 2018 12:48:44 +0200 x86/cpu: Drop pointless static qualifier in punit_dev_state_show() There is no need to have the 'struct dentry *dev_state' variable static since new value always be assigned before use it. Signed-off-by: YueHaibing Cc: Andy Shevchenko Cc: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: kernel-janit...@vger.kernel.org Link: http://lkml.kernel.org/r/1539340822-117563-1-git-send-email-yuehaib...@huawei.com Signed-off-by: Ingo Molnar --- arch/x86/platform/atom/punit_atom_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/platform/atom/punit_atom_debug.c b/arch/x86/platform/atom/punit_atom_debug.c index 41dae0f0d898..6cb6076223ba 100644 --- a/arch/x86/platform/atom/punit_atom_debug.c +++ b/arch/x86/platform/atom/punit_atom_debug.c @@ -115,7 +115,7 @@ static struct dentry *punit_dbg_file; static int punit_dbgfs_register(struct punit_device *punit_device) { - static struct dentry *dev_state; + struct dentry *dev_state; punit_dbg_file = debugfs_create_dir("punit_atom", NULL); if (!punit_dbg_file)
[tip:x86/hyperv] x86/hyperv: Remove unused include
Commit-ID: 5140a6f471137205687428b0b8f12f7187bffd18 Gitweb: https://git.kernel.org/tip/5140a6f471137205687428b0b8f12f7187bffd18 Author: YueHaibing AuthorDate: Sun, 23 Sep 2018 08:20:22 + Committer: Thomas Gleixner CommitDate: Thu, 27 Sep 2018 21:21:00 +0200 x86/hyperv: Remove unused include Remove including . It's not needed. Signed-off-by: YueHaibing Signed-off-by: Thomas Gleixner Reviewed-by: Michael Kelley Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: "H. Peter Anvin" Cc: Cc: Link: https://lkml.kernel.org/r/1537690822-97455-1-git-send-email-yuehaib...@huawei.com --- arch/x86/hyperv/hv_apic.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/hyperv/hv_apic.c b/arch/x86/hyperv/hv_apic.c index 2c43e3055948..8eb6fbee8e13 100644 --- a/arch/x86/hyperv/hv_apic.c +++ b/arch/x86/hyperv/hv_apic.c @@ -20,7 +20,6 @@ */ #include -#include #include #include #include
[tip:x86/hyperv] x86/hyperv: Remove unused include
Commit-ID: 5140a6f471137205687428b0b8f12f7187bffd18 Gitweb: https://git.kernel.org/tip/5140a6f471137205687428b0b8f12f7187bffd18 Author: YueHaibing AuthorDate: Sun, 23 Sep 2018 08:20:22 + Committer: Thomas Gleixner CommitDate: Thu, 27 Sep 2018 21:21:00 +0200 x86/hyperv: Remove unused include Remove including . It's not needed. Signed-off-by: YueHaibing Signed-off-by: Thomas Gleixner Reviewed-by: Michael Kelley Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: "H. Peter Anvin" Cc: Cc: Link: https://lkml.kernel.org/r/1537690822-97455-1-git-send-email-yuehaib...@huawei.com --- arch/x86/hyperv/hv_apic.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/hyperv/hv_apic.c b/arch/x86/hyperv/hv_apic.c index 2c43e3055948..8eb6fbee8e13 100644 --- a/arch/x86/hyperv/hv_apic.c +++ b/arch/x86/hyperv/hv_apic.c @@ -20,7 +20,6 @@ */ #include -#include #include #include #include
[tip:x86/cleanups] x86/platform/pcspeaker: Use PTR_ERR_OR_ZERO() to fix ptr_ret.cocci warning
Commit-ID: 2397134ce2d73dcf1d4846579f594c9f3880b2ec Gitweb: https://git.kernel.org/tip/2397134ce2d73dcf1d4846579f594c9f3880b2ec Author: YueHaibing AuthorDate: Fri, 20 Jul 2018 15:32:13 +0800 Committer: Ingo Molnar CommitDate: Tue, 24 Jul 2018 09:46:42 +0200 x86/platform/pcspeaker: Use PTR_ERR_OR_ZERO() to fix ptr_ret.cocci warning The ptr_ret.cocci script generates the following warning: arch/x86/kernel/pcspeaker.c:12:8-14: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO() rather than an open-coded version to fix this. Signed-off-by: YueHaibing Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: gre...@linuxfoundation.org Cc: kstew...@linuxfoundation.org Cc: pombreda...@nexb.com Link: http://lkml.kernel.org/r/20180720073213.14996-1-yuehaib...@huawei.com Signed-off-by: Ingo Molnar --- arch/x86/kernel/pcspeaker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/pcspeaker.c b/arch/x86/kernel/pcspeaker.c index da5190a1ea16..4a710d9a 100644 --- a/arch/x86/kernel/pcspeaker.c +++ b/arch/x86/kernel/pcspeaker.c @@ -9,6 +9,6 @@ static __init int add_pcspkr(void) pd = platform_device_register_simple("pcspkr", -1, NULL, 0); - return IS_ERR(pd) ? PTR_ERR(pd) : 0; + return PTR_ERR_OR_ZERO(pd); } device_initcall(add_pcspkr);
[tip:x86/cleanups] x86/platform/pcspeaker: Use PTR_ERR_OR_ZERO() to fix ptr_ret.cocci warning
Commit-ID: 2397134ce2d73dcf1d4846579f594c9f3880b2ec Gitweb: https://git.kernel.org/tip/2397134ce2d73dcf1d4846579f594c9f3880b2ec Author: YueHaibing AuthorDate: Fri, 20 Jul 2018 15:32:13 +0800 Committer: Ingo Molnar CommitDate: Tue, 24 Jul 2018 09:46:42 +0200 x86/platform/pcspeaker: Use PTR_ERR_OR_ZERO() to fix ptr_ret.cocci warning The ptr_ret.cocci script generates the following warning: arch/x86/kernel/pcspeaker.c:12:8-14: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO() rather than an open-coded version to fix this. Signed-off-by: YueHaibing Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: gre...@linuxfoundation.org Cc: kstew...@linuxfoundation.org Cc: pombreda...@nexb.com Link: http://lkml.kernel.org/r/20180720073213.14996-1-yuehaib...@huawei.com Signed-off-by: Ingo Molnar --- arch/x86/kernel/pcspeaker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/pcspeaker.c b/arch/x86/kernel/pcspeaker.c index da5190a1ea16..4a710d9a 100644 --- a/arch/x86/kernel/pcspeaker.c +++ b/arch/x86/kernel/pcspeaker.c @@ -9,6 +9,6 @@ static __init int add_pcspkr(void) pd = platform_device_register_simple("pcspkr", -1, NULL, 0); - return IS_ERR(pd) ? PTR_ERR(pd) : 0; + return PTR_ERR_OR_ZERO(pd); } device_initcall(add_pcspkr);
[tip:perf/urgent] perf bpf: Fix NULL return handling in bpf__prepare_load()
Commit-ID: ab4e32ff5aa797eaea551dbb67946e2fcb56cc7e Gitweb: https://git.kernel.org/tip/ab4e32ff5aa797eaea551dbb67946e2fcb56cc7e Author: YueHaibing AuthorDate: Fri, 11 May 2018 19:21:42 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 30 May 2018 15:35:31 -0300 perf bpf: Fix NULL return handling in bpf__prepare_load() bpf_object__open()/bpf_object__open_buffer can return error pointer or NULL, check the return values with IS_ERR_OR_NULL() in bpf__prepare_load and bpf__prepare_load_buffer Signed-off-by: YueHaibing Acked-by: Daniel Borkmann Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: net...@vger.kernel.org Link: https://lkml.kernel.org/n/tip-psf4xwc09n62al2cb9s33...@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/bpf-loader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index af7ad814b2c3..cee658733e2c 100644 --- a/tools/perf/util/bpf-loader.c +++ b/tools/perf/util/bpf-loader.c @@ -66,7 +66,7 @@ bpf__prepare_load_buffer(void *obj_buf, size_t obj_buf_sz, const char *name) } obj = bpf_object__open_buffer(obj_buf, obj_buf_sz, name); - if (IS_ERR(obj)) { + if (IS_ERR_OR_NULL(obj)) { pr_debug("bpf: failed to load buffer\n"); return ERR_PTR(-EINVAL); } @@ -102,14 +102,14 @@ struct bpf_object *bpf__prepare_load(const char *filename, bool source) pr_debug("bpf: successfull builtin compilation\n"); obj = bpf_object__open_buffer(obj_buf, obj_buf_sz, filename); - if (!IS_ERR(obj) && llvm_param.dump_obj) + if (!IS_ERR_OR_NULL(obj) && llvm_param.dump_obj) llvm__dump_obj(filename, obj_buf, obj_buf_sz); free(obj_buf); } else obj = bpf_object__open(filename); - if (IS_ERR(obj)) { + if (IS_ERR_OR_NULL(obj)) { pr_debug("bpf: failed to load %s\n", filename); return obj; }
[tip:perf/urgent] perf bpf: Fix NULL return handling in bpf__prepare_load()
Commit-ID: ab4e32ff5aa797eaea551dbb67946e2fcb56cc7e Gitweb: https://git.kernel.org/tip/ab4e32ff5aa797eaea551dbb67946e2fcb56cc7e Author: YueHaibing AuthorDate: Fri, 11 May 2018 19:21:42 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 30 May 2018 15:35:31 -0300 perf bpf: Fix NULL return handling in bpf__prepare_load() bpf_object__open()/bpf_object__open_buffer can return error pointer or NULL, check the return values with IS_ERR_OR_NULL() in bpf__prepare_load and bpf__prepare_load_buffer Signed-off-by: YueHaibing Acked-by: Daniel Borkmann Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: net...@vger.kernel.org Link: https://lkml.kernel.org/n/tip-psf4xwc09n62al2cb9s33...@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/bpf-loader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index af7ad814b2c3..cee658733e2c 100644 --- a/tools/perf/util/bpf-loader.c +++ b/tools/perf/util/bpf-loader.c @@ -66,7 +66,7 @@ bpf__prepare_load_buffer(void *obj_buf, size_t obj_buf_sz, const char *name) } obj = bpf_object__open_buffer(obj_buf, obj_buf_sz, name); - if (IS_ERR(obj)) { + if (IS_ERR_OR_NULL(obj)) { pr_debug("bpf: failed to load buffer\n"); return ERR_PTR(-EINVAL); } @@ -102,14 +102,14 @@ struct bpf_object *bpf__prepare_load(const char *filename, bool source) pr_debug("bpf: successfull builtin compilation\n"); obj = bpf_object__open_buffer(obj_buf, obj_buf_sz, filename); - if (!IS_ERR(obj) && llvm_param.dump_obj) + if (!IS_ERR_OR_NULL(obj) && llvm_param.dump_obj) llvm__dump_obj(filename, obj_buf, obj_buf_sz); free(obj_buf); } else obj = bpf_object__open(filename); - if (IS_ERR(obj)) { + if (IS_ERR_OR_NULL(obj)) { pr_debug("bpf: failed to load %s\n", filename); return obj; }
[tip:perf/core] perf bpf: Fix NULL return handling in bpf__prepare_load()
Commit-ID: 7a36a287de9fbb1ba906e70573d3f2315f7fd609 Gitweb: https://git.kernel.org/tip/7a36a287de9fbb1ba906e70573d3f2315f7fd609 Author: YueHaibingAuthorDate: Fri, 11 May 2018 19:21:42 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 16 May 2018 10:01:55 -0300 perf bpf: Fix NULL return handling in bpf__prepare_load() bpf_object__open()/bpf_object__open_buffer can return error pointer or NULL, check the return values with IS_ERR_OR_NULL() in bpf__prepare_load and bpf__prepare_load_buffer Signed-off-by: YueHaibing Acked-by: Daniel Borkmann Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: net...@vger.kernel.org Link: https://lkml.kernel.org/n/tip-psf4xwc09n62al2cb9s33...@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/bpf-loader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index af7ad814b2c3..cee658733e2c 100644 --- a/tools/perf/util/bpf-loader.c +++ b/tools/perf/util/bpf-loader.c @@ -66,7 +66,7 @@ bpf__prepare_load_buffer(void *obj_buf, size_t obj_buf_sz, const char *name) } obj = bpf_object__open_buffer(obj_buf, obj_buf_sz, name); - if (IS_ERR(obj)) { + if (IS_ERR_OR_NULL(obj)) { pr_debug("bpf: failed to load buffer\n"); return ERR_PTR(-EINVAL); } @@ -102,14 +102,14 @@ struct bpf_object *bpf__prepare_load(const char *filename, bool source) pr_debug("bpf: successfull builtin compilation\n"); obj = bpf_object__open_buffer(obj_buf, obj_buf_sz, filename); - if (!IS_ERR(obj) && llvm_param.dump_obj) + if (!IS_ERR_OR_NULL(obj) && llvm_param.dump_obj) llvm__dump_obj(filename, obj_buf, obj_buf_sz); free(obj_buf); } else obj = bpf_object__open(filename); - if (IS_ERR(obj)) { + if (IS_ERR_OR_NULL(obj)) { pr_debug("bpf: failed to load %s\n", filename); return obj; }
[tip:perf/core] perf bpf: Fix NULL return handling in bpf__prepare_load()
Commit-ID: 7a36a287de9fbb1ba906e70573d3f2315f7fd609 Gitweb: https://git.kernel.org/tip/7a36a287de9fbb1ba906e70573d3f2315f7fd609 Author: YueHaibing AuthorDate: Fri, 11 May 2018 19:21:42 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 16 May 2018 10:01:55 -0300 perf bpf: Fix NULL return handling in bpf__prepare_load() bpf_object__open()/bpf_object__open_buffer can return error pointer or NULL, check the return values with IS_ERR_OR_NULL() in bpf__prepare_load and bpf__prepare_load_buffer Signed-off-by: YueHaibing Acked-by: Daniel Borkmann Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: net...@vger.kernel.org Link: https://lkml.kernel.org/n/tip-psf4xwc09n62al2cb9s33...@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/bpf-loader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index af7ad814b2c3..cee658733e2c 100644 --- a/tools/perf/util/bpf-loader.c +++ b/tools/perf/util/bpf-loader.c @@ -66,7 +66,7 @@ bpf__prepare_load_buffer(void *obj_buf, size_t obj_buf_sz, const char *name) } obj = bpf_object__open_buffer(obj_buf, obj_buf_sz, name); - if (IS_ERR(obj)) { + if (IS_ERR_OR_NULL(obj)) { pr_debug("bpf: failed to load buffer\n"); return ERR_PTR(-EINVAL); } @@ -102,14 +102,14 @@ struct bpf_object *bpf__prepare_load(const char *filename, bool source) pr_debug("bpf: successfull builtin compilation\n"); obj = bpf_object__open_buffer(obj_buf, obj_buf_sz, filename); - if (!IS_ERR(obj) && llvm_param.dump_obj) + if (!IS_ERR_OR_NULL(obj) && llvm_param.dump_obj) llvm__dump_obj(filename, obj_buf, obj_buf_sz); free(obj_buf); } else obj = bpf_object__open(filename); - if (IS_ERR(obj)) { + if (IS_ERR_OR_NULL(obj)) { pr_debug("bpf: failed to load %s\n", filename); return obj; }