Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp858569pxf; Wed, 24 Mar 2021 18:46:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTkdwskTyzM3NfDlUsfV+DPlN+nIKDPTGAOpkNPmGo1q0dKlm98ycyTs6Qv4ygBtmvEC3D X-Received: by 2002:a17:906:2cd1:: with SMTP id r17mr6719001ejr.429.1616636803860; Wed, 24 Mar 2021 18:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616636803; cv=none; d=google.com; s=arc-20160816; b=R7NKZt2Sv/w4Pj5oENyMkKXpsqEBlyTKM25ui2AGnZKKKQRF4ahpiKe6dtTCmkb4ei DEB0Ogfz57E54WdShNH+xyKiaT/n6UVzkvQP18VDhrw7U+Lj8/oObX9uZeXsPSnsQ/rh kUsWJ/Zfi0QcHMv3uAPOWe3DVx1J6N21VLQSA/jiX1PTjiYmTDLYAVM48i7RpoQ+L+JU 1d61zq1piN7IpSO5X9jq9wCdqbYLhM6WNphblgiu56BT2or8MnXb2F06mG6YkwpaTTLP MaC558xENpVnDg90rXE3/NVk1g4GvI9uYJWeqPJEW9DLQ6nlXdzDzxoFQXmtwO9O0Uhu zOQQ== 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=b99vyQcaCpQD3pMXQougjwNkTLQcQ7H7qW0vVRZg68k=; b=Xdn8Goml6/dNSYYs4Goz4652r6rmta+fInzzxk7y5cztvKn/ZQMr5NaZH38ROGJIzB IJrPUwV7sxfp3bVPVQ95VFleLB3JJORmVIsJ6ltu44gxeaotXJWh7P3E3hQ3WdMAfHx+ pDhKcMdq2A7sc7uOGPgA4vSCMSDSMyje6/cqOgdcr0zBZk57CrR+ReHBXoFx+9JEwRCH oUhCWMwNYU7VmZ/V3cnmXCY7YRQxgEisWdzXadPaRNTN87Tg7G84oaXpYAfOO4NbtpTw QMXlrK8k6hxGgZhuLjI9rrbHZkyKphB03TFnSnPZyqxKMJnCl2QrzcFH3MljUpVaNUt+ XJqg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m1si2823118edc.349.2021.03.24.18.46.20; Wed, 24 Mar 2021 18:46:43 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236259AbhCXIV3 (ORCPT + 99 others); Wed, 24 Mar 2021 04:21:29 -0400 Received: from mail-vs1-f41.google.com ([209.85.217.41]:45821 "EHLO mail-vs1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236052AbhCXIUK (ORCPT ); Wed, 24 Mar 2021 04:20:10 -0400 Received: by mail-vs1-f41.google.com with SMTP id 124so10890133vsg.12; Wed, 24 Mar 2021 01:20:10 -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=b99vyQcaCpQD3pMXQougjwNkTLQcQ7H7qW0vVRZg68k=; b=aJEHB6tfRRbMSsc6eWDmNQPjwEa5QQBZxqYg2zBEhniG7TJ+Fc5gDViUwai+DBLUTz paTBJF+FNaa3YnWk+KPYlaHejZUiWnVlS7V3P0WpjSD7G1cwsusD9LFzZD0/OiqsO3/E TXrTRHLeI558ifwSwjBFRXRXReg/Abs/ftqgtjE5lEz5ciH9LJV+BW654d6qhh7wLc3q PTBIziRnd1mUSfHLi/piVP3QjVeq+7mEX94YqXUDnwrlXMi3ycHj51wflKqUgbOjQJ/K GB+QnhiYlZ1wi8tURcgJ+slFVFuQaYti7U6QrTkqPGSqzXVKPB8ka5SbXNrK8VdT9O8A xBSw== X-Gm-Message-State: AOAM532wW9DZLgSRIOt4yqSl6D+fAFU2zkmxue3KqqQk//3frn134ExA +tKAREL/Plmkvb0CbumcaAbTInyjKo3QpDXpxmc= X-Received: by 2002:a67:8883:: with SMTP id k125mr950544vsd.18.1616574009774; Wed, 24 Mar 2021 01:20:09 -0700 (PDT) MIME-Version: 1.0 References: <20210323091257.90054-1-heying24@huawei.com> In-Reply-To: From: Geert Uytterhoeven Date: Wed, 24 Mar 2021 09:19:58 +0100 Message-ID: Subject: Re: [PATCH v2 -next] powerpc: kernel/time.c - cleanup warnings To: Alexandre Belloni Cc: He Ying , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Alessandro Zummo , Christophe Leroy , Nicholas Piggin , Michal Suchanek , Thomas Gleixner , Peter Zijlstra , Geert Uytterhoeven , kernelfans@gmail.com, frederic@kernel.org, linuxppc-dev , Linux Kernel Mailing List , linux-rtc@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexandre, On Tue, Mar 23, 2021 at 11:18 PM Alexandre Belloni wrote: > On 23/03/2021 05:12:57-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' and 'rtc_lock' in powerpc asm/time.h. > > Rename 'rtc_lock' in drviers/rtc/rtc-vr41xx.c to 'vr41xx_rtc_lock' to > > avoid the conflict with the variable in powerpc asm/time.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. > > > > V1 was actually the correct thing to do. rtc_lock is there exactly > because chrp and maple are using mc146818 compatible RTCs. This is then > useful because then drivers/char/nvram.c is enabled. The proper fix > would be to scrap all of that and use rtc-cmos for those platforms as > this drives the RTC properly and exposes the NVRAM for the mc146818. > > Or at least, if there are no users for the char/nvram driver on those > two platforms, remove the spinlock and stop enabling CONFIG_NVRAM or > more likely rename the symbol as it seems to be abused by both chrp and > powermac. IIRC, on CHRP LongTrail, NVRAM was inherited from CHRP's Mac ancestry, not from CHRP's PC ancestry, and thus NVRAM is not the one in the mc146818-compatible RTC. http://users.telenet.be/geertu/Linux/PPC/DeviceTree.html confirms that, showing that nvram is a different device node than rtc. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds