Commit 5fa49dd8 authored by Alexander Gordeev's avatar Alexander Gordeev
Browse files

s390/ipl: Fix never less than zero warning



DEFINE_IPL_ATTR_STR_RW() macro produces "unsigned 'len' is never less
than zero." warning when sys_vmcmd_on_*_store() callbacks are defined.

Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202412081614.5uel8F6W-lkp@intel.com/


Fixes: 247576bf ("s390/ipl: Do not accept z/VM CP diag X'008' cmds longer than max length")
Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
parent 41856638
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ static ssize_t sys_##_prefix##_##_name##_store(struct kobject *kobj, \
	if (len >= sizeof(_value))					\
		return -E2BIG;						\
	len = strscpy(_value, buf, sizeof(_value));			\
	if (len < 0)							\
	if ((ssize_t)len < 0)						\
		return len;						\
	strim(_value);							\
	return len;							\