From 1ee0f3a6de2c57944f78a5a31a9bc756da75250e Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 14 Dec 2017 00:45:14 +0000 Subject: [PATCH] inodeL small optimization Pipes always wrap at 18 * 512 bytes so we don't need to do a 32bit comparison here --- Kernel/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/inode.c b/Kernel/inode.c index c39e6e45..86ea99ab 100644 --- a/Kernel/inode.c +++ b/Kernel/inode.c @@ -107,7 +107,7 @@ void readi(inoptr ino, uint8_t flag) #endif udata.u_base += amount; udata.u_offset += amount; - if (ispipe && udata.u_offset >= 18 * BLKSIZE) + if (ispipe && (uint16_t)udata.u_offset >= 18 * BLKSIZE) udata.u_offset = 0; toread -= amount; if (ispipe) { @@ -212,7 +212,7 @@ void writei(inoptr ino, uint8_t flag) udata.u_base += amount; udata.u_offset += amount; if (ispipe) { - if (udata.u_offset >= 18 * 512) + if ((uint16_t)udata.u_offset >= 18 * 512) udata.u_offset = 0; ino->c_node.i_size += amount; /* Wake up any readers */ -- 2.34.1