From: Alan Cox Date: Thu, 14 Dec 2017 00:45:14 +0000 (+0000) Subject: inodeL small optimization X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=1ee0f3a6de2c57944f78a5a31a9bc756da75250e;p=FUZIX.git inodeL small optimization Pipes always wrap at 18 * 512 bytes so we don't need to do a 32bit comparison here --- 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 */