RDMA: Change MAD processing function to remove extra casting and parameter
All users of process_mad() converts input pointers from ib_mad_hdr to be ib_mad, update the function declaration to use ib_mad directly. Also remove not used input MAD size parameter. Link: https://lore.kernel.org/r/20191029062745.7932-17-leon@kernel.org Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Tested-By: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Este cometimento está contido em:

cometido por
Jason Gunthorpe

ascendente
333ee7e2d0
cometimento
e26e7b88f6
@@ -2386,24 +2386,21 @@ bail:
|
||||
*/
|
||||
int qib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port,
|
||||
const struct ib_wc *in_wc, const struct ib_grh *in_grh,
|
||||
const struct ib_mad_hdr *in, size_t in_mad_size,
|
||||
struct ib_mad_hdr *out, size_t *out_mad_size,
|
||||
u16 *out_mad_pkey_index)
|
||||
const struct ib_mad *in, struct ib_mad *out,
|
||||
size_t *out_mad_size, u16 *out_mad_pkey_index)
|
||||
{
|
||||
int ret;
|
||||
struct qib_ibport *ibp = to_iport(ibdev, port);
|
||||
struct qib_pportdata *ppd = ppd_from_ibp(ibp);
|
||||
const struct ib_mad *in_mad = (const struct ib_mad *)in;
|
||||
struct ib_mad *out_mad = (struct ib_mad *)out;
|
||||
|
||||
switch (in_mad->mad_hdr.mgmt_class) {
|
||||
switch (in->mad_hdr.mgmt_class) {
|
||||
case IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE:
|
||||
case IB_MGMT_CLASS_SUBN_LID_ROUTED:
|
||||
ret = process_subn(ibdev, mad_flags, port, in_mad, out_mad);
|
||||
ret = process_subn(ibdev, mad_flags, port, in, out);
|
||||
goto bail;
|
||||
|
||||
case IB_MGMT_CLASS_PERF_MGMT:
|
||||
ret = process_perf(ibdev, port, in_mad, out_mad);
|
||||
ret = process_perf(ibdev, port, in, out);
|
||||
goto bail;
|
||||
|
||||
case IB_MGMT_CLASS_CONG_MGMT:
|
||||
@@ -2412,7 +2409,7 @@ int qib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port,
|
||||
ret = IB_MAD_RESULT_SUCCESS;
|
||||
goto bail;
|
||||
}
|
||||
ret = process_cc(ibdev, mad_flags, port, in_mad, out_mad);
|
||||
ret = process_cc(ibdev, mad_flags, port, in, out);
|
||||
goto bail;
|
||||
|
||||
default:
|
||||
|
@@ -245,9 +245,8 @@ void qib_sys_guid_chg(struct qib_ibport *ibp);
|
||||
void qib_node_desc_chg(struct qib_ibport *ibp);
|
||||
int qib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
|
||||
const struct ib_wc *in_wc, const struct ib_grh *in_grh,
|
||||
const struct ib_mad_hdr *in, size_t in_mad_size,
|
||||
struct ib_mad_hdr *out, size_t *out_mad_size,
|
||||
u16 *out_mad_pkey_index);
|
||||
const struct ib_mad *in, struct ib_mad *out,
|
||||
size_t *out_mad_size, u16 *out_mad_pkey_index);
|
||||
void qib_notify_create_mad_agent(struct rvt_dev_info *rdi, int port_idx);
|
||||
void qib_notify_free_mad_agent(struct rvt_dev_info *rdi, int port_idx);
|
||||
|
||||
|
Criar uma nova questão referindo esta
Bloquear um utilizador