Commit 6a42265c authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Jason Gunthorpe

RDMA/ocrdma: Make ocrdma_pma_counters() return void

This function always returns 0, so just use void and remove the bogus
checking at the only call site.

Link: https://lore.kernel.org/r/20191029062745.7932-6-leon@kernel.orgSigned-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent be4a8d46
...@@ -268,10 +268,8 @@ int ocrdma_process_mad(struct ib_device *ibdev, ...@@ -268,10 +268,8 @@ int ocrdma_process_mad(struct ib_device *ibdev,
switch (in_mad->mad_hdr.mgmt_class) { switch (in_mad->mad_hdr.mgmt_class) {
case IB_MGMT_CLASS_PERF_MGMT: case IB_MGMT_CLASS_PERF_MGMT:
dev = get_ocrdma_dev(ibdev); dev = get_ocrdma_dev(ibdev);
if (!ocrdma_pma_counters(dev, out_mad)) ocrdma_pma_counters(dev, out_mad);
status = IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY; status = IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY;
else
status = IB_MAD_RESULT_SUCCESS;
break; break;
default: default:
status = IB_MAD_RESULT_SUCCESS; status = IB_MAD_RESULT_SUCCESS;
......
...@@ -670,8 +670,7 @@ static ssize_t ocrdma_dbgfs_ops_write(struct file *filp, ...@@ -670,8 +670,7 @@ static ssize_t ocrdma_dbgfs_ops_write(struct file *filp,
return -EFAULT; return -EFAULT;
} }
int ocrdma_pma_counters(struct ocrdma_dev *dev, void ocrdma_pma_counters(struct ocrdma_dev *dev, struct ib_mad *out_mad)
struct ib_mad *out_mad)
{ {
struct ib_pma_portcounters *pma_cnt; struct ib_pma_portcounters *pma_cnt;
...@@ -682,7 +681,6 @@ int ocrdma_pma_counters(struct ocrdma_dev *dev, ...@@ -682,7 +681,6 @@ int ocrdma_pma_counters(struct ocrdma_dev *dev,
pma_cnt->port_rcv_data = cpu_to_be32(ocrdma_sysfs_rcv_data(dev)); pma_cnt->port_rcv_data = cpu_to_be32(ocrdma_sysfs_rcv_data(dev));
pma_cnt->port_xmit_packets = cpu_to_be32(ocrdma_sysfs_xmit_pkts(dev)); pma_cnt->port_xmit_packets = cpu_to_be32(ocrdma_sysfs_xmit_pkts(dev));
pma_cnt->port_rcv_packets = cpu_to_be32(ocrdma_sysfs_rcv_pkts(dev)); pma_cnt->port_rcv_packets = cpu_to_be32(ocrdma_sysfs_rcv_pkts(dev));
return 0;
} }
static ssize_t ocrdma_dbgfs_ops_read(struct file *filp, char __user *buffer, static ssize_t ocrdma_dbgfs_ops_read(struct file *filp, char __user *buffer,
......
...@@ -69,7 +69,6 @@ bool ocrdma_alloc_stats_resources(struct ocrdma_dev *dev); ...@@ -69,7 +69,6 @@ bool ocrdma_alloc_stats_resources(struct ocrdma_dev *dev);
void ocrdma_release_stats_resources(struct ocrdma_dev *dev); void ocrdma_release_stats_resources(struct ocrdma_dev *dev);
void ocrdma_rem_port_stats(struct ocrdma_dev *dev); void ocrdma_rem_port_stats(struct ocrdma_dev *dev);
void ocrdma_add_port_stats(struct ocrdma_dev *dev); void ocrdma_add_port_stats(struct ocrdma_dev *dev);
int ocrdma_pma_counters(struct ocrdma_dev *dev, void ocrdma_pma_counters(struct ocrdma_dev *dev, struct ib_mad *out_mad);
struct ib_mad *out_mad);
#endif /* __OCRDMA_STATS_H__ */ #endif /* __OCRDMA_STATS_H__ */
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