]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: greybus: loopback_test: use octal permissions instead of symbolic
authorIgor Pylypiv <igor.pylypiv@gmail.com>
Thu, 19 Jan 2017 02:21:23 +0000 (18:21 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jan 2017 10:08:00 +0000 (11:08 +0100)
checkpatch.pl warning:
Symbolic permissions are not preferred. Consider using octal permissions.

Signed-off-by: Igor Pylypiv <igor.pylypiv@gmail.com>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/greybus/tools/loopback_test.c

index 5312b2aa32f1f213f1ace0ed348e503df7eea82a..18d7a3d1f3c7723b4051133907ce31aeb609425b 100644 (file)
@@ -521,7 +521,6 @@ static int log_results(struct loopback_test *t)
        int fd, i, len, ret;
        struct tm tm;
        time_t local_time;
-       mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
        char file_name[MAX_SYSFS_PATH];
        char data[CSV_MAX_LINE];
 
@@ -538,7 +537,7 @@ static int log_results(struct loopback_test *t)
                snprintf(file_name, sizeof(file_name), "%s_%d_%d.csv",
                        t->test_name, t->size, t->iteration_max);
 
-               fd = open(file_name, O_WRONLY | O_CREAT | O_APPEND, mode);
+               fd = open(file_name, O_WRONLY | O_CREAT | O_APPEND, 0644);
                if (fd < 0) {
                        fprintf(stderr, "unable to open %s for appendation\n", file_name);
                        abort();