Commit 5ede9289 authored by Ira Weiny's avatar Ira Weiny Committed by Doug Ledford

IB/core cleanup: Add const to RDMA helpers

The ib_device passed to the new RDMA helpers is constant.  Declare the
ib_device as const in the following functions.

rdma_protocol_ib
rdma_protocol_roce
rdma_protocol_iwarp
rdma_ib_or_roce
rdma_cap_ib_mad
rdma_cap_ib_smi
rdma_cap_ib_cm
rdma_cap_iw_cm
rdma_cap_ib_sa
rdma_cap_ib_mcast
rdma_cap_af_ib
rdma_cap_eth_ah
Signed-off-by: default avatarIra Weiny <ira.weiny@intel.com>
Reviewed-by: default avatarHal Rosenstock <hal@mellanox.com>
Reviewed-by: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 175e8efe
...@@ -1831,22 +1831,22 @@ static inline u8 rdma_end_port(const struct ib_device *device) ...@@ -1831,22 +1831,22 @@ static inline u8 rdma_end_port(const struct ib_device *device)
0 : device->phys_port_cnt; 0 : device->phys_port_cnt;
} }
static inline bool rdma_protocol_ib(struct ib_device *device, u8 port_num) static inline bool rdma_protocol_ib(const struct ib_device *device, u8 port_num)
{ {
return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_IB; return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_IB;
} }
static inline bool rdma_protocol_roce(struct ib_device *device, u8 port_num) static inline bool rdma_protocol_roce(const struct ib_device *device, u8 port_num)
{ {
return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_ROCE; return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_ROCE;
} }
static inline bool rdma_protocol_iwarp(struct ib_device *device, u8 port_num) static inline bool rdma_protocol_iwarp(const struct ib_device *device, u8 port_num)
{ {
return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_IWARP; return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_IWARP;
} }
static inline bool rdma_ib_or_roce(struct ib_device *device, u8 port_num) static inline bool rdma_ib_or_roce(const struct ib_device *device, u8 port_num)
{ {
return device->port_immutable[port_num].core_cap_flags & return device->port_immutable[port_num].core_cap_flags &
(RDMA_CORE_CAP_PROT_IB | RDMA_CORE_CAP_PROT_ROCE); (RDMA_CORE_CAP_PROT_IB | RDMA_CORE_CAP_PROT_ROCE);
...@@ -1864,7 +1864,7 @@ static inline bool rdma_ib_or_roce(struct ib_device *device, u8 port_num) ...@@ -1864,7 +1864,7 @@ static inline bool rdma_ib_or_roce(struct ib_device *device, u8 port_num)
* *
* Return: true if the port supports sending/receiving of MAD packets. * Return: true if the port supports sending/receiving of MAD packets.
*/ */
static inline bool rdma_cap_ib_mad(struct ib_device *device, u8 port_num) static inline bool rdma_cap_ib_mad(const struct ib_device *device, u8 port_num)
{ {
return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_MAD; return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_MAD;
} }
...@@ -1889,7 +1889,7 @@ static inline bool rdma_cap_ib_mad(struct ib_device *device, u8 port_num) ...@@ -1889,7 +1889,7 @@ static inline bool rdma_cap_ib_mad(struct ib_device *device, u8 port_num)
* *
* Return: true if the port provides an SMI. * Return: true if the port provides an SMI.
*/ */
static inline bool rdma_cap_ib_smi(struct ib_device *device, u8 port_num) static inline bool rdma_cap_ib_smi(const struct ib_device *device, u8 port_num)
{ {
return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_SMI; return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_SMI;
} }
...@@ -1909,7 +1909,7 @@ static inline bool rdma_cap_ib_smi(struct ib_device *device, u8 port_num) ...@@ -1909,7 +1909,7 @@ static inline bool rdma_cap_ib_smi(struct ib_device *device, u8 port_num)
* Return: true if the port supports an IB CM (this does not guarantee that * Return: true if the port supports an IB CM (this does not guarantee that
* a CM is actually running however). * a CM is actually running however).
*/ */
static inline bool rdma_cap_ib_cm(struct ib_device *device, u8 port_num) static inline bool rdma_cap_ib_cm(const struct ib_device *device, u8 port_num)
{ {
return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_CM; return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_CM;
} }
...@@ -1926,7 +1926,7 @@ static inline bool rdma_cap_ib_cm(struct ib_device *device, u8 port_num) ...@@ -1926,7 +1926,7 @@ static inline bool rdma_cap_ib_cm(struct ib_device *device, u8 port_num)
* Return: true if the port supports an iWARP CM (this does not guarantee that * Return: true if the port supports an iWARP CM (this does not guarantee that
* a CM is actually running however). * a CM is actually running however).
*/ */
static inline bool rdma_cap_iw_cm(struct ib_device *device, u8 port_num) static inline bool rdma_cap_iw_cm(const struct ib_device *device, u8 port_num)
{ {
return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IW_CM; return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IW_CM;
} }
...@@ -1946,7 +1946,7 @@ static inline bool rdma_cap_iw_cm(struct ib_device *device, u8 port_num) ...@@ -1946,7 +1946,7 @@ static inline bool rdma_cap_iw_cm(struct ib_device *device, u8 port_num)
* Administration interface. This does not imply that the SA service is * Administration interface. This does not imply that the SA service is
* running locally. * running locally.
*/ */
static inline bool rdma_cap_ib_sa(struct ib_device *device, u8 port_num) static inline bool rdma_cap_ib_sa(const struct ib_device *device, u8 port_num)
{ {
return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_SA; return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_SA;
} }
...@@ -1968,7 +1968,7 @@ static inline bool rdma_cap_ib_sa(struct ib_device *device, u8 port_num) ...@@ -1968,7 +1968,7 @@ static inline bool rdma_cap_ib_sa(struct ib_device *device, u8 port_num)
* overhead of registering/unregistering with the SM and tracking of the * overhead of registering/unregistering with the SM and tracking of the
* total number of queue pairs attached to the multicast group. * total number of queue pairs attached to the multicast group.
*/ */
static inline bool rdma_cap_ib_mcast(struct ib_device *device, u8 port_num) static inline bool rdma_cap_ib_mcast(const struct ib_device *device, u8 port_num)
{ {
return rdma_cap_ib_sa(device, port_num); return rdma_cap_ib_sa(device, port_num);
} }
...@@ -1986,7 +1986,7 @@ static inline bool rdma_cap_ib_mcast(struct ib_device *device, u8 port_num) ...@@ -1986,7 +1986,7 @@ static inline bool rdma_cap_ib_mcast(struct ib_device *device, u8 port_num)
* Return: true if the port uses a GID address to identify devices on the * Return: true if the port uses a GID address to identify devices on the
* network. * network.
*/ */
static inline bool rdma_cap_af_ib(struct ib_device *device, u8 port_num) static inline bool rdma_cap_af_ib(const struct ib_device *device, u8 port_num)
{ {
return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_AF_IB; return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_AF_IB;
} }
...@@ -2007,7 +2007,7 @@ static inline bool rdma_cap_af_ib(struct ib_device *device, u8 port_num) ...@@ -2007,7 +2007,7 @@ static inline bool rdma_cap_af_ib(struct ib_device *device, u8 port_num)
* addition of a Global Route Header built from our Ethernet Address * addition of a Global Route Header built from our Ethernet Address
* Handle into our header list for connectionless packets. * Handle into our header list for connectionless packets.
*/ */
static inline bool rdma_cap_eth_ah(struct ib_device *device, u8 port_num) static inline bool rdma_cap_eth_ah(const struct ib_device *device, u8 port_num)
{ {
return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_ETH_AH; return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_ETH_AH;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment