mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Riina Kikas <riinak@ut.ee>
To: linux-kernel@vger.kernel.org
Cc: mroos@ut.ee
Subject: [PATCH 2.6] clean-up: fixes "unsigned<0" warning
Date: Mon, 6 Dec 2004 22:44:39 +0200 (EET)	[thread overview]
Message-ID: <Pine.SOC.4.61.0412062241420.21075@math.ut.ee> (raw)

This patch fixes 5 warnings "comparison of unsigned expression < 0 is
always false" occuring on lines 1987, 1988, 1989, 1990, 1992

Signed-off-by: Riina Kikas <Riina.Kikas@mail.ee>

--- a/drivers/block/as-iosched.c	2004-11-30 19:43:52.000000000 +0000
+++ b/drivers/block/as-iosched.c	2004-10-31 13:09:19.000000000 +0000
@@ -1974,23 +1974,21 @@
  SHOW_FUNCTION(as_write_batchexpire_show, ad->batch_expire[REQ_ASYNC]);
  #undef SHOW_FUNCTION

-#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX)				\
+#define STORE_FUNCTION(__FUNC, __PTR, MAX)				\
  static ssize_t __FUNC(struct as_data *ad, const char *page, size_t count)	\
  {									\
  	int ret = as_var_store(__PTR, (page), count);		\
-	if (*(__PTR) < (MIN))						\
-		*(__PTR) = (MIN);					\
-	else if (*(__PTR) > (MAX))					\
+	if (*(__PTR) > (MAX))						\
  		*(__PTR) = (MAX);					\
  	return ret;							\
  }
-STORE_FUNCTION(as_readexpire_store, &ad->fifo_expire[REQ_SYNC], 0, INT_MAX);
-STORE_FUNCTION(as_writeexpire_store, &ad->fifo_expire[REQ_ASYNC], 0, INT_MAX);
-STORE_FUNCTION(as_anticexpire_store, &ad->antic_expire, 0, INT_MAX);
+STORE_FUNCTION(as_readexpire_store, &ad->fifo_expire[REQ_SYNC], INT_MAX);
+STORE_FUNCTION(as_writeexpire_store, &ad->fifo_expire[REQ_ASYNC], INT_MAX);
+STORE_FUNCTION(as_anticexpire_store, &ad->antic_expire, INT_MAX);
  STORE_FUNCTION(as_read_batchexpire_store,
-			&ad->batch_expire[REQ_SYNC], 0, INT_MAX);
+			&ad->batch_expire[REQ_SYNC], INT_MAX);
  STORE_FUNCTION(as_write_batchexpire_store,
-			&ad->batch_expire[REQ_ASYNC], 0, INT_MAX);
+			&ad->batch_expire[REQ_ASYNC], INT_MAX);
  #undef STORE_FUNCTION

  static struct as_fs_entry as_est_entry = {

             reply	other threads:[~2004-12-06 20:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-06 20:44 Riina Kikas [this message]
2004-12-06 20:47 Riina Kikas
2004-12-06 20:48 [PATCH 2.6] clean-up: fixes "unsigned>=0" warning Riina Kikas
2004-12-06 21:03 ` Chris Friesen
2004-12-06 21:25   ` Riina Kikas
2004-12-06 20:59 [PATCH 2.6] clean-up: fixes "unsigned<0" warning Riina Kikas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.SOC.4.61.0412062241420.21075@math.ut.ee \
    --to=riinak@ut.ee \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mroos@ut.ee \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®