Re: [PATCH 3/5] IB/core: Convert management helpers to core capability bits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 11, 2015 at 09:46:56PM -0400, ira.weiny@xxxxxxxxx wrote:
> From: Ira Weiny <ira.weiny@xxxxxxxxx>
> 
> Remove query_protocol callback
> 
> Use the new Core Capability bits for:

Looks broadly reasonable to me, I see why you'd want to keep the
driver functions added in the last patch, so disregard my comment on
null..

>  static inline bool rdma_protocol_ib(struct ib_device *device, u8 port_num)
>  {
> -	return device->query_protocol(device, port_num) == RDMA_PROTOCOL_IB;
> +	return (device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_IB)
> +		== RDMA_CORE_CAP_PROT_IB;
>  }

This pattern can just be

 return device->port_immutable[port_num].core_cap_flags &
 RDMA_CORE_CAP_PROT_IB;

Cast to bool will cannonize it automatically

> -	return (pt == RDMA_PROTOCOL_IB || pt == RDMA_PROTOCOL_IBOE);
> +	return ((flags & RDMA_CORE_CAP_PROT_IB) == RDMA_CORE_CAP_PROT_IB ||
> +		(flags & RDMA_CORE_CAP_PROT_IBOE) ==
> RDMA_CORE_CAP_PROT_IBOE);

 return device->port_immutable[port_num].core_cap_flags & (RDMA_CORE_CAP_PROT_IB | RDMA_CORE_CAP_PROT_IBOE);

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




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux