[readdir] constify ->actor
[firefly-linux-kernel-4.4.55.git] / arch / parisc / hpux / fs.c
index eca8230267cc78cbf499ff05c7fa3c9dbccd39b7..88d0962de65a8ca97c877b90dfb0b9ac59b0bfac 100644 (file)
@@ -111,19 +111,17 @@ int hpux_getdents(unsigned int fd, struct hpux_dirent __user *dirent, unsigned i
 {
        struct fd arg;
        struct hpux_dirent __user * lastdirent;
-       struct getdents_callback buf;
+       struct getdents_callback buf = {
+               .ctx.actor = filldir,
+               .current_dir = dirent,
+               .count = count
+       };
        int error;
 
        arg = fdget(fd);
        if (!arg.file)
                return -EBADF;
 
-       buf.current_dir = dirent;
-       buf.previous = NULL;
-       buf.count = count;
-       buf.error = 0;
-       buf.ctx.actor = filldir;
-
        error = iterate_dir(arg.file, &buf.ctx);
        if (error >= 0)
                error = buf.error;