[patch] inotify: make nr_watches unsigned

From: Robert Love
Date: Mon Oct 04 2004 - 13:32:51 EST


John,

Attached trivial patch makes nr_watches unsigned. The value never goes
negative, so we might as well benefit from the increased ranged and
better defined overflow semantics.

Also, manipulating unsigned variables is quicker on all architectures
(modulo SH5, but they like to be rebels).

Robert Love

Make nr_watches unsigned, or else.

Signed-Off-By: Robert Love <rml@xxxxxxxxxx>

drivers/char/inotify.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)

diff -urN linux-inotify/drivers/char/inotify.c linux/drivers/char/inotify.c
--- linux-inotify/drivers/char/inotify.c 2004-10-04 14:15:58.247682768 -0400
+++ linux/drivers/char/inotify.c 2004-10-04 14:21:04.635104800 -0400
@@ -78,7 +78,7 @@
struct list_head watches;
spinlock_t lock;
unsigned int event_count;
- int nr_watches;
+ unsigned int nr_watches;
};

struct inotify_watch {