All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] adfs: remove redundant test on unsigned
@ 2009-06-22 21:09 Roel Kluin
  0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2009-06-22 21:09 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, Andrew Morton

unsigned block cannot be less than 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
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;
	}
?

diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c
index 798cb07..3f57ce4 100644
--- a/fs/adfs/inode.c
+++ b/fs/adfs/inode.c
@@ -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;
 }

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-22 19:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-22 21:09 [PATCH] adfs: remove redundant test on unsigned Roel Kluin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.