Skip to content

Commit 4a0f62a

Browse files
svens-s390Alexander Gordeev
authored andcommitted
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: Jens Remus <[email protected]> Signed-off-by: Sven Schnelle <[email protected]> Reviewed-by: Heiko Carstens <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
1 parent 94446b4 commit 4a0f62a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/s390/include/asm/ebcdic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern __u8 _ebc_toupper[256]; /* EBCDIC -> uppercase */
2222
static inline void
2323
codepage_convert(const __u8 *codepage, volatile char *addr, unsigned long nr)
2424
{
25-
if (nr-- <= 0)
25+
if (!nr--)
2626
return;
2727
asm volatile(
2828
" j 2f\n"

0 commit comments

Comments
 (0)