Print this page
10120 smatch indenting fixes for usr/src/cmd
Reviewed by: Gergő Doma <domag02@gmail.com>
Portions contributed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/fruadm/fruadm.c
          +++ new/usr/src/cmd/fruadm/fruadm.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  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) 2014 Gary Mills
  24   24   *
  25   25   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  26   26   * Use is subject to license terms.
       27 + *
       28 + * Copyright (c) 2018, Joyent, Inc.
  27   29   */
  28   30  
  29   31  #include <limits.h>
  30   32  #include <stdio.h>
  31   33  #include <stdlib.h>
  32   34  #include <string.h>
  33   35  #include <libintl.h>
  34   36  #include <libfru.h>
  35   37  #include <errno.h>
  36   38  #include <math.h>
↓ open down ↓ 199 lines elided ↑ open up ↑
 236  238                  return;
 237  239          }
 238  240          case FDTYPE_Unicode:
 239  241                  assert(gettext("Unicode not yet supported") == 0);
 240  242                  break;
 241  243          case FDTYPE_ASCII:
 242  244          {
 243  245                  char *disp_str = (char *)alloca(length+1);
 244  246                  for (i = 0; i < length; i++)
 245  247                          disp_str[i] = data[i];
 246      -                        disp_str[i] = '\0';
 247      -                        (void) printf("%s", disp_str);
 248      -                        return;
      248 +                disp_str[i] = '\0';
      249 +                (void) printf("%s", disp_str);
      250 +                return;
 249  251          }
 250  252  
 251  253          case FDTYPE_Enumeration:
 252  254          {
 253  255                  lldata = strtoull((const char *)data, NULL, 0);
 254  256                  for (i = 0; i < def->enum_count; i++) {
 255  257                          if (def->enum_table[i].value == lldata) {
 256  258                          /* strdup such that map_... can realloc if necessary. */
 257  259                                  char *tmp = strdup(def->enum_table[i].text);
 258  260                                  (void) printf("%s", tmp);
↓ open down ↓ 326 lines elided ↑ open up ↑
 585  587          }
 586  588  
 587  589          /* add a new Iterated Record if complete path is not given */
 588  590          if (iter_cnt == 0) {
 589  591                  (void) snprintf(rec_name, sizeof (rec_name), "/%s[+]", *ptr);
 590  592                  if ((err = fru_update_field(nodehdl, segment_name[cnt], 0,
 591  593                      rec_name, data, dataLen)) != FRU_SUCCESS) {
 592  594                          (void) fprintf(stderr,
 593  595                          gettext("fru_update_field():  %s\n"),
 594  596                              fru_strerror(err));
 595      -                return (1);
      597 +                        return (1);
 596  598                  }
 597  599  
 598  600                  iter_cnt = 1;
 599  601          }
 600  602  
 601  603          (void) snprintf(rec_name, sizeof (rec_name), "/%s[%d]%s",
 602  604              *ptr, iter_cnt-1, strrchr(field_name, '/'));
 603  605  
 604  606          if ((convert_update(nodehdl, segment_name[cnt], rec_name,
 605  607              field_value)) != 0) {
↓ open down ↓ 362 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX