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/common/io/ntxn/unm_nic_hw.c
          +++ new/usr/src/uts/common/io/ntxn/unm_nic_hw.c
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2008 NetXen, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27   27  /*
  28      - * Copyright (c) 2018, Joyent, Inc.
       28 + * Copyright 2019 Joyent, Inc.
  29   29   */
  30   30  
  31   31  #include <sys/types.h>
  32   32  #include <sys/conf.h>
  33   33  #include <sys/debug.h>
  34   34  #include <sys/stropts.h>
  35   35  #include <sys/stream.h>
  36   36  #include <sys/strlog.h>
  37   37  #include <sys/kmem.h>
  38   38  #include <sys/stat.h>
↓ open down ↓ 658 lines elided ↑ open up ↑
 697  697  int
 698  698  unm_nic_hw_write_wx_2M(unm_adapter *adapter, u64 off, void *data, int len)
 699  699  {
 700  700          int rv;
 701  701  
 702  702          rv = unm_nic_pci_get_crb_addr_2M(adapter, &off, len);
 703  703  
 704  704          if (rv == -1) {
 705  705                  cmn_err(CE_PANIC, "%s: invalid offset: 0x%016llx\n",
 706  706                      __FUNCTION__, off);
 707      -                return (-1);
 708  707          }
 709  708  
 710  709          if (rv == 1) {
 711  710                  UNM_WRITE_LOCK_IRQS(&adapter->adapter_lock, flags);
 712  711                  crb_win_lock(adapter);
 713  712                  unm_nic_pci_set_crbwindow_2M(adapter, &off);
 714  713          }
 715  714  
 716  715          switch (len) {
 717  716          case 1:
↓ open down ↓ 88 lines elided ↑ open up ↑
 806  805  int
 807  806  unm_nic_hw_read_wx_2M(unm_adapter *adapter, u64 off, void *data, int len)
 808  807  {
 809  808          int rv;
 810  809  
 811  810          rv = unm_nic_pci_get_crb_addr_2M(adapter, &off, len);
 812  811  
 813  812          if (rv == -1) {
 814  813                  cmn_err(CE_PANIC, "%s: invalid offset: 0x%016llx\n",
 815  814                      __FUNCTION__, off);
 816      -                return (-1);
 817  815          }
 818  816  
 819  817          if (rv == 1) {
 820  818                  UNM_WRITE_LOCK_IRQS(&adapter->adapter_lock, flags);
 821  819                  crb_win_lock(adapter);
 822  820                  unm_nic_pci_set_crbwindow_2M(adapter, &off);
 823  821          }
 824  822  
 825  823          switch (len) {
 826  824          case 1:
↓ open down ↓ 119 lines elided ↑ open up ↑
 946  944          if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) {
 947  945                  qdr_max = NX_P2_ADDR_QDR_NET_MAX;
 948  946          } else {
 949  947                  qdr_max = NX_P3_ADDR_QDR_NET_MAX;
 950  948          }
 951  949  
 952  950          if (ADDR_IN_RANGE(addr, UNM_ADDR_DDR_NET, UNM_ADDR_DDR_NET_MAX)) {
 953  951                  /* DDR network side */
 954  952                  /* MN access should never come here */
 955  953                  cmn_err(CE_PANIC, "%s\n", __FUNCTION__);
 956      -                addr = -1ULL;
 957  954          } else if (ADDR_IN_RANGE(addr, UNM_ADDR_OCM0, UNM_ADDR_OCM0_MAX)) {
 958  955                  addr -= UNM_ADDR_OCM0;
 959  956                  addr += UNM_PCI_OCM0;
 960  957          } else if (ADDR_IN_RANGE(addr, UNM_ADDR_OCM1, UNM_ADDR_OCM1_MAX)) {
 961  958                  addr -= UNM_ADDR_OCM1;
 962  959                  addr += UNM_PCI_OCM1;
 963  960          } else if (ADDR_IN_RANGE(addr, UNM_ADDR_QDR_NET, qdr_max)) {
 964  961                  /* QDR network side */
 965  962                  addr -= UNM_ADDR_QDR_NET;
 966  963                  window = (addr >> 22) & 0x3f;
↓ open down ↓ 1243 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX