From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Fri, 28 Apr 2017 09:09:13 -0400 Subject: [U-Boot] [U-Boot, v2] ext4: Fix comparision of unsigned expression with < 0 In-Reply-To: <20170426112822.21264-1-lokeshvutla@ti.com> References: <20170426112822.21264-1-lokeshvutla@ti.com> Message-ID: <20170428130913.GR12511@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Apr 26, 2017 at 04:58:22PM +0530, Lokesh Vutla wrote: > In file ext4fs.c funtion ext4fs_read_file() compares an > unsigned expression with < 0 like below > > lbaint_t blknr; > blknr = read_allocated_block(&(node->inode), i); > if (blknr < 0) > return -1; > > blknr is of type ulong/uint64_t. read_allocated_block() returns > long int. So comparing blknr with < 0 will always be false. Instead > declare blknr as long int. > > Similarly ext4/dev.c does a similar comparison. Drop the redundant > comparison. > > Signed-off-by: Lokesh Vutla > Reviewed-by: Tom Rini Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: