linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Doug Ledford <dledford@redhat.com>, Jason Gunthorpe <jgg@mellanox.com>
Cc: Leon Romanovsky <leonro@mellanox.com>,
	RDMA mailing list <linux-rdma@vger.kernel.org>,
	Mike Marciniszyn <mike.marciniszyn@intel.com>,
	Ralph Campbell <ralph.campbell@qlogic.com>
Subject: [PATCH rdma-next 05/16] RDMA/ocrdma: Clean MAD processing logic
Date: Tue, 29 Oct 2019 08:27:34 +0200	[thread overview]
Message-ID: <20191029062745.7932-6-leon@kernel.org> (raw)
In-Reply-To: <20191029062745.7932-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

Remove redundant memset and useless return value.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/ocrdma/ocrdma_ah.c    | 6 ++----
 drivers/infiniband/hw/ocrdma/ocrdma_stats.c | 5 +----
 drivers/infiniband/hw/ocrdma/ocrdma_stats.h | 3 +--
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_ah.c b/drivers/infiniband/hw/ocrdma/ocrdma_ah.c
index 8d3e36d548aa..f8ebdf7086a1 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_ah.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_ah.c
@@ -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;
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_stats.c b/drivers/infiniband/hw/ocrdma/ocrdma_stats.c
index a902942adb5d..95e8c1560cc2 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_stats.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_stats.c
@@ -670,12 +670,10 @@ static ssize_t ocrdma_dbgfs_ops_write(struct file *filp,
 	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;
 
-	memset(out_mad->data, 0, sizeof out_mad->data);
 	pma_cnt = (void *)(out_mad->data + 40);
 	ocrdma_update_stats(dev);
 
@@ -683,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,
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_stats.h b/drivers/infiniband/hw/ocrdma/ocrdma_stats.h
index bba1fec4f11f..98feca26ac55 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_stats.h
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_stats.h
@@ -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__ */
-- 
2.20.1


  parent reply	other threads:[~2019-10-29  6:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29  6:27 [PATCH rdma-next 00/16] MAD cleanup Leon Romanovsky
2019-10-29  6:27 ` [PATCH rdma-next 01/16] RDMA/mad: Delete never implemented functions Leon Romanovsky
2019-10-29  6:27 ` [PATCH rdma-next 02/16] RDMA/mad: Allocate zeroed MAD buffer Leon Romanovsky
2019-10-29  6:27 ` [PATCH rdma-next 03/16] RDMA/mlx4: Delete redundant zero memset Leon Romanovsky
2019-10-29  6:27 ` [PATCH rdma-next 04/16] RDMA/mlx5: " Leon Romanovsky
2019-10-29  6:27 ` Leon Romanovsky [this message]
2019-10-29  6:27 ` [PATCH rdma-next 06/16] RDMA/qib: Delete redundant memset for MAD output buffer Leon Romanovsky
2019-10-29  6:27 ` [PATCH rdma-next 07/16] RDMA/hfi1: Delete unreachable code Leon Romanovsky
2019-10-29 23:33   ` Ira Weiny
2019-10-30  0:02     ` Ira Weiny
2019-10-29  6:27 ` [PATCH rdma-next 08/16] RDMA/mlx4: " Leon Romanovsky
2019-10-29  6:27 ` [PATCH rdma-next 09/16] RDMA/mlx5: " Leon Romanovsky
2019-10-29  6:27 ` [PATCH rdma-next 10/16] RDMA/mthca: " Leon Romanovsky
2019-10-29  6:27 ` [PATCH rdma-next 11/16] RDMA/ocrdma: Simplify process_mad function Leon Romanovsky
2019-10-29  6:27 ` [PATCH rdma-next 12/16] RDMA/qib: Delete unreachable code Leon Romanovsky
2019-10-29  6:27 ` [PATCH rdma-next 13/16] RDMA/mlx5: Rewrite MAD processing logic to be readable Leon Romanovsky
2019-10-29  6:27 ` [PATCH rdma-next 14/16] RDMA/qib: Delete extra line Leon Romanovsky
2019-10-29  6:27 ` [PATCH rdma-next 15/16] RDMA/qib: Delete unused variable in process_cc call Leon Romanovsky
2019-10-29  6:27 ` [PATCH rdma-next 16/16] RDMA: Change MAD processing function to remove extra casting and parameter Leon Romanovsky
2019-11-11 13:33   ` Marciniszyn, Mike
2019-11-11 15:06     ` Leon Romanovsky
2019-11-06 20:14 ` [PATCH rdma-next 00/16] MAD cleanup Jason Gunthorpe
2019-11-11 15:06   ` Leon Romanovsky
2019-11-13  0:37 ` Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191029062745.7932-6-leon@kernel.org \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=jgg@mellanox.com \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mike.marciniszyn@intel.com \
    --cc=ralph.campbell@qlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).