lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Mon, 14 Mar 2011 12:25:11 +0300
From:	Dan Carpenter <error27@...il.com>
To:	Lars Ellenberg <drbd-dev@...ts.linbit.com>
Cc:	drbd-user@...ts.linbit.com, linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: [patch] drbd: change int to unsigned int

These are changes to make my static checker happy.  I don't know the
code well enough to say if it makes a difference at run-time but it
doesn't hurt to fix these up.

Signed-off-by: Dan Carpenter <error27@...il.com>

diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index fe1564c..f33575c 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -1383,7 +1383,7 @@ static int recv_dless_read(struct drbd_conf *mdev, struct drbd_request *req,
 	D_ASSERT(sector == bio->bi_sector);
 
 	bio_for_each_segment(bvec, bio, i) {
-		expect = min_t(int, data_size, bvec->bv_len);
+		expect = min_t(unsigned int, data_size, bvec->bv_len);
 		rr = drbd_recv(mdev,
 			     kmap(bvec->bv_page)+bvec->bv_offset,
 			     expect);
@@ -3996,7 +3996,7 @@ static int drbd_do_handshake(struct drbd_conf *mdev)
 	    PRO_VERSION_MIN > p->protocol_max)
 		goto incompat;
 
-	mdev->agreed_pro_version = min_t(int, PRO_VERSION_MAX, p->protocol_max);
+	mdev->agreed_pro_version = min_t(unsigned int, PRO_VERSION_MAX, p->protocol_max);
 
 	dev_info(DEV, "Handshake successful: "
 	     "Agreed network protocol version %d\n", mdev->agreed_pro_version);
@@ -4515,7 +4515,7 @@ struct asender_cmd {
 	int (*process)(struct drbd_conf *mdev, struct p_header80 *h);
 };
 
-static struct asender_cmd *get_asender_cmd(int cmd)
+static struct asender_cmd *get_asender_cmd(unsigned int cmd)
 {
 	static struct asender_cmd asender_tbl[] = {
 		/* anything missing from this table is in
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ