]> granicus.if.org Git - sysstat/commitdiff
Remove unneeded variable assignment
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 6 Mar 2022 17:07:55 +0000 (18:07 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 6 Mar 2022 17:07:55 +0000 (18:07 +0100)
nr_types_nr[] array contents are constant. Don't need to set
nr_types_nr[2].

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
sa_common.c

index 3c858de3b5a4d896dde4def366e2e2a74ff68a1b..7cd1c163ee0d776f8a4ce510f1d7a89c12a2ecdb 100644 (file)
@@ -54,7 +54,6 @@ unsigned int hdr_types_nr[] = {FILE_HEADER_ULL_NR, FILE_HEADER_UL_NR, FILE_HEADE
 unsigned int act_types_nr[] = {FILE_ACTIVITY_ULL_NR, FILE_ACTIVITY_UL_NR, FILE_ACTIVITY_U_NR};
 unsigned int rec_types_nr[] = {RECORD_HEADER_ULL_NR, RECORD_HEADER_UL_NR, RECORD_HEADER_U_NR};
 unsigned int extra_desc_types_nr[] = {EXTRA_DESC_ULL_NR, EXTRA_DESC_UL_NR, EXTRA_DESC_U_NR};
-unsigned int nr_types_nr[]  = {0, 0, 1};
 
 /*
  ***************************************************************************
@@ -1588,12 +1587,12 @@ __nr_t read_nr_value(int ifd, char *file, struct file_magic *file_magic,
                     int endian_mismatch, int arch_64, int non_zero)
 {
        __nr_t value;
+       unsigned int nr_types_nr[]  = {0, 0, 1};
 
        sa_fread(ifd, &value, sizeof(__nr_t), HARD_SIZE, UEOF_STOP);
 
        /* Normalize endianness for file_activity structures */
        if (endian_mismatch) {
-               nr_types_nr[2] = 1;
                swap_struct(nr_types_nr, &value, arch_64);
        }