Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3477328pxj; Mon, 24 May 2021 07:37:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtvrJvW7iRUQoC0WFT3iqN1VVVfra8zfBuQ4rA6Cod1LbVKPK17pGGemAgzjzNBSBQWOH/ X-Received: by 2002:a17:906:680d:: with SMTP id k13mr23889300ejr.371.1621867067730; Mon, 24 May 2021 07:37:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621867067; cv=none; d=google.com; s=arc-20160816; b=vnqlTr1ClAhf8sLSJJGGa0X+3g6g+emx7pp4Q1xwd8NTa/VPqVv0GtnggN0fBNZwVJ ZfixQgTPGv8xF7u+Y7I1XgNokJFLuO/k1rsPmC9L9QXRkMuMH1tb963sHKx42va5xB8j C6xp0uYKAWgUwYO52V0YnbvslxvSpu/Y9K08ti+ZQV53dB5J/Qx2tJc/9TyGSppWHqVU DBdViECm4Idaq2xbhnZtn9eVZM4M4KCSIdjp+13vcjXIk8VHhYPzCjM6/oudtVWWmmtH ACB849+EWafl2ticaBvaVBDuCL/jvEU5Z1Gte0QQONxcLG1DNzlhwcl/dnGiJE9N6bfG OGBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=DIQFsFAcuT6ezcc/lSj+Ubd3KgT48ueLGhHc3ywPu98=; b=z4e1T7ulObFycNGmZeO3YeZgqXhysO+mJlygux2VIobvjARyxLPSnxx/RkP3tU9YnQ 4tiup7In4kAEzKtFPYE3fksFpAW20j+1WvWQKn8VypoRAHxodvrJlkHlZqP4A6PKbNmw S0RTMtYeatQcWCEt66Rsr88nXopxoOCamptG115wfmI1h6dYGEtgzeJ9fgeG0waOGZGQ 9LxQdXoqXMGt7lhq4t6hniUCy3wlIh6FugcDa+KZmV0JvdizOWvoF0IIw/BhiPrzlC5X cjjBSJLX8xK80VOXv53cA+dLxDX80pUgUgxQb+Yf4rA7wQ0FWulv6VetfxPfBPuEzd+E 6I1g== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t8si882379edi.510.2021.05.24.07.37.24; Mon, 24 May 2021 07:37:47 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232972AbhEXOfb (ORCPT + 99 others); Mon, 24 May 2021 10:35:31 -0400 Received: from mail-oi1-f174.google.com ([209.85.167.174]:36404 "EHLO mail-oi1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232662AbhEXOfa (ORCPT ); Mon, 24 May 2021 10:35:30 -0400 Received: by mail-oi1-f174.google.com with SMTP id t24so11720728oiw.3; Mon, 24 May 2021 07:34:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DIQFsFAcuT6ezcc/lSj+Ubd3KgT48ueLGhHc3ywPu98=; b=LLomuOFbkgpfhQ9zKze2u0D3Hti6/9ZMdLLCI+U2O4Ny3Z4WWk3IlhqDznPQKiJn1k 6pgVYsP7q27AdtdGjFl0B2vFJLnB/zPiTclYdmFHOdCFkoLkIUC69REZqyXvetGgW/aP jQh2eJDWRkjfVPGG2lrshU8gpLOfCa0eujidyZaWsbVWr+7RJS9GpCysRni6oo8mR/JK Ru3E6neryFBhVS8L+Rty/hPfN/kZOdsv/4ZlPhQwSXbB1UveqVL9+xs4naIIfGrAhU+6 YXF/1WG1YBoUlBc5bi+iCwPlnP8lFQMSxAbhL3IeuE7ukO4eWB5udaXqlcE3a8qBTMFj yJDg== X-Gm-Message-State: AOAM533S0dXxU1C09h8FVBLA7UdBSkW7X7pkKqQeeUrdzmmUwjLx/GCT bPUrLhKwnvm781I/DTP2q0T8y3Y23GWk9Jr7dYE= X-Received: by 2002:aca:380a:: with SMTP id f10mr11399113oia.157.1621866842300; Mon, 24 May 2021 07:34:02 -0700 (PDT) MIME-Version: 1.0 References: <20210524120832.1580247-1-liushixin2@huawei.com> In-Reply-To: <20210524120832.1580247-1-liushixin2@huawei.com> From: "Rafael J. Wysocki" Date: Mon, 24 May 2021 16:33:46 +0200 Message-ID: Subject: Re: [PATCH -next] ACPI: LPSS: Replaced simple_strtol() with kstrtol() To: Liu Shixin Cc: "Rafael J. Wysocki" , Len Brown , ACPI Devel Maling List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 24, 2021 at 1:35 PM Liu Shixin wrote: > > 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)); > + } This is not a simple replacement. Why are you making the other changes? > > lpss_deassert_reset(pdata); > > --