benet: Adjustments for two function implementations
Subsystems (4)
cover benet: Adjustments for two function implementations
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(-)
Signature · 1 line
2.15.1
PATCH 1/2 benet: Delete an error message for a failed memory allocation in be_alloc_work()
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.
--- drivers/net/ethernet/emulex/benet/be_main.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/ethernet/emulex/benet/be_main.c +1 -4
@@ -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;
Signature · 1 line
2.15.1
PATCH 2/2 benet: Delete an unnecessary return statement in be_work_add_vxlan_port()
In reply to SF Markus ElfringFrom: 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.
--- drivers/net/ethernet/emulex/benet/be_main.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ethernet/emulex/benet/be_main.c +0 -1
@@ -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)
Signature · 1 line
2.15.1