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

Commit 2db00321 authored by Julia Lawall's avatar Julia Lawall Committed by Roland Dreier
Browse files

IB/ehca: Drop unnecessary NULL test

list_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;
statement S,S1,S2;
@@

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

Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Acked-by: default avatarAlexander Schmidt <alexs@linux.vnet.ibm.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent bd5d0ccb
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -933,11 +933,6 @@ int ehca_unmap_fmr(struct list_head *fmr_list)
	/* check all FMR belong to same SHCA, and check internal flag */
	/* check all FMR belong to same SHCA, and check internal flag */
	list_for_each_entry(ib_fmr, fmr_list, list) {
	list_for_each_entry(ib_fmr, fmr_list, list) {
		prev_shca = shca;
		prev_shca = shca;
		if (!ib_fmr) {
			ehca_gen_err("bad fmr=%p in list", ib_fmr);
			ret = -EINVAL;
			goto unmap_fmr_exit0;
		}
		shca = container_of(ib_fmr->device, struct ehca_shca,
		shca = container_of(ib_fmr->device, struct ehca_shca,
				    ib_device);
				    ib_device);
		e_fmr = container_of(ib_fmr, struct ehca_mr, ib.ib_fmr);
		e_fmr = container_of(ib_fmr, struct ehca_mr, ib.ib_fmr);