Re: [PATCH 09/12] IB/srp: Remove a superfluous check from srp_free_req_data()

Sagi Grimberg
2015-04-30T10:18:48Z

On 4/30/2015 12:01 PM, Bart Van Assche wrote:
> All srp_free_req_data() callers guarantee that ch->target != NULL
> hence remove the ch->target test from srp_free_req_data().

ch->target is not referenced anywhere in this routine. So why does
this guarantee matter?

>
> Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
> Cc: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Cc: Sebastian Parschauer <sebastian.riemer-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
> ---
> drivers/infiniband/ulp/srp/ib_srp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
> index 3727b90..a73eb1e5 100644
> --- a/drivers/infiniband/ulp/srp/ib_srp.c
> +++ b/drivers/infiniband/ulp/srp/ib_srp.c
> @@ -853,7 +853,7 @@ static void srp_free_req_data(struct srp_target_port *target,
> struct srp_request *req;
> int i;
>
> - if (!ch->target || !ch->req_ring)
> + if (!ch->req_ring)
> return;
>
> for (i = 0; i < target->req_ring_size; ++i) {
>

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html