Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1636974 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2017-05-06 21:50 +0200 |
| Last post | 2017-05-06 21:50 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 2/3] kernel-sched: Adjust four checks for null pointers SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-06 21:50 +0200
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-05-06 21:50 +0200 |
| Subject | [PATCH 2/3] kernel-sched: Adjust four checks for null pointers |
| Message-ID | <tEdSh-3MB-11@gated-at.bofh.it> |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 6 May 2017 21:17:36 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The script “checkpatch.pl” pointed information out like the following.
Comparison to NULL could be written !…
Thus fix the affected source code place.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
kernel/sched/debug.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index ff599b7f10b6..4a1abb61d1f7 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -231,7 +231,7 @@ static void sd_free_ctl_entry(struct ctl_table **tablep)
for (entry = *tablep; entry->mode; entry++) {
if (entry->child)
sd_free_ctl_entry(&entry->child);
- if (entry->proc_handler == NULL)
+ if (!entry->proc_handler)
kfree(entry->procname);
}
@@ -265,7 +265,7 @@ sd_alloc_ctl_domain_table(struct sched_domain *sd)
{
struct ctl_table *table = sd_alloc_ctl_entry(14);
- if (table == NULL)
+ if (!table)
return NULL;
set_table_entry(&table[0], "min_interval", &sd->min_interval,
@@ -311,7 +311,7 @@ static struct ctl_table *sd_alloc_ctl_cpu_table(int cpu)
for_each_domain(cpu, sd)
domain_num++;
entry = table = sd_alloc_ctl_entry(domain_num + 1);
- if (table == NULL)
+ if (!table)
return NULL;
i = 0;
@@ -336,7 +336,7 @@ void register_sched_domain_sysctl(void)
WARN_ON(sd_ctl_dir[0].child);
sd_ctl_dir[0].child = entry;
- if (entry == NULL)
+ if (!entry)
return;
for_each_possible_cpu(i) {
--
2.12.2
Back to top | Article view | linux.kernel
csiph-web