Skip to contentSkip to conversation

adfs: remove redundant test on unsigned

PATCH New Roel Kluin 1 participant 1 message Jun 22, 2009 VFS

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 adfs: remove redundant test on unsigned

unsigned block cannot be less than 0.

---
Or should it read

	if (!create) {
		if (block >= inode->i_blocks)
			goto abort_toobig;
		...
	} else if (block >= inode->i_blocks) {
		adfs_error(inode->i_sb, "block %d < 0", block);
		return -EIO;
	}

?

fs/adfs/inode.c +0 -7
index 798cb07..3f57ce4 100644
@@ -19,9 +19,6 @@ static int
 adfs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh,
 	       int create)
 {
-	if (block < 0)
-		goto abort_negative;
-
 	if (!create) {
 		if (block >= inode->i_blocks)
 			goto abort_toobig;
@@ -34,10 +31,6 @@ adfs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh,
 	/* don't support allocation of blocks yet */
 	return -EIO;
 
-abort_negative:
-	adfs_error(inode->i_sb, "block %d < 0", block);
-	return -EIO;
-
 abort_toobig:
 	return 0;
 }