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/contract/device.c
          +++ new/usr/src/uts/common/contract/device.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  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   * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
       23 + * Copyright 2019 Joyent, Inc.
  23   24   */
  24   25  
  25   26  #include <sys/mutex.h>
  26   27  #include <sys/debug.h>
  27   28  #include <sys/types.h>
  28   29  #include <sys/param.h>
  29   30  #include <sys/kmem.h>
  30   31  #include <sys/thread.h>
  31   32  #include <sys/id_space.h>
  32   33  #include <sys/avl.h>
↓ open down ↓ 2013 lines elided ↑ open up ↑
2046 2047          ASSERT(spec_type == S_IFBLK || spec_type == S_IFCHR);
2047 2048  
2048 2049          switch (evtype) {
2049 2050          case CT_DEV_EV_OFFLINE:
2050 2051                  result = contract_device_offline(dip, dev, spec_type);
2051 2052                  break;
2052 2053          default:
2053 2054                  cmn_err(CE_PANIC, "contract_device_negotiate(): Negotiation "
2054 2055                      "not supported: event (%d) for dev_t (%lu) and spec (%d), "
2055 2056                      "dip (%p)", evtype, dev, spec_type, (void *)dip);
2056      -                result = CT_NACK;
2057 2057                  break;
2058 2058          }
2059 2059  
2060 2060          return (result);
2061 2061  }
2062 2062  
2063 2063  /*
2064 2064   * A wrapper routine called by other subsystems (such as the LDI) to
2065 2065   * finalize event processing for a state change event. For synchronous
2066 2066   * state changes, this publishes NEGEND events. For asynchronous i.e.
↓ open down ↓ 151 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX