zlogger: remove redundant checks 55/282955/1
authorMichal Bloch <m.bloch@samsung.com>
Thu, 13 Oct 2022 14:42:22 +0000 (16:42 +0200)
committerMichal Bloch <m.bloch@samsung.com>
Thu, 13 Oct 2022 14:42:22 +0000 (16:42 +0200)
Change-Id: Ife5c039ef61cf28358ce10e3a82d41ebb1201c1e

kernel/zlogger/zlogger.c

index ac7aa4a..32eefbf 100644 (file)
@@ -528,7 +528,7 @@ static ssize_t partition_write_buffer(struct zlog_file *zlog_file_data, size_t l
        while (cb < buffer + len) {
                int res;
 
-               if (*cb == '\0' && cb < buffer + len) {
+               if (*cb == '\0') {
                        cb++;
                        continue;
                }
@@ -538,8 +538,7 @@ static ssize_t partition_write_buffer(struct zlog_file *zlog_file_data, size_t l
                        return -EFAULT;
                }
 
-               if (cb < buffer + len)
-                       cb += strnlen(cb, len - (cb - buffer));
+               cb += strnlen(cb, len - (cb - buffer));
        }
        return 0;
 }