mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-16 18:36:46 +07:00
IB/addr: Constify dst_entry pointer
Make dst_entry pointer as const struct dst_entry* to improve code readablity to make sure that dst structure fields are not modified by various functions which are using it. Signed-off-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
6f57c933a4
commit
fd59015d68
@ -313,7 +313,8 @@ static void queue_req(struct addr_req *req)
|
|||||||
mutex_unlock(&lock);
|
mutex_unlock(&lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ib_nl_fetch_ha(struct dst_entry *dst, struct rdma_dev_addr *dev_addr,
|
static int ib_nl_fetch_ha(const struct dst_entry *dst,
|
||||||
|
struct rdma_dev_addr *dev_addr,
|
||||||
const void *daddr, u32 seq, u16 family)
|
const void *daddr, u32 seq, u16 family)
|
||||||
{
|
{
|
||||||
if (rdma_nl_chk_listeners(RDMA_NL_GROUP_LS))
|
if (rdma_nl_chk_listeners(RDMA_NL_GROUP_LS))
|
||||||
@ -324,7 +325,8 @@ static int ib_nl_fetch_ha(struct dst_entry *dst, struct rdma_dev_addr *dev_addr,
|
|||||||
return ib_nl_ip_send_msg(dev_addr, daddr, seq, family);
|
return ib_nl_ip_send_msg(dev_addr, daddr, seq, family);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dst_fetch_ha(struct dst_entry *dst, struct rdma_dev_addr *dev_addr,
|
static int dst_fetch_ha(const struct dst_entry *dst,
|
||||||
|
struct rdma_dev_addr *dev_addr,
|
||||||
const void *daddr)
|
const void *daddr)
|
||||||
{
|
{
|
||||||
struct neighbour *n;
|
struct neighbour *n;
|
||||||
@ -348,7 +350,7 @@ static int dst_fetch_ha(struct dst_entry *dst, struct rdma_dev_addr *dev_addr,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool has_gateway(struct dst_entry *dst, sa_family_t family)
|
static bool has_gateway(const struct dst_entry *dst, sa_family_t family)
|
||||||
{
|
{
|
||||||
struct rtable *rt;
|
struct rtable *rt;
|
||||||
struct rt6_info *rt6;
|
struct rt6_info *rt6;
|
||||||
@ -362,7 +364,7 @@ static bool has_gateway(struct dst_entry *dst, sa_family_t family)
|
|||||||
return rt6->rt6i_flags & RTF_GATEWAY;
|
return rt6->rt6i_flags & RTF_GATEWAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int fetch_ha(struct dst_entry *dst, struct rdma_dev_addr *dev_addr,
|
static int fetch_ha(const struct dst_entry *dst, struct rdma_dev_addr *dev_addr,
|
||||||
const struct sockaddr *dst_in, u32 seq)
|
const struct sockaddr *dst_in, u32 seq)
|
||||||
{
|
{
|
||||||
const struct sockaddr_in *dst_in4 =
|
const struct sockaddr_in *dst_in4 =
|
||||||
@ -466,7 +468,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int addr_resolve_neigh(struct dst_entry *dst,
|
static int addr_resolve_neigh(const struct dst_entry *dst,
|
||||||
const struct sockaddr *dst_in,
|
const struct sockaddr *dst_in,
|
||||||
struct rdma_dev_addr *addr,
|
struct rdma_dev_addr *addr,
|
||||||
u32 seq)
|
u32 seq)
|
||||||
|
Loading…
Reference in New Issue
Block a user