syscall_fs: stop sdcc making such a hash of this
authorAlan Cox <alan@linux.intel.com>
Sun, 9 Sep 2018 23:18:33 +0000 (00:18 +0100)
committerAlan Cox <alan@linux.intel.com>
Sun, 9 Sep 2018 23:18:33 +0000 (00:18 +0100)
Kernel/syscall_fs.c

index 767c159..60ea8c9 100644 (file)
@@ -140,6 +140,7 @@ arg_t _fstat(void)
 /* Utility for stat and fstat */
 int stcpy(inoptr ino, char *buf)
 {
+       static uint8_t zero[4];
        /* Copying the structure a member at a time is too expensive.  Instead we
         * copy sequential runs of identical types (the only members which the
         * compiler guarantees are next to each other). */
@@ -147,13 +148,12 @@ int stcpy(inoptr ino, char *buf)
        /* VIRTUAL: If we ever do true virtual memory we'll need to copy the
           structure first or we may sleep and copy bits from different inode
           states */
-       uint32_t zero = 0;
        struct _uzistat* st = (struct _uzistat*) buf;
        int err = uput(&ino->c_dev,            &st->st_dev,   2 * sizeof(uint16_t));
        err |=    uput(&ino->c_node.i_mode,    &st->st_mode,  4 * sizeof(uint16_t));
        err |=    uput(&ino->c_node.i_addr[0], &st->st_rdev,  1 * sizeof(uint16_t));
        err |=    uput(&ino->c_node.i_size,    &st->st_size,  4 * sizeof(uint32_t));
-       err |=    uput(&zero,                  &st->st_timeh, 1 * sizeof(uint32_t));
+       err |=    uput(zero,                   &st->st_timeh, 4);
        return err;
 }