[PATCH] trivial - filemap.c - comparison of unsigned expression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"if (likely(copied >= 0))" is always true because "copied" is defined as size_t.

Signed-off-by: Richard Weinberger <richard@xxxxxx>

diff --git a/mm/filemap.c b/mm/filemap.c
index 90b657b..8e93057 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1939,24 +1939,22 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov,
 			continue;
 		}
 zero_length_segment:
-		if (likely(copied >= 0)) {
-			if (!status)
-				status = copied;
-
-			if (status >= 0) {
-				written += status;
-				count -= status;
-				pos += status;
-				buf += status;
-				if (unlikely(nr_segs > 1)) {
-					filemap_set_next_iovec(&cur_iov,
-							&iov_base, status);
-					if (count)
-						buf = cur_iov->iov_base +
-							iov_base;
-				} else {
-					iov_base += status;
-				}
+		if (!status)
+			status = copied;
+
+		if (status >= 0) {
+			written += status;
+			count -= status;
+			pos += status;
+			buf += status;
+			if (unlikely(nr_segs > 1)) {
+				filemap_set_next_iovec(&cur_iov,
+						&iov_base, status);
+				if (count)
+					buf = cur_iov->iov_base +
+						iov_base;
+			} else {
+				iov_base += status;
 			}
 		}
 		if (unlikely(copied != bytes))

-
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux