Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1539835
| From | Krzysztof Kozlowski <krzk@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [RFC 4/7] ARM: s3c64xx: Annotate external clock frequencies __ro_after_init |
| Date | 2016-12-10 14:50 +0100 |
| Message-ID | <sMQch-2V7-11@gated-at.bofh.it> (permalink) |
| References | <sMQch-2V7-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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 <krzk@kernel.org>
---
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)
{
--
2.7.4
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[RFC 4/7] ARM: s3c64xx: Annotate external clock frequencies __ro_after_init Krzysztof Kozlowski <krzk@kernel.org> - 2016-12-10 14:50 +0100
csiph-web