Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp432656imm; Thu, 30 Aug 2018 02:32:50 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZDxAtkfAynsXNXyHR2PblzfOpnCUeZkYy4L/HjWCK1mB1qc+4l4a8E9y2yaszS49ifhThB X-Received: by 2002:a17:902:9a06:: with SMTP id v6-v6mr9484605plp.316.1535621570267; Thu, 30 Aug 2018 02:32:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535621570; cv=none; d=google.com; s=arc-20160816; b=BiBHct/QgR5MYDKN79eDNsvho1sibEbEFMBz7TGUKMjIIRyT/cpFtgQkYuEXJq73RW JmyDkb1Ybh4cNR5yb8+tNKACqpsKmvBw+3HtARzRdJmt/SGa5joHUXaQHYbmjefQocjU YuYmnUYOt/qmODQCrZUeuX4tZuau0s8tDo6J6rVU4b0clPCK2+X6gsetSGTaFazUvjX8 bkNrvalRu6tWsOjJ5vOtPxKb5myNwrtEM42MIuhuezcrvPT2i+uaXCA0nu7r/qP0iXkG gK4SJcUMIZz11Femmds2TMotmMZg2ba10ZLalQK7CDSbgyEkKMjqhz0coC61ZEIfLdw6 1K9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from :arc-authentication-results; bh=vf7OQCJXymLIFWaVCninIEpotQwoA/t+9QTIeSze5Ms=; b=OZuc/DuDeVk/tWsYp0ebRQuywZ1ZYxdfSdA839l+6WfFK0tRscFhnC+3rkQtR310HZ bgmi4lZ75+HJJUnR58We1ihO/w9ecFHOtDdJKWD5afxHGBDftK1Bc5NRKqEowxiSsho9 ywQ6+c3t8OH4vvGIx2tYSMOA8ypYxQKPVV48EVipJDD8UGQKcaHmuNtc5IzdUBXNl68Y HHlm+rTspA0qMSKEPxHdZ9rqCif8kSPgrfNYhygVdSGJ+ujZI3TXrRTCMibrF+wdo6fd 9pHMAp0Qj6RE6JvYbRMEGWqY3/DfPMxqJZAXJTUQ/YjfphaxeUBXVrv/Quky9Tf6PzS6 Wygw== 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 i8-v6si6070517pgj.33.2018.08.30.02.32.35; Thu, 30 Aug 2018 02:32:50 -0700 (PDT) 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 S1728116AbeH3Nco (ORCPT + 99 others); Thu, 30 Aug 2018 09:32:44 -0400 Received: from cmccmta2.chinamobile.com ([221.176.66.80]:41997 "EHLO cmccmta2.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727089AbeH3Nco (ORCPT ); Thu, 30 Aug 2018 09:32:44 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.17]) by rmmx-syy-dmz-app08-12008 (RichMail) with SMTP id 2ee85b87b96ed0e-628dd; Thu, 30 Aug 2018 17:31:26 +0800 (CST) X-RM-TRANSID: 2ee85b87b96ed0e-628dd X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.105.0.243]) by rmsmtp-syy-appsvr09-12009 (RichMail) with SMTP id 2ee95b87b96d08c-15c2f; Thu, 30 Aug 2018 17:31:26 +0800 (CST) X-RM-TRANSID: 2ee95b87b96d08c-15c2f From: Ding Xiang To: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: misc: fix obsolete function Date: Thu, 30 Aug 2018 17:31:18 +0800 Message-Id: <1535621478-15208-1-git-send-email-dingxiang@cmss.chinamobile.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org simple_strtoul is obsolete, and use kstrtoint instead Signed-off-by: Ding Xiang --- drivers/usb/misc/trancevibrator.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/misc/trancevibrator.c b/drivers/usb/misc/trancevibrator.c index b3e1f55..ac357ce 100644 --- a/drivers/usb/misc/trancevibrator.c +++ b/drivers/usb/misc/trancevibrator.c @@ -46,7 +46,9 @@ static ssize_t speed_store(struct device *dev, struct device_attribute *attr, struct trancevibrator *tv = usb_get_intfdata(intf); int temp, retval, old; - temp = simple_strtoul(buf, NULL, 10); + retval = kstrtoint(buf, 10, &temp); + if (retval) + return retval; if (temp > 255) temp = 255; else if (temp < 0) -- 1.9.1