From nobody Sat Jun 13 07:14:48 2026 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB80B33507C for ; Sat, 9 May 2026 02:41:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778294483; cv=none; b=NamIoe+fTTzx/pHJuAZc+7jRQHwq+Umi/U/2TnPgYyYiq8cpbPSdQCVvvci5SjzyUgJlni73x6xPBfKAqbwKPDqyh9zSykPY9/PTQQAGTMkakQEHP7y7OUWakvCLWSrCKVqUuuXGXqNwvyKTijMHRxKLArncfJ/MKc3yAQDk4mw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778294483; c=relaxed/simple; bh=DHJVPLU+Df97l7KRCQLbL3vW/Qr4GYO94betjeY9UNA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=V0NYWsxb7pFkPMBBBeZ8BOUPpKMINUTJWXb6fbpTauWxiLK66WcPvKjSr83pT7jMWDLuK46UwbDNneVGb5EfRRVk9z2nP2xAvUNnDHNBPLhrm9wseUguubzWacdA5D7DejNhtuXmNqM2nKoeXerA613vVOrjcZIs6WbNzXBSxRE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZPy8fI1X; arc=none smtp.client-ip=209.85.210.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZPy8fI1X" Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-7dea1272943so1516274a34.0 for ; Fri, 08 May 2026 19:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778294480; x=1778899280; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=pKs3dD3OUU41UF/yUteowq5619hsqPe2p4DfPDuMepY=; b=ZPy8fI1XjCRA9SMUbt8iqJM4/W2M21JWnC0YGt+d3eBdh3vC2VZ8Zw7ZTMOp3EbIan dYdK+nxRsvxZIq69J1/7LGxUwUW14D+xi48fuNjAjep7vAdE66W5ViFkY0Jocsi0I8LQ IxVIrsHbl042/9d1fRcBK8SrwvOXnK2AEPTavzOXWtPfdf5z8k6KD8lmP60EqA7A80+6 7/0XR7LObha6P5X6JbkpJBJemHuLCAOZUTiJq9lTB7jDQBmL6qxUKBblnrDqyK9qNY2G iui4ZhcegmMw+MCuQl1mhbTZd5rS036kr516kIw5KoQgRGqXSliP8kf/O0hwztOM0RLe 7sCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778294480; x=1778899280; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pKs3dD3OUU41UF/yUteowq5619hsqPe2p4DfPDuMepY=; b=B1+TwtmZ/VorIKpcpLMkUz75u1ESnmXlE7bqqmSq23YlSa9MFCii5FFz7IboPN6JGN BNImkcxzwq6nLt80VsTz84lyRgXfFJkFebcpVAg1w+YLCVamBr6jDN5vrQJfftRHANiC Jjb2e7zMEKsoXV7moia3FqIJDvWQLXePL9LEewcX1dVENuBPHfn8aTEmRB9i7acduOt2 zerxpUJNzJIj3Ki9jjH/W4h2o5p1JNRQmBavGVFI1Tk4lH1ccfWQtpkyipt6cl9beUfG afgwpcG0yGsvMkAy8SxgF1mfwuzazpF0rBTHA83k7YZivPL3tWrjz0QCx70hDW+qqZ5S Nz0A== X-Forwarded-Encrypted: i=1; AFNElJ8HuZMBKGMoYBYwzKWMoApBzf7nmEES9lX9BKaY0cTqG8N63DiBEEinIBOu7whUQDoferrYZ4Hu7esEYDs=@vger.kernel.org X-Gm-Message-State: AOJu0YzsO/jZ2G3ZANUcaLj9Pb9TCOYayWaL1Nnt29SqEPa8DBwpXepc 49CyEqG5M6RFXfpopU9l4pK7aEdX6cpAM0mTqocxYYEL5MD9XX4YKe32hAdRuJiE X-Gm-Gg: AeBDiesln9NHP6VoL/JqP5SCoplYi9LFTKEMemTyKcopLhzqhbLKbWdhwX4FWe1GL61 Nf4p8NAQ3uXz92nUANpt7vk1JGc54/Jc1UraQFxOO4xIEOzt5Ihx+8UOyATSYOCyRwswOnIiA1u SJT7SVuu0yH9RkJw013VUKDzqM94JLvZpv1nFndltiXkl6oNKaQuFaXNLrLuQy38lRlcsoPfXdV 2NWQqIPP4P43mGO/AM9qfrGzw5giSNSGl4Z1L8WlZstrmIYYeQXP6ZCkkqV0kzM7rc+Snd+stD5 2sWXaamTeCi8A5osfafJusxMS7d5iIuPjfeuB1+Kw9LAx9v7EDXZdGu1YqBXkM/XXZc5dQTeSNq NtiPrBLZCxOWXaDpjcV6L7Vr91jTuyL8v2uYZy0kZ1q2i4hvo/xeauNc9yCtEPOgUTgRBgFI2bI gu1uvborT5aHVpxce5xZ+WLh43EwNqx3KX9T6lTE4= X-Received: by 2002:a05:6820:161f:b0:694:6acf:a420 with SMTP id 006d021491bc7-69998cc4661mr8167883eaf.15.1778294480626; Fri, 08 May 2026 19:41:20 -0700 (PDT) Received: from Dell.attlocal.net ([108.243.219.47]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4355736dbc0sm3443464fac.11.2026.05.08.19.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2026 19:41:19 -0700 (PDT) From: Akash Sukhavasi To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Akash Sukhavasi Subject: [PATCH] Input: analog: replace deprecated simple_strtoul() with kstrtouint() Date: Fri, 8 May 2026 21:40:48 -0500 Message-ID: <20260509024048.46132-1-akash.sukhavasi@gmail.com> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The simple_strtoul() function is deprecated because it ignores trailing garbage characters, which can mask typos in input. Replace it with kstrtouint() in analog_parse_options() to enforce strict input parsing. Note that this introduces a minor, intended behavior change: while the old code would silently parse a malformed string like "12abc" as 12, the new code will reject it entirely and fall back to the unconfigured state (0xff). This strict parsing is the preferred modern behavior for kernel parameters. Signed-off-by: Akash Sukhavasi --- drivers/input/joystick/analog.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analo= g.c index b6f7bce1c..07ad360f8 100644 --- a/drivers/input/joystick/analog.c +++ b/drivers/input/joystick/analog.c @@ -653,7 +653,7 @@ static struct analog_types analog_types[] =3D { static void analog_parse_options(void) { int i, j; - char *end; + unsigned int parsed_val; =20 for (i =3D 0; i < js_nargs; i++) { =20 @@ -664,8 +664,10 @@ static void analog_parse_options(void) } if (analog_types[j].name) continue; =20 - analog_options[i] =3D simple_strtoul(js[i], &end, 0); - if (end !=3D js[i]) continue; + if (kstrtouint(js[i], 0, &parsed_val) =3D=3D 0) { + analog_options[i] =3D parsed_val; + continue; + } =20 analog_options[i] =3D 0xff; if (!strlen(js[i])) continue; --=20 2.54.0