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/cmd/cxgbetool/cxgbetool.c
          +++ new/usr/src/cmd/cxgbetool/cxgbetool.c
↓ open down ↓ 5 lines elided ↑ open up ↑
   6    6   *
   7    7   * A full copy of the text of the CDDL should have accompanied this
   8    8   * source.  A copy of the CDDL is also available via the Internet at
   9    9   * http://www.illumos.org/license/CDDL.
  10   10   */
  11   11  
  12   12  /*
  13   13   * Copyright (c) 2018 by Chelsio Communications, Inc.
  14   14   */
  15   15  
       16 +/*
       17 + * Copyright 2019 Joyent, Inc.
       18 + */
       19 +
  16   20  #include <stdio.h>
  17   21  #include <stdlib.h>
  18   22  #include <unistd.h>
  19   23  #include <stropts.h>
  20   24  #include <sys/types.h>
  21   25  #include <sys/stat.h>
  22   26  #include <fcntl.h>
  23   27  #include <sys/socket.h>
  24   28  #include <strings.h>
  25   29  #include <sys/varargs.h>
↓ open down ↓ 52 lines elided ↑ open up ↑
  78   82  
  79   83  static void usage(FILE *fp)
  80   84  {
  81   85          fprintf(fp, "Usage: %s <path to t4nex#> [operation]\n", progname);
  82   86          fprintf(fp,
  83   87              "\tdevlog                              show device log\n"
  84   88              "\tloadfw <FW image>                   Flash the FW image\n");
  85   89          exit(fp == stderr ? 1 : 0);
  86   90  }
  87   91  
  88      -static void
       92 +__NORETURN static void
  89   93  err(int code, const char *fmt, ...)
  90   94  {
  91   95          va_list ap;
  92   96          int e = errno;
  93   97  
  94   98          va_start(ap, fmt);
  95   99          fprintf(stderr, "error: ");
  96  100          vfprintf(stderr, fmt, ap);
  97  101          fprintf(stderr, ": %s\n", strerror(e));
  98  102          va_end(ap);
↓ open down ↓ 195 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX