Skip to content

Commit

Permalink
fix(tree): use empty brace initializers for zero-initialization
Browse files Browse the repository at this point in the history
prefer `struct foo bar = {}' to `struct foo bar = { 0 }' to avoid
-Wmissing-field-initializers warnings.

stack-info: PR: #594, branch: aws-nslick/stack/35
  • Loading branch information
aws-nslick committed Sep 12, 2024
1 parent db0e3a0 commit 0e1f044
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/nccl_ofi_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ static inline int process_completions(struct fi_cq_data_entry *cq_entry, uint64_
static inline int process_err_completion(nccl_net_ofi_rdma_device_t *device,
struct fid_cq *cq)
{
struct fi_cq_err_entry err_entry = { 0 };
struct fi_cq_err_entry err_entry = {};
nccl_net_ofi_rdma_req_t *req = NULL;
int ret = 0;

Expand Down Expand Up @@ -6291,7 +6291,7 @@ static inline int init_device_rail_ofi_resources(nccl_net_ofi_rdma_device_rail_t

if (ofi_nccl_endpoint_per_communicator() != 0) {
/* Create device-shared completion queue */
struct fi_cq_attr cq_attr = {0};
struct fi_cq_attr cq_attr = {};
cq_attr.format = FI_CQ_FORMAT_DATA;
ret = fi_cq_open(rail_dev->domain, &cq_attr, &rail_dev->cq, NULL);
if (OFI_UNLIKELY(ret != 0)) {
Expand Down
4 changes: 2 additions & 2 deletions src/nccl_ofi_sendrecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static int ofi_process_cq(struct fid_cq *cq, uint64_t max_tag)
{
ssize_t rc = 0;
int ret = 0;
struct fi_cq_err_entry err_buffer = { 0 };
struct fi_cq_err_entry err_buffer = {};
struct fi_cq_tagged_entry cqe_tagged_buffers[cq_read_count];
nccl_net_ofi_sendrecv_req_t *req = NULL;

Expand Down Expand Up @@ -1841,7 +1841,7 @@ static inline int create_send_comm(nccl_net_ofi_conn_handle_t *handle,
nccl_net_ofi_sendrecv_ep_t *ep,
nccl_net_ofi_sendrecv_send_comm_t **s_comm)
{
char remote_ep_addr[MAX_EP_ADDR] = {0};
char remote_ep_addr[MAX_EP_ADDR] = {};
uint64_t tag = 0ULL;
uint64_t max_tag = 0;
size_t req_size = sizeof(nccl_net_ofi_sendrecv_req_t);
Expand Down

0 comments on commit 0e1f044

Please sign in to comment.