Skip to content

Commit

Permalink
s390/net: Delete useless checks before function calls
Browse files Browse the repository at this point in the history
The function debug_unregister() tests whether its argument is
NULL and then returns immediately. Thus the test around the call
is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Markus Elfring authored and David S. Miller committed Jan 18, 2015
1 parent ee6edb9 commit b646c08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
6 changes: 2 additions & 4 deletions drivers/s390/net/claw.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,8 @@ static debug_info_t *claw_dbf_trace;
static void
claw_unregister_debug_facility(void)
{
if (claw_dbf_setup)
debug_unregister(claw_dbf_setup);
if (claw_dbf_trace)
debug_unregister(claw_dbf_trace);
debug_unregister(claw_dbf_setup);
debug_unregister(claw_dbf_trace);
}

static int
Expand Down
6 changes: 2 additions & 4 deletions drivers/s390/net/lcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,8 @@ static debug_info_t *lcs_dbf_trace;
static void
lcs_unregister_debug_facility(void)
{
if (lcs_dbf_setup)
debug_unregister(lcs_dbf_setup);
if (lcs_dbf_trace)
debug_unregister(lcs_dbf_trace);
debug_unregister(lcs_dbf_setup);
debug_unregister(lcs_dbf_trace);
}

static int
Expand Down
9 changes: 3 additions & 6 deletions drivers/s390/net/netiucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,9 @@ DEFINE_PER_CPU(char[256], iucv_dbf_txt_buf);

static void iucv_unregister_dbf_views(void)
{
if (iucv_dbf_setup)
debug_unregister(iucv_dbf_setup);
if (iucv_dbf_data)
debug_unregister(iucv_dbf_data);
if (iucv_dbf_trace)
debug_unregister(iucv_dbf_trace);
debug_unregister(iucv_dbf_setup);
debug_unregister(iucv_dbf_data);
debug_unregister(iucv_dbf_trace);
}
static int iucv_register_dbf_views(void)
{
Expand Down

0 comments on commit b646c08

Please sign in to comment.