* [PATCH 0/3] [media] WL1273: Adjustments for two function implementations
@ 2017-09-16 12:18 SF Markus Elfring
2017-09-16 12:19 ` [PATCH 1/3] [media] WL1273: Delete an error message for a failed memory allocation in wl1273_fm_radio_probe() SF Markus Elfring
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: SF Markus Elfring @ 2017-09-16 12:18 UTC (permalink / raw)
To: linux-media, Bhumika Goyal, Gustavo A. R. Silva, Hans Verkuil,
Mauro Carvalho Chehab, Sakari Ailus
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
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(-)
--
2.14.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] [media] WL1273: Delete an error message for a failed memory allocation in wl1273_fm_radio_probe()
2017-09-16 12:18 [PATCH 0/3] [media] WL1273: Adjustments for two function implementations SF Markus Elfring
@ 2017-09-16 12:19 ` SF Markus Elfring
2017-09-16 12:20 ` [PATCH 2/3] [media] WL1273: Delete an unnecessary goto statement in wl1273_fm_suspend() SF Markus Elfring
2017-09-16 12:21 ` [PATCH 3/3] [media] WL1273: Delete an unnecessary variable initialisation " SF Markus Elfring
2 siblings, 0 replies; 4+ messages in thread
From: SF Markus Elfring @ 2017-09-16 12:19 UTC (permalink / raw)
To: linux-media, Bhumika Goyal, Gustavo A. R. Silva, Hans Verkuil,
Mauro Carvalho Chehab, Sakari Ailus
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/radio/radio-wl1273.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c
index 903fcd5e99c0..020a792173f6 100644
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -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;
}
--
2.14.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/3] [media] WL1273: Delete an unnecessary goto statement in wl1273_fm_suspend()
2017-09-16 12:18 [PATCH 0/3] [media] WL1273: Adjustments for two function implementations SF Markus Elfring
2017-09-16 12:19 ` [PATCH 1/3] [media] WL1273: Delete an error message for a failed memory allocation in wl1273_fm_radio_probe() SF Markus Elfring
@ 2017-09-16 12:20 ` SF Markus Elfring
2017-09-16 12:21 ` [PATCH 3/3] [media] WL1273: Delete an unnecessary variable initialisation " SF Markus Elfring
2 siblings, 0 replies; 4+ messages in thread
From: SF Markus Elfring @ 2017-09-16 12:20 UTC (permalink / raw)
To: linux-media, Bhumika Goyal, Gustavo A. R. Silva, Hans Verkuil,
Mauro Carvalho Chehab, Sakari Ailus
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Sep 2017 13:53:22 +0200
* Remove an extra goto statement.
* Delete the label "out" which became unnecessary with this refactoring.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/radio/radio-wl1273.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c
index 020a792173f6..74dc3195ea2c 100644
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -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;
}
--
2.14.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 3/3] [media] WL1273: Delete an unnecessary variable initialisation in wl1273_fm_suspend()
2017-09-16 12:18 [PATCH 0/3] [media] WL1273: Adjustments for two function implementations SF Markus Elfring
2017-09-16 12:19 ` [PATCH 1/3] [media] WL1273: Delete an error message for a failed memory allocation in wl1273_fm_radio_probe() SF Markus Elfring
2017-09-16 12:20 ` [PATCH 2/3] [media] WL1273: Delete an unnecessary goto statement in wl1273_fm_suspend() SF Markus Elfring
@ 2017-09-16 12:21 ` SF Markus Elfring
2 siblings, 0 replies; 4+ messages in thread
From: SF Markus Elfring @ 2017-09-16 12:21 UTC (permalink / raw)
To: linux-media, Bhumika Goyal, Gustavo A. R. Silva, Hans Verkuil,
Mauro Carvalho Chehab, Sakari Ailus
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/radio/radio-wl1273.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c
index 74dc3195ea2c..b8f08bfc31c3 100644
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -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 */
--
2.14.1
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-09-16 12:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-16 12:18 [PATCH 0/3] [media] WL1273: Adjustments for two function implementations SF Markus Elfring
2017-09-16 12:19 ` [PATCH 1/3] [media] WL1273: Delete an error message for a failed memory allocation in wl1273_fm_radio_probe() SF Markus Elfring
2017-09-16 12:20 ` [PATCH 2/3] [media] WL1273: Delete an unnecessary goto statement in wl1273_fm_suspend() SF Markus Elfring
2017-09-16 12:21 ` [PATCH 3/3] [media] WL1273: Delete an unnecessary variable initialisation " SF Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome