linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: amlogic-a4: Optimize global variables
@ 2025-07-17  9:19 Xianwei Zhao via B4 Relay
  2025-07-17 15:42 ` Markus Elfring
  0 siblings, 1 reply; 3+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-07-17  9:19 UTC (permalink / raw)
  To: Yiting Deng, Alexandre Belloni
  Cc: linux-amlogic, linux-rtc, linux-kernel, Xianwei Zhao

From: Xianwei Zhao <xianwei.zhao@amlogic.com>

Use local variables struct regmap_config instread of global
variables. The goal of saving memory has been achieve.

Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
Use local variables struct regmap_config instread of global
variables. 
---
 drivers/rtc/rtc-amlogic-a4.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/rtc/rtc-amlogic-a4.c b/drivers/rtc/rtc-amlogic-a4.c
index 09d78c2cc691..1928b29c1045 100644
--- a/drivers/rtc/rtc-amlogic-a4.c
+++ b/drivers/rtc/rtc-amlogic-a4.c
@@ -72,13 +72,6 @@ struct aml_rtc_data {
 	const struct aml_rtc_config *config;
 };
 
-static const struct regmap_config aml_rtc_regmap_config = {
-	.reg_bits = 32,
-	.val_bits = 32,
-	.reg_stride = 4,
-	.max_register = RTC_REAL_TIME,
-};
-
 static inline u32 gray_to_binary(u32 gray)
 {
 	u32 bcd = gray;
@@ -328,6 +321,13 @@ static int aml_rtc_probe(struct platform_device *pdev)
 	void __iomem *base;
 	int ret = 0;
 
+	const struct regmap_config aml_rtc_regmap_config = {
+		.reg_bits = 32,
+		.val_bits = 32,
+		.reg_stride = 4,
+		.max_register = RTC_REAL_TIME,
+	};
+
 	rtc = devm_kzalloc(dev, sizeof(*rtc), GFP_KERNEL);
 	if (!rtc)
 		return -ENOMEM;

---
base-commit: 0bafe291cb429d39b5ff70bcf7b2f3ab026dcb02
change-id: 20250717-rtc-regmap-140ee38b7bf7

Best regards,
-- 
Xianwei Zhao <xianwei.zhao@amlogic.com>



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] rtc: amlogic-a4: Optimize global variables
  2025-07-17  9:19 [PATCH] rtc: amlogic-a4: Optimize global variables Xianwei Zhao via B4 Relay
@ 2025-07-17 15:42 ` Markus Elfring
  2025-07-21  2:27   ` Xianwei Zhao
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2025-07-17 15:42 UTC (permalink / raw)
  To: Xianwei Zhao, linux-amlogic, linux-rtc
  Cc: LKML, Alexandre Belloni, Yiting Deng

> Use local variables struct regmap_config instread of global

            variable?                      instead?


> variables. The goal of saving memory has been achieve.

                                                achieved?

You may occasionally put more than 59 characters into text lines
of such a change description.


…
> ---
> Use local variables struct regmap_config instread of global
> variables. 
> ---
>  drivers/rtc/rtc-amlogic-a4.c | 14 +++++++-------
…

Please avoid duplicate information here.


Can a summary phrase like “Convert a global variable into a local one
of aml_rtc_probe()” be more appropriate?

Regards,
Markus

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] rtc: amlogic-a4: Optimize global variables
  2025-07-17 15:42 ` Markus Elfring
@ 2025-07-21  2:27   ` Xianwei Zhao
  0 siblings, 0 replies; 3+ messages in thread
From: Xianwei Zhao @ 2025-07-21  2:27 UTC (permalink / raw)
  To: Markus Elfring, linux-amlogic, linux-rtc
  Cc: LKML, Alexandre Belloni, Yiting Deng

Hi Markus,
    Thanks for your advice.

On 2025/7/17 23:42, Markus Elfring wrote:
> [Some people who received this message don't often get email from markus.elfring@web.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> [ EXTERNAL EMAIL ]
> 
>> Use local variables struct regmap_config instread of global
> 
>              variable?                      instead?
> 
> 
>> variables. The goal of saving memory has been achieve.
> 
>                                                  achieved?
> 
> You may occasionally put more than 59 characters into text lines
> of such a change description.
> 
> 
> …
>> ---
>> Use local variables struct regmap_config instread of global
>> variables.
>> ---
>>   drivers/rtc/rtc-amlogic-a4.c | 14 +++++++-------
> …
> 
> Please avoid duplicate information here.
> 
> 
> Can a summary phrase like “Convert a global variable into a local one
> of aml_rtc_probe()” be more appropriate?
> 

Will do.

> Regards,
> Markus

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-21  2:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-17  9:19 [PATCH] rtc: amlogic-a4: Optimize global variables Xianwei Zhao via B4 Relay
2025-07-17 15:42 ` Markus Elfring
2025-07-21  2:27   ` Xianwei Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).