Commit 4a0f62a3 authored by Sven Schnelle's avatar Sven Schnelle Committed by Alexander Gordeev
Browse files

s390/ebcdic: Fix length check in codepage_convert()



The current code compares whether the nr argument is less or equal to
zero. As nr is of type unsigned long, this isn't correct. Fix this by just
testing for zero. This is also reported by checkpatch:

unsignedLessThanZero: Checking if unsigned expression 'nr--' is less
than zero.

Reported-by: default avatarJens Remus <jremus@linux.ibm.com>
Signed-off-by: default avatarSven Schnelle <svens@linux.ibm.com>
Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
parent 94446b4d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ extern __u8 _ebc_toupper[256]; /* EBCDIC -> uppercase */
static inline void
codepage_convert(const __u8 *codepage, volatile char *addr, unsigned long nr)
{
	if (nr-- <= 0)
	if (!nr--)
		return;
	asm volatile(
		"	j	2f\n"