summaryrefslogtreecommitdiffstats
path: root/hw/rdma
diff options
context:
space:
mode:
authorKamal Heib2019-03-14 16:30:30 +0100
committerMarcel Apfelbaum2019-03-16 14:52:44 +0100
commita421c81148925c31c0515aa9d4c543b34e632cea (patch)
treef095521fd32b89bb8f89a907cc614328cb28d02b /hw/rdma
parenthw/rdma: Remove unused parameter from rdma_poll_cq() (diff)
downloadqemu-a421c81148925c31c0515aa9d4c543b34e632cea.tar.gz
qemu-a421c81148925c31c0515aa9d4c543b34e632cea.tar.xz
qemu-a421c81148925c31c0515aa9d4c543b34e632cea.zip
hw/rdma: Use {} instead of {0}
Initialize structs with {} instead of {0} to make sure that all code is using the same convention. Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com> Signed-off-by: Kamal Heib <kamalheib1@gmail.com> Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com> Message-Id: <20190314153031.7197-4-kamalheib1@gmail.com> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Diffstat (limited to 'hw/rdma')
-rw-r--r--hw/rdma/rdma_backend.c18
-rw-r--r--hw/rdma/vmw/pvrdma_cmd.c2
-rw-r--r--hw/rdma/vmw/pvrdma_qp_ops.c2
3 files changed, 11 insertions, 11 deletions
diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c
index 90983d2846..d1660b6474 100644
--- a/hw/rdma/rdma_backend.c
+++ b/hw/rdma/rdma_backend.c
@@ -57,7 +57,7 @@ static void dummy_comp_handler(void *ctx, struct ibv_wc *wc)
static inline void complete_work(enum ibv_wc_status status, uint32_t vendor_err,
void *ctx)
{
- struct ibv_wc wc = {0};
+ struct ibv_wc wc = {};
wc.status = status;
wc.vendor_err = vendor_err;
@@ -273,7 +273,7 @@ static void stop_backend_thread(RdmaBackendThread *thread)
static void start_comp_thread(RdmaBackendDev *backend_dev)
{
- char thread_name[THR_NAME_LEN] = {0};
+ char thread_name[THR_NAME_LEN] = {};
stop_backend_thread(&backend_dev->comp_thread);
@@ -483,7 +483,7 @@ void rdma_backend_post_send(RdmaBackendDev *backend_dev,
struct ibv_sge new_sge[MAX_SGE];
uint32_t bctx_id;
int rc;
- struct ibv_send_wr wr = {0}, *bad_wr;
+ struct ibv_send_wr wr = {}, *bad_wr;
if (!qp->ibqp) { /* This field is not initialized for QP0 and QP1 */
if (qp_type == IBV_QPT_SMI) {
@@ -600,7 +600,7 @@ void rdma_backend_post_recv(RdmaBackendDev *backend_dev,
struct ibv_sge new_sge[MAX_SGE];
uint32_t bctx_id;
int rc;
- struct ibv_recv_wr wr = {0}, *bad_wr;
+ struct ibv_recv_wr wr = {}, *bad_wr;
if (!qp->ibqp) { /* This field does not get initialized for QP0 and QP1 */
if (qp_type == IBV_QPT_SMI) {
@@ -737,7 +737,7 @@ int rdma_backend_create_qp(RdmaBackendQP *qp, uint8_t qp_type,
uint32_t max_recv_wr, uint32_t max_send_sge,
uint32_t max_recv_sge)
{
- struct ibv_qp_init_attr attr = {0};
+ struct ibv_qp_init_attr attr = {};
qp->ibqp = 0;
@@ -782,7 +782,7 @@ int rdma_backend_create_qp(RdmaBackendQP *qp, uint8_t qp_type,
int rdma_backend_qp_state_init(RdmaBackendDev *backend_dev, RdmaBackendQP *qp,
uint8_t qp_type, uint32_t qkey)
{
- struct ibv_qp_attr attr = {0};
+ struct ibv_qp_attr attr = {};
int rc, attr_mask;
attr_mask = IBV_QP_STATE | IBV_QP_PKEY_INDEX | IBV_QP_PORT;
@@ -821,7 +821,7 @@ int rdma_backend_qp_state_rtr(RdmaBackendDev *backend_dev, RdmaBackendQP *qp,
union ibv_gid *dgid, uint32_t dqpn,
uint32_t rq_psn, uint32_t qkey, bool use_qkey)
{
- struct ibv_qp_attr attr = {0};
+ struct ibv_qp_attr attr = {};
union ibv_gid ibv_gid = {
.global.interface_id = dgid->global.interface_id,
.global.subnet_prefix = dgid->global.subnet_prefix
@@ -880,7 +880,7 @@ int rdma_backend_qp_state_rtr(RdmaBackendDev *backend_dev, RdmaBackendQP *qp,
int rdma_backend_qp_state_rts(RdmaBackendQP *qp, uint8_t qp_type,
uint32_t sq_psn, uint32_t qkey, bool use_qkey)
{
- struct ibv_qp_attr attr = {0};
+ struct ibv_qp_attr attr = {};
int rc, attr_mask;
attr.qp_state = IBV_QPS_RTS;
@@ -1012,7 +1012,7 @@ static void process_incoming_mad_req(RdmaBackendDev *backend_dev,
complete_work(IBV_WC_GENERAL_ERR, VENDOR_ERR_INV_MAD_BUFF,
bctx->up_ctx);
} else {
- struct ibv_wc wc = {0};
+ struct ibv_wc wc = {};
memset(mad, 0, bctx->sge.length);
build_mad_hdr((struct ibv_grh *)mad,
(union ibv_gid *)&msg->umad.hdr.addr.gid, &msg->hdr.sgid,
diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c
index 6d56746357..b682e919d5 100644
--- a/hw/rdma/vmw/pvrdma_cmd.c
+++ b/hw/rdma/vmw/pvrdma_cmd.c
@@ -123,7 +123,7 @@ static int query_port(PVRDMADev *dev, union pvrdma_cmd_req *req,
{
struct pvrdma_cmd_query_port *cmd = &req->query_port;
struct pvrdma_cmd_query_port_resp *resp = &rsp->query_port_resp;
- struct pvrdma_port_attr attrs = {0};
+ struct pvrdma_port_attr attrs = {};
if (cmd->port_num > MAX_PORTS) {
return -EINVAL;
diff --git a/hw/rdma/vmw/pvrdma_qp_ops.c b/hw/rdma/vmw/pvrdma_qp_ops.c
index 508d8fca3c..5b9786efbe 100644
--- a/hw/rdma/vmw/pvrdma_qp_ops.c
+++ b/hw/rdma/vmw/pvrdma_qp_ops.c
@@ -114,7 +114,7 @@ static void pvrdma_qp_ops_comp_handler(void *ctx, struct ibv_wc *wc)
static void complete_with_error(uint32_t vendor_err, void *ctx)
{
- struct ibv_wc wc = {0};
+ struct ibv_wc wc = {};
wc.status = IBV_WC_GENERAL_ERR;
wc.vendor_err = vendor_err;