[PATCH] rtc: s3c: Put 'const' just after 'static' keyword for data

Krzysztof Kozlowski posted 1 patch 3 months ago
drivers/rtc/rtc-s3c.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
[PATCH] rtc: s3c: Put 'const' just after 'static' keyword for data
Posted by Krzysztof Kozlowski 3 months ago
Convention is to define static data as 'static const ...', not 'static
... const' because of readability, even if the code is functionally
equal.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Cc: dev.tailor@samsung.com
---
 drivers/rtc/rtc-s3c.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 5dd575865adf..79b2a16f15ad 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -549,25 +549,25 @@ static void s3c6410_rtc_irq(struct s3c_rtc *info, int mask)
 	writeb(mask, info->base + S3C2410_INTP);
 }
 
-static struct s3c_rtc_data const s3c2410_rtc_data = {
+static const struct s3c_rtc_data s3c2410_rtc_data = {
 	.irq_handler		= s3c24xx_rtc_irq,
 	.enable			= s3c24xx_rtc_enable,
 	.disable		= s3c24xx_rtc_disable,
 };
 
-static struct s3c_rtc_data const s3c2416_rtc_data = {
+static const struct s3c_rtc_data s3c2416_rtc_data = {
 	.irq_handler		= s3c24xx_rtc_irq,
 	.enable			= s3c24xx_rtc_enable,
 	.disable		= s3c24xx_rtc_disable,
 };
 
-static struct s3c_rtc_data const s3c2443_rtc_data = {
+static const struct s3c_rtc_data s3c2443_rtc_data = {
 	.irq_handler		= s3c24xx_rtc_irq,
 	.enable			= s3c24xx_rtc_enable,
 	.disable		= s3c24xx_rtc_disable,
 };
 
-static struct s3c_rtc_data const s3c6410_rtc_data = {
+static const struct s3c_rtc_data s3c6410_rtc_data = {
 	.needs_src_clk		= true,
 	.irq_handler		= s3c6410_rtc_irq,
 	.enable			= s3c24xx_rtc_enable,
-- 
2.43.0
Re: [PATCH] rtc: s3c: Put 'const' just after 'static' keyword for data
Posted by Alexandre Belloni 2 months, 2 weeks ago
On Mon, 07 Jul 2025 11:22:01 +0200, Krzysztof Kozlowski wrote:
> Convention is to define static data as 'static const ...', not 'static
> ... const' because of readability, even if the code is functionally
> equal.
> 
> 

Applied, thanks!

[1/1] rtc: s3c: Put 'const' just after 'static' keyword for data
      https://git.kernel.org/abelloni/c/8b52144f0e08

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com