Print this page
5047 don't use atomic_*_nv if you discard the return value

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/os/cmi_hw.c
          +++ new/usr/src/uts/i86pc/os/cmi_hw.c
↓ open down ↓ 1412 lines elided ↑ open up ↑
1413 1413          return (0);
1414 1414  }
1415 1415  
1416 1416  
1417 1417  void
1418 1418  cmi_hdl_rele(cmi_hdl_t ophdl)
1419 1419  {
1420 1420          cmi_hdl_impl_t *hdl = IMPLHDL(ophdl);
1421 1421  
1422 1422          ASSERT(*hdl->cmih_refcntp > 0);
1423      -        (void) atomic_dec_32_nv(hdl->cmih_refcntp);
     1423 +        atomic_dec_32(hdl->cmih_refcntp);
1424 1424  }
1425 1425  
1426 1426  void
1427 1427  cmi_hdl_destroy(cmi_hdl_t ophdl)
1428 1428  {
1429 1429          cmi_hdl_impl_t *hdl = IMPLHDL(ophdl);
1430 1430          cmi_hdl_ent_t *ent;
1431 1431  
1432 1432          /* Release the reference count held by cmi_hdl_create(). */
1433 1433          ASSERT(*hdl->cmih_refcntp > 0);
1434      -        (void) atomic_dec_32_nv(hdl->cmih_refcntp);
     1434 +        atomic_dec_32(hdl->cmih_refcntp);
1435 1435          hdl->cmih_flags |= CMIH_F_DEAD;
1436 1436  
1437 1437          ent = cmi_hdl_ent_lookup(hdl->cmih_chipid, hdl->cmih_coreid,
1438 1438              hdl->cmih_strandid);
1439 1439          /*
1440 1440           * Use busy polling instead of condition variable here because
1441 1441           * cmi_hdl_rele() may be called from #MC handler.
1442 1442           */
1443 1443          while (cmi_hdl_canref(ent)) {
1444 1444                  cmi_hdl_rele(ophdl);
↓ open down ↓ 593 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX