From: Markus Elfring <[email protected]>
Date: Mon, 1 Jan 2018 18:50:05 +0100
Two update suggestions were taken into account
from static source code analysis.
Markus Elfring (2):
Delete an error message for a failed memory allocation in be_alloc_work()
Delete an unnecessary return statement in be_work_add_vxlan_port()
drivers/net/ethernet/emulex/benet/be_main.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
--
2.15.1
From: Markus Elfring <[email protected]>
Date: Mon, 1 Jan 2018 18:38:06 +0100
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 <[email protected]>
---
drivers/net/ethernet/emulex/benet/be_main.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index c6e859a27ee6..475d94762306 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -4930,11 +4930,8 @@ static struct be_cmd_work *be_alloc_work(struct be_adapter *adapter,
struct be_cmd_work *work;
work = kzalloc(sizeof(*work), GFP_ATOMIC);
- if (!work) {
- dev_err(&adapter->pdev->dev,
- "be_work memory allocation failed\n");
+ if (!work)
return NULL;
- }
INIT_WORK(&work->work, func);
work->adapter = adapter;
--
2.15.1
From: Markus Elfring <[email protected]>
Date: Mon, 1 Jan 2018 18:45:17 +0100
The script "checkpatch.pl" pointed information out like the following.
WARNING: void function return statements are not generally useful
Thus remove such a statement in the affected function.
Signed-off-by: Markus Elfring <[email protected]>
---
drivers/net/ethernet/emulex/benet/be_main.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 475d94762306..38cc8f875846 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -5001,7 +5001,6 @@ static void be_work_add_vxlan_port(struct work_struct *work)
be_disable_vxlan_offloads(adapter);
done:
kfree(cmd_work);
- return;
}
static void be_work_del_vxlan_port(struct work_struct *work)
--
2.15.1