Skip to contentSkip to conversation

kernel/sysctl.c: remove duplicate UINT_MAX check on do_proc_douintvec_conv()

PATCH New [email protected] 1 participant 1 message Oct 3, 2017 Proc sysctl

lore
Share & tools
lore
#0 lore raw

PATCH 36/51 kernel/sysctl.c: remove duplicate UINT_MAX check on do_proc_douintvec_conv()

From: "Luis R. Rodriguez" <[email protected]>
Subject: kernel/sysctl.c: remove duplicate UINT_MAX check on do_proc_douintvec_conv()

do_proc_douintvec_conv() has two UINT_MAX checks, we can remove one. This has no functional changes other than fixing a compiler warning:

kernel/sysctl.c:2190]: (warning) Identical condition '*lvalp>UINT_MAX', second condition is always false

---

 kernel/sysctl.c |    2 --
 1 file changed, 2 deletions(-)
kernel/sysctl.c renamed from kernel/sysctl.c~sysctl-remove-duplicate-uint_max-check-on-do_proc_douintvec_conv +0 -2
diff -puN kernel/sysctl.c~sysctl-remove-duplicate-uint_max-check-on-do_proc_douintvec_conv kernel/sysctl.c
@@ -2188,8 +2188,6 @@ static int do_proc_douintvec_conv(unsign
 	if (write) {
 		if (*lvalp > UINT_MAX)
 			return -EINVAL;
-		if (*lvalp > UINT_MAX)
-			return -EINVAL;
 		*valp = *lvalp;
 	} else {
 		unsigned int val = *valp;

_