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/os/driver_lyr.c
          +++ new/usr/src/uts/common/os/driver_lyr.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   * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   */
  24   24  /*
  25      - * Copyright (c) 2013, Joyent, Inc.  All rights reserved.
       25 + * Copyright 2019 Joyent, Inc.
  26   26   */
  27   27  
  28   28  /*
  29   29   * Layered driver support.
  30   30   */
  31   31  
  32   32  #include <sys/atomic.h>
  33   33  #include <sys/types.h>
  34   34  #include <sys/t_lock.h>
  35   35  #include <sys/param.h>
↓ open down ↓ 1881 lines elided ↑ open up ↑
1917 1917                  *sizep = (uint64_t)value;
1918 1918                  return (DDI_SUCCESS);
1919 1919          }
1920 1920  
1921 1921          /* unable to determine device size */
1922 1922          return (DDI_FAILURE);
1923 1923  }
1924 1924  
1925 1925  int
1926 1926  ldi_ioctl(ldi_handle_t lh, int cmd, intptr_t arg, int mode,
1927      -        cred_t *cr, int *rvalp)
     1927 +    cred_t *cr, int *rvalp)
1928 1928  {
1929 1929          struct ldi_handle       *handlep = (struct ldi_handle *)lh;
1930 1930          vnode_t                 *vp;
1931 1931          dev_t                   dev;
1932 1932          int                     ret, copymode, unused;
1933 1933  
1934 1934          if (lh == NULL)
1935 1935                  return (EINVAL);
1936 1936  
1937 1937          /*
↓ open down ↓ 54 lines elided ↑ open up ↑
1992 1992                  ret = strpoll(vp->v_stream, events, anyyet, reventsp, phpp);
1993 1993          } else {
1994 1994                  return (ENOTSUP);
1995 1995          }
1996 1996  
1997 1997          return (ret);
1998 1998  }
1999 1999  
2000 2000  int
2001 2001  ldi_prop_op(ldi_handle_t lh, ddi_prop_op_t prop_op,
2002      -        int flags, char *name, caddr_t valuep, int *length)
     2002 +    int flags, char *name, caddr_t valuep, int *length)
2003 2003  {
2004 2004          struct ldi_handle       *handlep = (struct ldi_handle *)lh;
2005 2005          dev_t                   dev;
2006 2006          dev_info_t              *dip;
2007 2007          int                     ret;
2008 2008          struct snode            *csp;
2009 2009  
2010 2010          if ((lh == NULL) || (name == NULL) || (strlen(name) == 0))
2011 2011                  return (DDI_PROP_INVAL_ARG);
2012 2012  
↓ open down ↓ 1473 lines elided ↑ open up ↑
3486 3486          ASSERT(spec_type == S_IFBLK || spec_type == S_IFCHR);
3487 3487          ASSERT(dip);
3488 3488          ASSERT(ldi_native_cookie(cookie));
3489 3489  
3490 3490          LDI_EVDBG((CE_NOTE, "ldi_ev_notify(): entered: event=%s, dip=%p",
3491 3491              evname, (void *)dip));
3492 3492  
3493 3493          if (!ldi_ev_sync_event(evname)) {
3494 3494                  cmn_err(CE_PANIC, "ldi_ev_notify(): %s not a "
3495 3495                      "negotiatable event", evname);
3496      -                return (LDI_EV_SUCCESS);
3497 3496          }
3498 3497  
3499 3498          major = ddi_driver_major(dip);
3500 3499          if (major == DDI_MAJOR_T_NONE) {
3501 3500                  char *path = kmem_alloc(MAXPATHLEN, KM_SLEEP);
3502 3501                  (void) ddi_pathname(dip, path);
3503 3502                  cmn_err(CE_WARN, "ldi_ev_notify: cannot derive major number "
3504 3503                      "for device %s", path);
3505 3504                  kmem_free(path, MAXPATHLEN);
3506 3505                  return (LDI_EV_FAILURE);
↓ open down ↓ 251 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX