RDMA/ocrdma: Make ocrdma_pma_counters() return void
authorLeon Romanovsky <leonro@mellanox.com>
Tue, 29 Oct 2019 06:27:34 +0000 (08:27 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 6 Nov 2019 19:38:57 +0000 (15:38 -0400)
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.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/ocrdma/ocrdma_ah.c
drivers/infiniband/hw/ocrdma/ocrdma_stats.c
drivers/infiniband/hw/ocrdma/ocrdma_stats.h

index 8d3e36d548aae91264bd797e84106e84a14c41ec..f8ebdf7086a139e2e62fa110828b97dfbdc58162 100644 (file)
@@ -268,10 +268,8 @@ int ocrdma_process_mad(struct ib_device *ibdev,
        switch (in_mad->mad_hdr.mgmt_class) {
        case IB_MGMT_CLASS_PERF_MGMT:
                dev = get_ocrdma_dev(ibdev);
-               if (!ocrdma_pma_counters(dev, out_mad))
-                       status = IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY;
-               else
-                       status = IB_MAD_RESULT_SUCCESS;
+               ocrdma_pma_counters(dev, out_mad);
+               status = IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY;
                break;
        default:
                status = IB_MAD_RESULT_SUCCESS;
index dda9b61f53b6763eb5257c8207e4ef16de1cf702..95e8c1560cc2e0a8949ea079732329faa6533cc2 100644 (file)
@@ -670,8 +670,7 @@ err:
        return -EFAULT;
 }
 
-int ocrdma_pma_counters(struct ocrdma_dev *dev,
-                       struct ib_mad *out_mad)
+void ocrdma_pma_counters(struct ocrdma_dev *dev, struct ib_mad *out_mad)
 {
        struct ib_pma_portcounters *pma_cnt;
 
@@ -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_xmit_packets = cpu_to_be32(ocrdma_sysfs_xmit_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,
index bba1fec4f11f265bd88f376dde4c9474634063e6..98feca26ac5503c90039f0f9ee11044ea5aa6407 100644 (file)
@@ -69,7 +69,6 @@ bool ocrdma_alloc_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_add_port_stats(struct ocrdma_dev *dev);
-int ocrdma_pma_counters(struct ocrdma_dev *dev,
-                       struct ib_mad *out_mad);
+void ocrdma_pma_counters(struct ocrdma_dev *dev, struct ib_mad *out_mad);
 
 #endif /* __OCRDMA_STATS_H__ */