Print this page
7127  remove -Wno-missing-braces from Makefile.uts

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/nvme/nvme.c
          +++ new/usr/src/uts/common/io/nvme/nvme.c
↓ open down ↓ 663 lines elided ↑ open up ↑
 664  664  
 665  665          cv_destroy(&cmd->nc_cv);
 666  666          mutex_destroy(&cmd->nc_mutex);
 667  667  
 668  668          kmem_cache_free(nvme_cmd_cache, cmd);
 669  669  }
 670  670  
 671  671  static int
 672  672  nvme_submit_cmd(nvme_qpair_t *qp, nvme_cmd_t *cmd)
 673  673  {
 674      -        nvme_reg_sqtdbl_t tail = { 0 };
      674 +        nvme_reg_sqtdbl_t tail = { {0} };
 675  675  
 676  676          mutex_enter(&qp->nq_mutex);
 677  677  
 678  678          if (qp->nq_active_cmds == qp->nq_nentry) {
 679  679                  mutex_exit(&qp->nq_mutex);
 680  680                  return (DDI_FAILURE);
 681  681          }
 682  682  
 683  683          cmd->nc_completed = B_FALSE;
 684  684  
↓ open down ↓ 19 lines elided ↑ open up ↑
 704  704          tail.b.sqtdbl_sqt = qp->nq_sqtail = (qp->nq_sqtail + 1) % qp->nq_nentry;
 705  705          nvme_put32(cmd->nc_nvme, qp->nq_sqtdbl, tail.r);
 706  706  
 707  707          mutex_exit(&qp->nq_mutex);
 708  708          return (DDI_SUCCESS);
 709  709  }
 710  710  
 711  711  static nvme_cmd_t *
 712  712  nvme_retrieve_cmd(nvme_t *nvme, nvme_qpair_t *qp)
 713  713  {
 714      -        nvme_reg_cqhdbl_t head = { 0 };
      714 +        nvme_reg_cqhdbl_t head = { {0} };
 715  715  
 716  716          nvme_cqe_t *cqe;
 717  717          nvme_cmd_t *cmd;
 718  718  
 719  719          (void) ddi_dma_sync(qp->nq_cqdma->nd_dmah, 0,
 720  720              sizeof (nvme_cqe_t) * qp->nq_nentry, DDI_DMA_SYNC_FORKERNEL);
 721  721  
 722  722          cqe = &qp->nq_cq[qp->nq_cqhead];
 723  723  
 724  724          /* Check phase tag of CQE. Hardware inverts it for new entries. */
↓ open down ↓ 331 lines elided ↑ open up ↑
1056 1056          mutex_exit(&cmd->nc_mutex);
1057 1057  
1058 1058          nvme_free_cmd(cmd);
1059 1059  }
1060 1060  
1061 1061  static void
1062 1062  nvme_abort_cmd(nvme_cmd_t *abort_cmd)
1063 1063  {
1064 1064          nvme_t *nvme = abort_cmd->nc_nvme;
1065 1065          nvme_cmd_t *cmd = nvme_alloc_cmd(nvme, KM_SLEEP);
1066      -        nvme_abort_cmd_t ac = { 0 };
     1066 +        nvme_abort_cmd_t ac = { {0} };
1067 1067  
1068 1068          sema_p(&nvme->n_abort_sema);
1069 1069  
1070 1070          ac.b.ac_cid = abort_cmd->nc_sqe.sqe_cid;
1071 1071          ac.b.ac_sqid = abort_cmd->nc_sqid;
1072 1072  
1073 1073          /*
1074 1074           * Drop the mutex of the aborted command. From this point on
1075 1075           * we must assume that the abort callback has freed the command.
1076 1076           */
↓ open down ↓ 472 lines elided ↑ open up ↑
1549 1549  fail:
1550 1550          nvme_free_cmd(cmd);
1551 1551  
1552 1552          return (buf);
1553 1553  }
1554 1554  
1555 1555  static int
1556 1556  nvme_set_nqueues(nvme_t *nvme, uint16_t nqueues)
1557 1557  {
1558 1558          nvme_cmd_t *cmd = nvme_alloc_cmd(nvme, KM_SLEEP);
1559      -        nvme_nqueue_t nq = { 0 };
     1559 +        nvme_nqueue_t nq = { {0} };
1560 1560  
1561 1561          nq.b.nq_nsq = nq.b.nq_ncq = nqueues;
1562 1562  
1563 1563          cmd->nc_sqid = 0;
1564 1564          cmd->nc_callback = nvme_wakeup_cmd;
1565 1565          cmd->nc_sqe.sqe_opc = NVME_OPC_SET_FEATURES;
1566 1566          cmd->nc_sqe.sqe_cdw10 = NVME_FEAT_NQUEUES;
1567 1567          cmd->nc_sqe.sqe_cdw11 = nq.r;
1568 1568  
1569 1569          if (nvme_admin_cmd(cmd, NVME_ADMIN_CMD_TIMEOUT) != DDI_SUCCESS) {
↓ open down ↓ 17 lines elided ↑ open up ↑
1587 1587           * Always use the same number of submission and completion queues, and
1588 1588           * never use more than the requested number of queues.
1589 1589           */
1590 1590          return (MIN(nqueues, MIN(nq.b.nq_nsq, nq.b.nq_ncq)));
1591 1591  }
1592 1592  
1593 1593  static int
1594 1594  nvme_create_io_qpair(nvme_t *nvme, nvme_qpair_t *qp, uint16_t idx)
1595 1595  {
1596 1596          nvme_cmd_t *cmd = nvme_alloc_cmd(nvme, KM_SLEEP);
1597      -        nvme_create_queue_dw10_t dw10 = { 0 };
1598      -        nvme_create_cq_dw11_t c_dw11 = { 0 };
1599      -        nvme_create_sq_dw11_t s_dw11 = { 0 };
     1597 +        nvme_create_queue_dw10_t dw10 = { {0} };
     1598 +        nvme_create_cq_dw11_t c_dw11 = { {0} };
     1599 +        nvme_create_sq_dw11_t s_dw11 = { {0} };
1600 1600  
1601 1601          dw10.b.q_qid = idx;
1602 1602          dw10.b.q_qsize = qp->nq_nentry - 1;
1603 1603  
1604 1604          c_dw11.b.cq_pc = 1;
1605 1605          c_dw11.b.cq_ien = 1;
1606 1606          c_dw11.b.cq_iv = idx % nvme->n_intr_cnt;
1607 1607  
1608 1608          cmd->nc_sqid = 0;
1609 1609          cmd->nc_callback = nvme_wakeup_cmd;
↓ open down ↓ 119 lines elided ↑ open up ↑
1729 1729          serial[sizeof (nvme->n_idctl->id_serial)] = '\0';
1730 1730  
1731 1731          (void) snprintf(nvme->n_ns[nsid - 1].ns_devid,
1732 1732              sizeof (nvme->n_ns[0].ns_devid), "%4X-%s-%s-%X",
1733 1733              nvme->n_idctl->id_vid, model, serial, nsid);
1734 1734  }
1735 1735  
1736 1736  static int
1737 1737  nvme_init(nvme_t *nvme)
1738 1738  {
1739      -        nvme_reg_cc_t cc = { 0 };
1740      -        nvme_reg_aqa_t aqa = { 0 };
     1739 +        nvme_reg_cc_t cc = { {0} };
     1740 +        nvme_reg_aqa_t aqa = { {0} };
1741 1741          nvme_reg_asq_t asq = { 0 };
1742 1742          nvme_reg_acq_t acq = { 0 };
1743 1743          nvme_reg_cap_t cap;
1744 1744          nvme_reg_vs_t vs;
1745 1745          nvme_reg_csts_t csts;
1746 1746          int i = 0;
1747 1747          int nqueues;
1748 1748          char model[sizeof (nvme->n_idctl->id_model) + 1];
1749 1749          char *vendor, *product;
1750 1750  
↓ open down ↓ 1117 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX