[PATCH 5/6] commands: digest: Use MAX_LFS_FILESIZE instead of ~0

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

 



Loff_t is a signed type, so ~0 is a negative number. While it works OK
due to clamping/conversion to ulong when passed to
digest_file_window(), it is better not to rely on that fact and use an
appropriate constant.

Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
---
 commands/digest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/commands/digest.c b/commands/digest.c
index 0edbbec32c..99b27dcc25 100644
--- a/commands/digest.c
+++ b/commands/digest.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <linux/pagemap.h>
 #include <fs.h>
 #include <fcntl.h>
 #include <errno.h>
@@ -35,7 +36,7 @@ int __do_digest(struct digest *d, unsigned char *sig,
 
 	while (*argv) {
 		char *filename = "/dev/mem";
-		loff_t start = 0, size = ~0;
+		loff_t start = 0, size = MAX_LFS_FILESIZE;
 		int show_area = 1;
 
 		/* arguments are either file, file+area or area */
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux