From patchwork Sat Dec 10 13:47:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9469345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A003960231 for ; Sat, 10 Dec 2016 13:49:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 928C12856A for ; Sat, 10 Dec 2016 13:49:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 861B7285A1; Sat, 10 Dec 2016 13:49:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 324D82856A for ; Sat, 10 Dec 2016 13:49:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753389AbcLJNsN (ORCPT ); Sat, 10 Dec 2016 08:48:13 -0500 Received: from mail.kernel.org ([198.145.29.136]:50294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753382AbcLJNsM (ORCPT ); Sat, 10 Dec 2016 08:48:12 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1FB00203AB; Sat, 10 Dec 2016 13:48:11 +0000 (UTC) Received: from localhost.localdomain (bzq-109-65-153-252.red.bezeqint.net [109.65.153.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 784CD2038D; Sat, 10 Dec 2016 13:48:07 +0000 (UTC) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Kukjin Kim , Krzysztof Kozlowski , Javier Martinez Canillas , Simtec Linux Team , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC 4/7] ARM: s3c64xx: Annotate external clock frequencies __ro_after_init Date: Sat, 10 Dec 2016 15:47:35 +0200 Message-Id: <1481377658-22603-4-git-send-email-krzk@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481377658-22603-1-git-send-email-krzk@kernel.org> References: <1481377658-22603-1-git-send-email-krzk@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The xtal_f and xusbxti_f static variables are modified only through __init accessors (like s3c64xx_set_xtal_freq()). Later these variables are used only in read-only way so we can mark them __ro_after_init to increase code safeness. Signed-off-by: Krzysztof Kozlowski --- Looks safe, but not tested. --- arch/arm/mach-s3c64xx/common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c index 7c66ce1a6bb6..9843eb4dd04e 100644 --- a/arch/arm/mach-s3c64xx/common.c +++ b/arch/arm/mach-s3c64xx/common.c @@ -56,7 +56,8 @@ #include "watchdog-reset.h" /* External clock frequency */ -static unsigned long xtal_f = 12000000, xusbxti_f = 48000000; +static unsigned long xtal_f __ro_after_init = 12000000; +static unsigned long xusbxti_f __ro_after_init = 48000000; void __init s3c64xx_set_xtal_freq(unsigned long freq) {