WL1273: Adjustments for two function implementations
Subsystems (2)
cover WL1273: Adjustments for two function implementations
From: Markus Elfring <[email protected]>
Date: Sat, 16 Sep 2017 14:05:45 +0200
Three update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
Delete an error message for a failed memory allocation Delete an unnecessary goto statement
Delete an unnecessary variable initialisation
drivers/media/radio/radio-wl1273.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
Signature · 1 line
2.14.1
PATCH 1/3 WL1273: Delete an error message for a failed memory allocation in wl1273_fm_radio_probe()
From: Markus Elfring <[email protected]>
Date: Sat, 16 Sep 2017 13:28:38 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
--- drivers/media/radio/radio-wl1273.c | 1 - 1 file changed, 1 deletion(-)
drivers/media/radio/radio-wl1273.c +0 -1
@@ -2034,5 +2034,4 @@ static int wl1273_fm_radio_probe(struct platform_device *pdev)if (!radio->buffer) { -pr_err ("Cannot allocate memory for RDS buffer.\n" ); r = -ENOMEM ; goto pdata_err; }
Signature · 1 line
2.14.1
PATCH 2/3 WL1273: Delete an unnecessary goto statement in wl1273_fm_suspend()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Sat, 16 Sep 2017 13:53:22 +0200
* Remove an extra goto statement.
* Delete the label "out" which became unnecessary with this refactoring.
--- drivers/media/radio/radio-wl1273.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/media/radio/radio-wl1273.c +1 -4
@@ -683,12 +683,9 @@ static int wl1273_fm_suspend(struct wl1273_device *radio)else r = -EINVAL ; -if (r) { +if (r)dev_err (radio->dev,"%s: POWER_SET fails: %d\n" , __func__, r); - goto out; - } -out:return r; }
Signature · 1 line
2.14.1
PATCH 3/3 WL1273: Delete an unnecessary variable initialisation in wl1273_fm_suspend()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Sat, 16 Sep 2017 13:55:56 +0200
The local variable "r" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning.
--- drivers/media/radio/radio-wl1273.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/radio/radio-wl1273.c +1 -1
@@ -671,6 +671,6 @@ static int wl1273_fm_start(struct wl1273_device *radio, int new_mode)static int wl1273_fm_suspend (struct wl1273_device *radio) {struct wl1273_core *core = radio->core; -int r =0 ; +int r;/* Cannot go from OFF to SUSPENDED */
Signature · 1 line
2.14.1