Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f70cb33b authored by Julia Lawall's avatar Julia Lawall Committed by David Teigland
Browse files

fs/dlm: Drop unnecessary null test

hlist_for_each_entry binds its first argument to a non-null value, and thus
any null test on the value of that argument is superfluous.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/

)

// <smpl>
@@
iterator I;
expression x,E,E1,E2;
statement S,S1,S2;
@@

I(x,...) { <...
- (x != NULL) &&
  E
  ...> }
// </smpl>

Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent a4d935bd
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -248,7 +248,7 @@ static struct connection *assoc2con(int assoc_id)


	for (i = 0 ; i < CONN_HASH_SIZE; i++) {
	for (i = 0 ; i < CONN_HASH_SIZE; i++) {
		hlist_for_each_entry(con, h, &connection_hash[i], list) {
		hlist_for_each_entry(con, h, &connection_hash[i], list) {
			if (con && con->sctp_assoc == assoc_id) {
			if (con->sctp_assoc == assoc_id) {
				mutex_unlock(&connections_lock);
				mutex_unlock(&connections_lock);
				return con;
				return con;
			}
			}