Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3340210pxj; Mon, 24 May 2021 04:36:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzu2S6fM1pdrSIKtsKKnCQ5Ns6SodQ/z3eAdPzo+LW94DcSiTwMipXGajeHHC7IzeTTzC7B X-Received: by 2002:a50:ff0a:: with SMTP id a10mr25330517edu.273.1621856218470; Mon, 24 May 2021 04:36:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621856218; cv=none; d=google.com; s=arc-20160816; b=yeQmJtwAA08qiemjvVpgnYGFqU4DmzKLJu5zzbITiFL/BhyealYebeDwmxVwO/vv0R cEndE70DB9Eu3ce5AzZm5cQXT+W9gukbP2dgxsCNRctR4Ib2zDiqvQRvf43IkECWojJb jnbVOmyiyy8GThO019mOf9HBofTViSJBVlBG73W/9hAjNndOJG7z8f26VZ0/I9x5JGUD ITAedRcPl88cbTGxmp2495NNtVZ05NDInFma8JlN3cldUYSzFoIm9yrg/L2I/X0W2oje E4wUbQFrYfpZ9oo1MIM59R7+jhFSyJqJYVuKfM79vYLpTmj1IlblwXjqR7t6SlPrWRHy NuKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=tVoZ6Z4XpZ5UqaMgwxbVhepDdB4fyed1BDDCHWABh1I=; b=t+zQapfM4yXOuT5R2Y/p7lMa8NVhqYOmonCxFbkXmAE5uEAam23eO/dteaXOWbbKi5 DtN3xi0W3dIibVjJ2K1Fl+Ucl8w6tR7zXq5eXWtH1bbZczZP4G/aMfluk3fuTbiCaxpV Tcc5B/Qrn6O4mDkaHT0dy2N0PAykr5xGkWI8bSvOkcmyh6Ji7Wrz6J/GbTfFTNwUx/Hp 2iVrhQKH55BNV29iKTbdrTCzFahMP4yYGwdwMkh6EMd8QdLbiQuxMz6iCP/rNa4hUJmB VA3WM9m7ih49BdAbsPCQYEDZJE80bFYbt12uvncJdA5dK+shGrNZ+dg+fl20GO1LPd0s fxEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x9si15398423eje.36.2021.05.24.04.36.35; Mon, 24 May 2021 04:36:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232603AbhEXLhJ (ORCPT + 99 others); Mon, 24 May 2021 07:37:09 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5678 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232050AbhEXLhJ (ORCPT ); Mon, 24 May 2021 07:37:09 -0400 Received: from dggems701-chm.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FpZns30Nsz1BMhv; Mon, 24 May 2021 19:32:49 +0800 (CST) Received: from dggpemm500009.china.huawei.com (7.185.36.225) by dggems701-chm.china.huawei.com (10.3.19.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 24 May 2021 19:35:39 +0800 Received: from huawei.com (10.175.113.32) by dggpemm500009.china.huawei.com (7.185.36.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 24 May 2021 19:35:39 +0800 From: Liu Shixin To: "Rafael J. Wysocki" , Len Brown CC: , , Liu Shixin Subject: [PATCH -next] ACPI: LPSS: Replaced simple_strtol() with kstrtol() Date: Mon, 24 May 2021 20:08:32 +0800 Message-ID: <20210524120832.1580247-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500009.china.huawei.com (7.185.36.225) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The simple_strtol() function is deprecated in some situation since it does not check for the range overflow. Use kstrtol() instead. Signed-off-by: Liu Shixin --- drivers/acpi/acpi_lpss.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index ca742f16a507..1b46e00cad3a 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c @@ -186,13 +186,12 @@ static void byt_i2c_setup(struct lpss_private_data *pdata) long uid = 0; /* Expected to always be true, but better safe then sorry */ - if (uid_str) - uid = simple_strtol(uid_str, NULL, 10); - - /* Detect I2C bus shared with PUNIT and ignore its d3 status */ - status = acpi_evaluate_integer(handle, "_SEM", NULL, &shared_host); - if (ACPI_SUCCESS(status) && shared_host && uid) - pmc_atom_d3_mask &= ~(BIT_LPSS2_F1_I2C1 << (uid - 1)); + if (uid_str && !kstrtol(uid_str, 10, &uid)) { + /* Detect I2C bus shared with PUNIT and ignore its d3 status */ + status = acpi_evaluate_integer(handle, "_SEM", NULL, &shared_host); + if (ACPI_SUCCESS(status) && shared_host && uid) + pmc_atom_d3_mask &= ~(BIT_LPSS2_F1_I2C1 << (uid - 1)); + } lpss_deassert_reset(pdata); -- 2.18.0.huawei.25