Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp2814840imc; Sat, 23 Feb 2019 11:48:21 -0800 (PST) X-Google-Smtp-Source: AHgI3IaovQQt/VRgPHGe5i8C/fVOid06YfBsuTr2KqgNe3iyBZLp526KKWTO6O6c32A86wFPejNm X-Received: by 2002:a63:40c1:: with SMTP id n184mr9681260pga.225.1550951301248; Sat, 23 Feb 2019 11:48:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550951301; cv=none; d=google.com; s=arc-20160816; b=g2A8LkN4dunERzulmC4cNiUcqt/94rMF8sfH16HVUazCiRJrJZ3NjyYoL9Xph8jIUG zuJsy/ovnZkOmAiP3H7qZV36UiXOPqbkn9wSU8R/4IWpSomiIXOPurMPUkF+U9VW4O2z zDypU4whrjxPUmVjTNjrS2QqUbOWkHt8G7uVYtKy1NgXxkIFcrN1UlPFRrxUwqoFmtPP 7GqGgdqy52fMTsoiGzGpyf9SLZEj58uEYw7ZeVPFl1Mrz+2ZfF48y1ac6FvWxcV5Lyo9 jsR+WkoxNSHiDOFkMwy/kuCIYUSRhO+qy43RnO3Dz6CNrJdNqxG6tnyvPbVABn23npdV ik+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization :content-disposition:mime-version:mail-followup-to:message-id :subject:to:from:date; bh=Ok2wRw0PRNdRziBcEOGw4Il9ZuNabVpm/OAifobHssE=; b=yMps8cJh5tBvBkMIoupK7s655ufkFoKGaUdafdY/V9KfTjSMK4CcKEFgnZ/xUhnc+h BIbH26jLI/3Cy5Zuv/aiPl9oOlHMnOxdOsFFWn1OG0kI05RnwkhZJ2rr3yfjoDgHqmIz 8rrEUCZK70MgL+CxouI5yuSpd8YNtzyr8gUt/dk7e40lUJc27z2+hc8hJNlcFtX34rSE i//bWy9VNGyZ62LEMzeejaquBsOABw2IRbZV4RQhBmHEdkcLfKSy9V68GkTL7Nd3Og// bETVRbfOC+/OZJ75H9k0iVDez/qbO6QvER8kt5oAJ7x9UfJdshYgJozc1uOn3Sug3Rdq LhZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si4408690plo.381.2019.02.23.11.48.03; Sat, 23 Feb 2019 11:48:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727903AbfBWTrj (ORCPT + 99 others); Sat, 23 Feb 2019 14:47:39 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:55088 "EHLO hera.aquilenet.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfBWTri (ORCPT ); Sat, 23 Feb 2019 14:47:38 -0500 X-Greylist: delayed 584 seconds by postgrey-1.27 at vger.kernel.org; Sat, 23 Feb 2019 14:47:37 EST Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id A17264A51; Sat, 23 Feb 2019 20:42:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SzFUbgQzeP26; Sat, 23 Feb 2019 20:42:20 +0100 (CET) Received: from function (dhcp-97-171.dsi-ext.ens-lyon.fr [140.77.97.171]) by hera.aquilenet.fr (Postfix) with ESMTPSA id B8A4F4A4B; Sat, 23 Feb 2019 20:42:20 +0100 (CET) Received: from samy by function with local (Exim 4.92-RC6) (envelope-from ) id 1gxdBj-0004d8-Rf; Sat, 23 Feb 2019 20:42:19 +0100 Date: Sat, 23 Feb 2019 20:42:19 +0100 From: Samuel Thibault To: w.d.hubbs@gmail.com, chris@the-brannons.com, kirk@reisers.ca, gregkh@linuxfoundation.org, speakup@linux-speakup.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: Note that simple_strtoul can't simply be replaced by kstrtoul Message-ID: <20190223194219.qxvi7cwfp3etqdfi@function> Mail-Followup-To: Samuel Thibault , w.d.hubbs@gmail.com, chris@the-brannons.com, kirk@reisers.ca, gregkh@linuxfoundation.org, speakup@linux-speakup.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Organization: I am not organized User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We often receive patches which erroneously try to use kstrtoul in these places. Signed-off-by: Samuel Thibault --- drivers/staging/speakup/kobjects.c | 2 ++ drivers/staging/speakup/main.c | 1 + drivers/staging/speakup/varhandlers.c | 1 + 3 files changed, 4 insertions(+) --- a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c @@ -154,6 +154,7 @@ static ssize_t chars_chartab_store(struc continue; } + /* Do not replace with kstrtoul: here we need temp to be updated */ index = simple_strtoul(cp, &temp, 10); if (index > 255) { rejected++; @@ -787,6 +788,7 @@ static ssize_t message_store_helper(cons continue; } + /* Do not replace with kstrtoul: here we need temp to be updated */ index = simple_strtoul(cp, &temp, 10); while ((temp < linefeed) && (*temp == ' ' || *temp == '\t')) --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -1979,6 +1979,7 @@ oops: return 1; } + /* Do not replace with kstrtoul: here we need cp to be updated */ goto_pos = simple_strtoul(goto_buf, &cp, 10); if (*cp == 'x') { --- a/drivers/staging/speakup/varhandlers.c +++ b/drivers/staging/speakup/varhandlers.c @@ -328,6 +328,7 @@ char *spk_s2uchar(char *start, char *des { int val; + /* Do not replace with kstrtoul: here we need start to be updated */ val = simple_strtoul(skip_spaces(start), &start, 10); if (*start == ',') start++;