tree-wide: use ASSERT_PTR more

This commit is contained in:
David Tardon
2022-09-13 08:13:27 +02:00
parent 6d64cb0625
commit 995340074e
220 changed files with 1071 additions and 2323 deletions
+2 -4
View File
@@ -49,11 +49,10 @@ int flush_fd(int fd) {
}
ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll) {
uint8_t *p = buf;
uint8_t *p = ASSERT_PTR(buf);
ssize_t n = 0;
assert(fd >= 0);
assert(buf);
/* If called with nbytes == 0, let's call read() at least
* once, to validate the operation */
@@ -108,10 +107,9 @@ int loop_read_exact(int fd, void *buf, size_t nbytes, bool do_poll) {
}
int loop_write(int fd, const void *buf, size_t nbytes, bool do_poll) {
const uint8_t *p = buf;
const uint8_t *p = ASSERT_PTR(buf);
assert(fd >= 0);
assert(buf);
if (_unlikely_(nbytes > (size_t) SSIZE_MAX))
return -EINVAL;