Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp252576pxf; Wed, 24 Mar 2021 04:26:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjO4FWKCkTb0c3P8ZWFmglZfpP1UkQuGxoW4m/CKEzqjgbctO+BuYt1J9l0HNCMQQf+Ku9 X-Received: by 2002:a17:906:81c9:: with SMTP id e9mr3076060ejx.456.1616585214814; Wed, 24 Mar 2021 04:26:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616585214; cv=none; d=google.com; s=arc-20160816; b=CsePuPCMmVY3QbRl2bt5z7peZj7cTNS8zqlV4aaFnhTH5yyt7p+JWWgCIGv5GckaXa 1rZ66nsASS1k5u1zzvIPswMRY++NLVDugQc1xXjMZ+HZMeUckYA/GjVVb0jd778wBgfj i9f5mJF9oWKlnUPGzCav7ZPny2z5ffQYeCKRcL0d36GGQ6dw7OSI2PRLXOhuWVb5hRpK et2EIM+oExQyMcjVIV+C+HiAhvEQRfQqr+3kn25cPeWRfVXwprEU0INiYMFK17mvFqo2 HAEu/aMgjvm1P73xZejRJWSYINJwDc0pgWzVF27b82ISYVsNVJIsfI98HCY0q4BIwNVr OIMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=CcoSzHjOf4w7jV9wuZRnQDVIY2bLQoooJa6qXKhBMn4=; b=DLaKbqlVBGwiiZyuZJCy/pIRDWL1I3clSf9PfAmcYz/BrDyWTJZKUL66D6kv9s/Olz i79vDjVvwGnCW6K9RZrjGo5gRp3iZiUGYd1njbG5IvUpVEivIfnntHdZCNfEH2AiPj+O nZbFMCS1XMEzO9m3fF2uvFnSc4/EHEJ9tFkyz/4TVYrwkfceF0eNbUIc+xeS4SBxQeBC I3jZLU5vCMhhH4Y8lMqgdsiv8QfNgianb4LpCtn+/errqZgt4vfvaIblFTcfP99rPxPe 8IGQU+PErZYkq0NT2lr8oNx5vBQOXCbWPL6ryrssyInQmgf1ID1JJfEpbyU5rnSmMRFA erkA== 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 gb27si1628501ejc.448.2021.03.24.04.26.31; Wed, 24 Mar 2021 04:26:54 -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 S229888AbhCXJqb (ORCPT + 99 others); Wed, 24 Mar 2021 05:46:31 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:14521 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232442AbhCXJqX (ORCPT ); Wed, 24 Mar 2021 05:46:23 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4F53GF40qRzPll5; Wed, 24 Mar 2021 17:43:49 +0800 (CST) Received: from [10.67.110.136] (10.67.110.136) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.498.0; Wed, 24 Mar 2021 17:46:19 +0800 Subject: Re: [PATCH V3 -next] powerpc: kernel/time.c - cleanup warnings To: Alexandre Belloni CC: , , , , , , , , , , , , , , , References: <20210324090939.143477-1-heying24@huawei.com> From: "heying (H)" Message-ID: <18a8d444-f1a5-61e0-b9f2-f85c03d71686@huawei.com> Date: Wed, 24 Mar 2021 17:46:19 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.110.136] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Alexandre, ?? 2021/3/24 17:29, Alexandre Belloni ะด??: > On 24/03/2021 05:09:39-0400, He Ying wrote: >> We found these warnings in arch/powerpc/kernel/time.c as follows: >> warning: symbol 'decrementer_max' was not declared. Should it be static? >> warning: symbol 'rtc_lock' was not declared. Should it be static? >> warning: symbol 'dtl_consumer' was not declared. Should it be static? >> >> Declare 'decrementer_max' in powerpc asm/time.h. >> Include linux/mc146818rtc.h in powerpc kernel/time.c where 'rtc_lock' >> is declared. And remove duplicated declaration of 'rtc_lock' in powerpc >> platforms/chrp/time.c because it has included linux/mc146818rtc.h. >> Move 'dtl_consumer' definition behind "include " because it >> is declared there. >> >> Reported-by: Hulk Robot >> Signed-off-by: He Ying >> --- >> V2: >> - Instead of including linux/mc146818rtc.h in powerpc kernel/time.c, declare >> rtc_lock in powerpc asm/time.h. >> V3: >> - Recover to V1, that is including linux/mc146818rtc.h in powerpc >> kernel/time.c. And remove duplicated declaration of 'rtc_lock' in powerpc >> platforms/chrp/time.c because it has included linux/mc146818rtc.h. >> >> arch/powerpc/include/asm/time.h | 1 + >> arch/powerpc/kernel/time.c | 9 ++++----- >> arch/powerpc/platforms/chrp/time.c | 2 -- >> 3 files changed, 5 insertions(+), 7 deletions(-) >> >> diff --git a/arch/powerpc/include/asm/time.h b/arch/powerpc/include/asm/time.h >> index 8dd3cdb25338..2cd2b50bedda 100644 >> --- a/arch/powerpc/include/asm/time.h >> +++ b/arch/powerpc/include/asm/time.h >> @@ -22,6 +22,7 @@ extern unsigned long tb_ticks_per_jiffy; >> extern unsigned long tb_ticks_per_usec; >> extern unsigned long tb_ticks_per_sec; >> extern struct clock_event_device decrementer_clockevent; >> +extern u64 decrementer_max; >> >> >> extern void generic_calibrate_decr(void); >> diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c >> index b67d93a609a2..ac81f043bf49 100644 >> --- a/arch/powerpc/kernel/time.c >> +++ b/arch/powerpc/kernel/time.c >> @@ -55,8 +55,9 @@ >> #include >> #include >> #include >> -#include >> +#include > I'm fine with that but I really think my suggestion to make the rtc_lock > local to the platforms was better because it is only used to synchronize > between concurrent invocations of chrp_set_rtc_time or > maple_set_rtc_time. The rtc core will never do that and the only case > would be concurrent calls to rtc_ops.set_time and > update_persistent_clock64 (which should also be removed at some point). Many thanks for your suggestion. As you suggest, rtc_lock should be local to platforms. Does it mean not only powerpc but also all other platforms should adapt this change? It might be a big change. I have no idea if that's OK. What are other maintainers' opinions? Thanks.