Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2611964imm; Fri, 24 Aug 2018 02:13:43 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdaddbg6RQKqQtZ2ViJU5yQ/GT3p469UI327PrlP9YxuxrE8CbhZvifaIfoP9g734RFeVn8M X-Received: by 2002:a62:7a01:: with SMTP id v1-v6mr989275pfc.153.1535102023691; Fri, 24 Aug 2018 02:13:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535102023; cv=none; d=google.com; s=arc-20160816; b=QHqRwTqhtYEzxeANvCsk4hoWNwV3a85W0qckjVfpabKUszDLtaEq/wauwmWDiK14jz eS+3b0VFcgU9B/ASZxWSxK3bJSo40BDC7v3Y3khcqJJDiu7uKh4qJE5zgEaCNEFjcAY0 rtW2QYqclO9ZCdISGWjs4Sxi5hVxS63SjwkqDpaMHwCBKZBQL5Y73PmZQo55O2g4xe4b 7feC8RW14V8CR+nsO2F8uShJxE+F3eb8eDYZVT9pOaUBJQVRj/i6FmtXAExiHkoTFnCl Rfo/Puoakd06boVSf6Im02aL8gich+VaA1V91kZVqMjUa/wSUVXOUYzr/ilxVwM+jIyb JC4A== 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=CkQgQqrWiXVXEGlVLROwelD4XpxP9GruVkFULYXwk54=; b=H2tH3++cSTli+Ya9rEv71ZY85Y7RbuEZ16GggMe0XY07RmrI46xaDfPfuZT/9HkDbv zkDRngw/IjNXpRf5LuWdy3QLGIKmE/eqlV6W/WQFN+V1KLVejvGifYLIuoqgB9ivuCft 7Zj+kH30o9inQkjR/xSRGuYUVOCvpykn1P0LSkTOE3NtZw+vpD49sgJQ7e/wAMKfAWsA u8QhIjrF/wiKpyH1ODulMg6NpGU5/h+XQrYMhaNxOiNEA4YIMf+9iRgaao6zBz1R6XNY YZXjNqFVs6MbxHz5iuhLLOPaf6asZKocOYbrRFDaPjO5vkh5V7VNeKEV7fqP09qftipu Bnkg== 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 29-v6si6405902pgv.292.2018.08.24.02.13.28; Fri, 24 Aug 2018 02:13:43 -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 S1727374AbeHXMp7 (ORCPT + 99 others); Fri, 24 Aug 2018 08:45:59 -0400 Received: from cmccmta2.chinamobile.com ([221.176.66.80]:38096 "EHLO cmccmta2.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726382AbeHXMp7 (ORCPT ); Fri, 24 Aug 2018 08:45:59 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.11]) by rmmx-syy-dmz-app08-12008 (RichMail) with SMTP id 2ee85b7fcbecf11-d9925; Fri, 24 Aug 2018 17:12:12 +0800 (CST) X-RM-TRANSID: 2ee85b7fcbecf11-d9925 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from bclinux72.localdomain (unknown[223.105.0.243]) by rmsmtp-syy-appsvr06-12006 (RichMail) with SMTP id 2ee65b7fcbeb777-45906; Fri, 24 Aug 2018 17:12:12 +0800 (CST) X-RM-TRANSID: 2ee65b7fcbeb777-45906 From: Ding Xiang To: marcel@holtmann.org, johan.hedberg@gmail.com, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Bluetooth: bt3c_cs: Fix obsolete function Date: Fri, 24 Aug 2018 06:23:32 -0400 Message-Id: <1535106212-21514-1-git-send-email-dingxiang@cmss.chinamobile.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org simple_strtol and simple_strtoul are obsolete, both place use kstrtoul instead. Signed-off-by: Ding Xiang --- drivers/bluetooth/bt3c_cs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c index 25b0cf9..5e4800d 100644 --- a/drivers/bluetooth/bt3c_cs.c +++ b/drivers/bluetooth/bt3c_cs.c @@ -449,7 +449,7 @@ static int bt3c_load_firmware(struct bt3c_info *info, char *ptr = (char *) firmware; char b[9]; unsigned int iobase, tmp; - unsigned long size, addr, fcs; + unsigned long size, addr, fcs, tn; int i, err = 0; iobase = info->p_dev->resource[0]->start; @@ -490,7 +490,9 @@ static int bt3c_load_firmware(struct bt3c_info *info, memset(b, 0, sizeof(b)); for (tmp = 0, i = 0; i < size; i++) { memcpy(b, ptr + (i * 2) + 2, 2); - tmp += simple_strtol(b, NULL, 16); + if (kstrtoul(b, 16, &tn)) + return -EINVAL; + tmp += tn; } if (((tmp + fcs) & 0xff) != 0xff) { @@ -505,7 +507,9 @@ static int bt3c_load_firmware(struct bt3c_info *info, memset(b, 0, sizeof(b)); for (i = 0; i < (size - 4) / 2; i++) { memcpy(b, ptr + (i * 4) + 12, 4); - tmp = simple_strtoul(b, NULL, 16); + if (kstrtoul(b, 16, &tn)) + return -EINVAL; + tmp += tn; bt3c_put(iobase, tmp); } } -- 1.8.3.1