Print this page
10703 smatch unreachable code checking needs reworking
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/io/amd_iommu/amd_iommu_impl.c
          +++ new/usr/src/uts/i86pc/io/amd_iommu/amd_iommu_impl.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   * Copyright 2012 Garrett D'Amore <garrett@damore.org>.  All rights reserved.
       25 + * Copyright 2019 Joyent, Inc.
  25   26   */
  26   27  
  27   28  #include <sys/sunddi.h>
  28   29  #include <sys/sunndi.h>
  29   30  #include <sys/iommulib.h>
  30   31  #include <sys/amd_iommu.h>
  31   32  #include <sys/pci_cap.h>
  32   33  #include <sys/bootconf.h>
  33   34  #include <sys/ddidmareq.h>
  34   35  
↓ open down ↓ 1350 lines elided ↑ open up ↑
1385 1386  
1386 1387          pdip = rdip;
1387 1388          while (pdip = ddi_get_parent(pdip)) {
1388 1389                  if (ddi_is_pci_dip(pdip)) {
1389 1390                          ndi_hold_devi(pdip);
1390 1391                          ndi_rele_devi(rdip);
1391 1392                          return (pdip);
1392 1393                  }
1393 1394          }
1394 1395  
1395      -        cmn_err(
1396 1396  #ifdef  DEBUG
1397      -            CE_PANIC,
     1397 +        cmn_err(CE_PANIC, "%s: %s%d dip = %p has no PCI parent, path = %s",
     1398 +            f, driver, instance, (void *)rdip, path);
1398 1399  #else
1399      -            CE_WARN,
1400      -#endif  /* DEBUG */
1401      -            "%s: %s%d dip = %p has no PCI parent, path = %s",
     1400 +        cmn_err(CE_WARN, "%s: %s%d dip = %p has no PCI parent, path = %s",
1402 1401              f, driver, instance, (void *)rdip, path);
1403      -
1404 1402          ndi_rele_devi(rdip);
     1403 +#endif  /* DEBUG */
1405 1404  
1406 1405          return (NULL);
1407 1406  }
1408 1407  
1409 1408  /* Interface with IOMMULIB */
1410 1409  /*ARGSUSED*/
1411 1410  static int
1412 1411  amd_iommu_probe(iommulib_handle_t handle, dev_info_t *rdip)
1413 1412  {
1414 1413          const char *driver = ddi_driver_name(rdip);
↓ open down ↓ 578 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX