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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 25 Dec 2014 16:04:44 -0800
From:	Jeremiah Mahler <jmmahler@...il.com>
To:	Oleg Drokin <oleg.drokin@...el.com>
Cc:	Andreas Dilger <andreas.dilger@...el.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Peng Tao <bergwolf@...il.com>,
	"Peter Zijlstra (Intel)" <peterz@...radead.org>,
	Julia Lawall <Julia.Lawall@...6.fr>,
	Kirill Tkhai <ktkhai@...allels.com>,
	Joe Perches <joe@...ches.com>,
	Zi Shen Lim <zlim.lnx@...il.com>,
	Dmitry Eremin <dmitry.eremin@...el.com>,
	Masaru Nomura <massa.nomura@...il.com>,
	Dan Carpenter <dan.carpenter@...cle.com>,
	James A Shackleford <shack@...ux.com>,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	Jeremiah Mahler <jmmahler@...il.com>
Subject: [PATCH 4/6] staging: lustre: replace MIN with min, cast (__kernel_size_t)

Switch from MIN to min and fix the new type warning.  The
warning is produced because a comparison between iov_len,
which is a __kernel_size_t, is made to kiov_len, which is an
unsigned int (include/linux/lnet/types.h).  Fix the warning
by casting kiov_len to __kernel_size_t.

Signed-off-by: Jeremiah Mahler <jmmahler@...il.com>
---
 drivers/staging/lustre/lnet/lnet/lib-move.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
index 706c5ee..76eb238 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
@@ -403,8 +403,8 @@ lnet_copy_kiov2iov(unsigned int niov, struct iovec *iov, unsigned int iovoffset,
 	do {
 		LASSERT(niov > 0);
 		LASSERT(nkiov > 0);
-		this_nob = MIN(iov->iov_len - iovoffset,
-			       kiov->kiov_len - kiovoffset);
+		this_nob = min(iov->iov_len - iovoffset,
+			       (__kernel_size_t) kiov->kiov_len - kiovoffset);
 		this_nob = min(this_nob, nob);
 
 		if (addr == NULL)
@@ -474,7 +474,7 @@ lnet_copy_iov2kiov(unsigned int nkiov, lnet_kiov_t *kiov,
 	do {
 		LASSERT(nkiov > 0);
 		LASSERT(niov > 0);
-		this_nob = MIN(kiov->kiov_len - kiovoffset,
+		this_nob = min((__kernel_size_t) kiov->kiov_len - kiovoffset,
 			       iov->iov_len - iovoffset);
 		this_nob = min(this_nob, nob);
 
-- 
2.1.4

--
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