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/common/io/comstar/port/fct/discovery.c
          +++ new/usr/src/uts/common/io/comstar/port/fct/discovery.c
↓ open down ↓ 1152 lines elided ↑ open up ↑
1153 1153                              "handles are used up", rp->rp_id);
1154 1154                          goto hba_fatal_err;
1155 1155                  }
1156 1156                  rp->rp_handle = i;
1157 1157          }
1158 1158          /* By this time rport_handle is valid */
1159 1159          if ((irp->irp_flags & IRP_HANDLE_OPENED) == 0) {
1160 1160                  iport->iport_rp_slots[rp->rp_handle] = irp;
1161 1161                  atomic_or_32(&irp->irp_flags, IRP_HANDLE_OPENED);
1162 1162          }
1163      -        (void) atomic_inc_64_nv(&iport->iport_last_change);
     1163 +        atomic_inc_64(&iport->iport_last_change);
1164 1164          fct_log_remote_port_event(port, ESC_SUNFC_TARGET_ADD,
1165 1165              rp->rp_pwwn, rp->rp_id);
1166 1166  
1167 1167  register_rp_done:;
1168 1168          rw_exit(&irp->irp_lock);
1169 1169          rw_exit(&iport->iport_lock);
1170 1170          return (FCT_SUCCESS);
1171 1171  
1172 1172  hba_fatal_err:;
1173 1173          rw_exit(&irp->irp_lock);
↓ open down ↓ 24 lines elided ↑ open up ↑
1198 1198  
1199 1199          if ((ret = port->port_deregister_remote_port(port, rp)) !=
1200 1200              FCT_SUCCESS) {
1201 1201                  return (ret);
1202 1202          }
1203 1203  
1204 1204          if (irp->irp_flags & IRP_HANDLE_OPENED) {
1205 1205                  atomic_and_32(&irp->irp_flags, ~IRP_HANDLE_OPENED);
1206 1206                  iport->iport_rp_slots[rp->rp_handle] = NULL;
1207 1207          }
1208      -        (void) atomic_inc_64_nv(&iport->iport_last_change);
     1208 +        atomic_inc_64(&iport->iport_last_change);
1209 1209          fct_log_remote_port_event(port, ESC_SUNFC_TARGET_REMOVE,
1210 1210              rp->rp_pwwn, rp->rp_id);
1211 1211  
1212 1212          return (FCT_SUCCESS);
1213 1213  }
1214 1214  
1215 1215  fct_status_t
1216 1216  fct_send_accrjt(fct_cmd_t *cmd, uint8_t accrjt, uint8_t reason, uint8_t expl)
1217 1217  {
1218 1218          fct_local_port_t *port = (fct_local_port_t *)cmd->cmd_port;
↓ open down ↓ 1628 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX