Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3085057ybb; Mon, 30 Mar 2020 20:31:37 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs0yPVcdQKzdm6mDZhc5+2PRDE9UyybLLAs2PL/xd0MAmkGbd7GhiiY6wajq/o43hgirvQv X-Received: by 2002:aca:d503:: with SMTP id m3mr744884oig.165.1585625496992; Mon, 30 Mar 2020 20:31:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585625496; cv=none; d=google.com; s=arc-20160816; b=T8TyzM+BP4APW799Fcs6QEiF0289+ZGaI+93tfwYYPvfVZlaegp0FBgSiv50LTrLmZ wHtSktJHm4ZnWXppeUlwpeOYdmqpFB+NTBiTIfBtdYVU9P5AMrvR5qmDgzfKNbHLdWDV lIJLGLjRS/JHJ7u3H1pU2Pejo0Mut5wwmDacpsU9iFffznqh5A7a/pK6eVNDXMfSAtQR ClaVJ5x+O10q99+I0+OcPYZDlDEcptY71FvXal36iayzcbuXvRLK5uIs2Rs74/7DIZR4 7R4aGtjvfamVzdm226lGeDar7jfhrvQtCnRcUuZ6PAmQRQJByJSeLHno+QUALQ4SczCX BdEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=89lAJByeK2o52dKTmtkUbMjkyjaqbqdAjB2LCENGJaQ=; b=BnxkNq7EYSfRsNhTvXSu/aVASFc8pw3jNfgBjt1lF2r0H2m7gqnuVvXNN0EKpc6kpO oZMZ1Q1mtaq3JKguKwf10e4Br5/FgvQaUrmGh0CWR4iPQzitehP+WEEZEh02xf/kTmw9 gK9WVcxcMM0YVS+xC43ULKd7uNYUzBAinVUMiZ3481itIO1VHAar5oxYJDYBkE7Q8ZOu mFVTszwWeSaHDZR+pOGXOawfMBWuofp0BsmWFf9ZOquc3FNq44GUOVyfn7EiYDow//fV G1t41l6Um0DNPQG/HEzinPgzT3LskUxbHSdtOt5JcCNZq/Zdc0NhVQ3phW7PmOzo6rL0 ZVoQ== 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 e4si6981115oib.135.2020.03.30.20.31.24; Mon, 30 Mar 2020 20:31:36 -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 S1729745AbgCaD3R (ORCPT + 99 others); Mon, 30 Mar 2020 23:29:17 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12657 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727358AbgCaD3R (ORCPT ); Mon, 30 Mar 2020 23:29:17 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 78841DC6D5413620629F; Tue, 31 Mar 2020 11:29:14 +0800 (CST) Received: from [127.0.0.1] (10.173.223.234) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Tue, 31 Mar 2020 11:29:09 +0800 Subject: Re: [PATCH -next] ACPICA: Make acpi_protocol_lengths static To: "Kaneda, Erik" , "Rafael J. Wysocki" , "Moore, Robert" References: <20200328034706.17840-1-yuehaibing@huawei.com> CC: "Wysocki, Rafael J" , Len Brown , ACPI Devel Maling List , "open list:ACPI COMPONENT ARCHITECTURE (ACPICA)" , "Linux Kernel Mailing List" From: Yuehaibing Message-ID: <81c23927-e3eb-dd97-6b9d-5e91d19a61b8@huawei.com> Date: Tue, 31 Mar 2020 11:29:08 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.173.223.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/3/31 1:52, Kaneda, Erik wrote: > > >> -----Original Message----- >> From: linux-acpi-owner@vger.kernel.org > owner@vger.kernel.org> On Behalf Of Rafael J. Wysocki >> Sent: Saturday, March 28, 2020 2:14 AM >> To: YueHaibing ; Moore, Robert >> ; Kaneda, Erik >> Cc: Wysocki, Rafael J ; Len Brown >> ; ACPI Devel Maling List ; >> open list:ACPI COMPONENT ARCHITECTURE (ACPICA) ; >> Linux Kernel Mailing List >> Subject: Re: [PATCH -next] ACPICA: Make acpi_protocol_lengths static >> >> On Sat, Mar 28, 2020 at 4:47 AM YueHaibing >> wrote: >>> >>> Fix sparse warning: >>> >>> drivers/acpi/acpica/exfield.c:25:10: warning: >>> symbol 'acpi_protocol_lengths' was not declared. Should it be static? > > I don’t understand what sparse is trying to say here. This variable is declared in exfield.c... > Could you provide more details on this sparse warning? This is sparse -Wdel option's job, see man manual: -Wdecl Warn about any non-static variable or function definition that has no previous declaration. Private symbols (functions and variables) internal to a given source file should use static, to allow additional compiler optimizations, allow detection of unused symbols, and prevent other code from relying on these internal symbols. Public symbols used by other source files will need declarations visible to those other source files, such as in a header file. All declarations should fall into one of these two categories. Thus, with -Wdecl, Sparse warns about any symbol definition with neither static nor a declaration. To fix this warning, declare private symbols static, and ensure that the files defining public symbols have the symbol declarations available first (such as by including the appropriate header file). > > Erik > >>> >>> Signed-off-by: YueHaibing >> >> Bob, Erik, I'm leaving this one to you. >> >>> --- >>> drivers/acpi/acpica/exfield.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/acpi/acpica/exfield.c >>> b/drivers/acpi/acpica/exfield.c index e85eb31e5075..3323a2ba6a31 >>> 100644 >>> --- a/drivers/acpi/acpica/exfield.c >>> +++ b/drivers/acpi/acpica/exfield.c >>> @@ -22,7 +22,7 @@ ACPI_MODULE_NAME("exfield") >>> */ >>> #define ACPI_INVALID_PROTOCOL_ID 0x80 >>> #define ACPI_MAX_PROTOCOL_ID 0x0F >>> -const u8 acpi_protocol_lengths[] = { >>> +static const u8 acpi_protocol_lengths[] = { >>> ACPI_INVALID_PROTOCOL_ID, /* 0 - reserved */ >>> ACPI_INVALID_PROTOCOL_ID, /* 1 - reserved */ >>> 0x00, /* 2 - ATTRIB_QUICK */ >>> -- >>> 2.17.1 >>> >>>