diff options
author | Shraddha Barke <shraddha.6596@gmail.com> | 2015-09-11 09:02:28 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-09-13 04:25:00 +0300 |
commit | a90624cf253cc74e9464b42d54aa4825575edefe (patch) | |
tree | 92fcba653faf5e4ab75bf407883dd05185c393a7 /drivers/staging/speakup | |
parent | 114885e08c0e7d55775373f5cea8fa3c0b1ef1e8 (diff) | |
download | linux-a90624cf253cc74e9464b42d54aa4825575edefe.tar.xz |
Staging: speakup: kobjects.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form.
Replacement done with coccinelle:
@replace_rule@
expression e;
@@
-e == NULL
+ !e
Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/speakup')
-rw-r--r-- | drivers/staging/speakup/kobjects.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c index 958add4839bc..fdfeb42b2b8f 100644 --- a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c @@ -368,7 +368,7 @@ static ssize_t synth_show(struct kobject *kobj, struct kobj_attribute *attr, { int rv; - if (synth == NULL) + if (!synth) rv = sprintf(buf, "%s\n", "none"); else rv = sprintf(buf, "%s\n", synth->name); @@ -459,14 +459,14 @@ static ssize_t punc_show(struct kobject *kobj, struct kobj_attribute *attr, unsigned long flags; p_header = spk_var_header_by_name(attr->attr.name); - if (p_header == NULL) { + if (!p_header) { pr_warn("p_header is null, attr->attr.name is %s\n", attr->attr.name); return -EINVAL; } var = spk_get_punc_var(p_header->var_id); - if (var == NULL) { + if (!var) { pr_warn("var is null, p_header->var_id is %i\n", p_header->var_id); return -EINVAL; @@ -501,14 +501,14 @@ static ssize_t punc_store(struct kobject *kobj, struct kobj_attribute *attr, return -EINVAL; p_header = spk_var_header_by_name(attr->attr.name); - if (p_header == NULL) { + if (!p_header) { pr_warn("p_header is null, attr->attr.name is %s\n", attr->attr.name); return -EINVAL; } var = spk_get_punc_var(p_header->var_id); - if (var == NULL) { + if (!var) { pr_warn("var is null, p_header->var_id is %i\n", p_header->var_id); return -EINVAL; @@ -546,7 +546,7 @@ ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr, unsigned long flags; param = spk_var_header_by_name(attr->attr.name); - if (param == NULL) + if (!param) return -EINVAL; spin_lock_irqsave(&speakup_info.spinlock, flags); @@ -622,9 +622,9 @@ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr, unsigned long flags; param = spk_var_header_by_name(attr->attr.name); - if (param == NULL) + if (!param) return -EINVAL; - if (param->data == NULL) + if (!param->data) return 0; ret = 0; cp = (char *)buf; |