Skip to content

Commit

Permalink
drbd: Remove redundant and wrong test for NULL simplification in conn…
Browse files Browse the repository at this point in the history
…_connect()

Since the drbd_socket_okay() function itself tests if the the
socket is NULL, the explicit test "if (sock.socket && &msock.socket)"
was redundent.
Apart from that the address opperator ('&') before msock.socket rendered
the test pointless.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
  • Loading branch information
Philipp Reisner committed Nov 9, 2012
1 parent 3174f8c commit b666dbf
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,13 +985,9 @@ static int conn_connect(struct drbd_tconn *tconn)
goto out_release_sockets;
}

if (sock.socket && &msock.socket) {
ok = drbd_socket_okay(&sock.socket);
ok = drbd_socket_okay(&msock.socket) && ok;
if (ok)
break;
}
} while (1);
ok = drbd_socket_okay(&sock.socket);
ok = drbd_socket_okay(&msock.socket) && ok;
} while (!ok);

if (ad.s_listen)
sock_release(ad.s_listen);
Expand Down

0 comments on commit b666dbf

Please sign in to comment.