Skip to contentSkip to conversation

rtc: pcf85063: hide an unused variable

PATCH In review Arnd Bergmann 2 participants 2 messages Jul 25, 2025 – Aug 15, 2025 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: pcf85063: hide an unused variable

From: Arnd Bergmann <[email protected]>

The newly introduced configuration is only used by code that is inside of an #ifdef block, cauing a warning when that block is disabled by the configuration is still there:

drivers/rtc/rtc-pcf85063.c:566:37: error: 'config_rv8063' defined but not used [-Werror=unused-const-variable=]

Add the same #ifdef here.

Fixes a3c7f7e16ea8 ("rtc: pcf85063: add support for RV8063")
---
 drivers/rtc/rtc-pcf85063.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/rtc/rtc-pcf85063.c +2 -0
index d9b67b959d18..41e4a5a16574 100644
@@ -563,6 +563,7 @@ static const struct pcf85063_config config_rv8263 = {
 	.force_cap_7000 = 1,
 };
 
+#if IS_ENABLED(CONFIG_SPI_MASTER)
 static const struct pcf85063_config config_rv8063 = {
 	.regmap = {
 		.reg_bits = 8,
@@ -574,6 +575,7 @@ static const struct pcf85063_config config_rv8063 = {
 	.has_alarms = 1,
 	.force_cap_7000 = 1,
 };
+#endif
 
 static int pcf85063_probe(struct device *dev, struct regmap *regmap, int irq,
 			  const struct pcf85063_config *config)
Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The newly introduced configuration is only used by code that is inside of an #ifdef block, cauing a warning when that block is disabled by the configuration is still there:

Quoted 6 lines

drivers/rtc/rtc-pcf85063.c:566:37: error: 'config_rv8063' defined but not used [-Werror=unused-const-variable=]

Add the same #ifdef here.

Fixes a3c7f7e16ea8 ("rtc: pcf85063: add support for RV8063")
Quoted 24 lines

---
 drivers/rtc/rtc-pcf85063.c | 2 ++

 1 file changed, 2 insertions(+)
drivers/rtc/rtc-pcf85063.c +0 -0
index d9b67b959d18..41e4a5a16574 100644
@@ -563,6 +563,7 @@ static const struct pcf85063_config config_rv8263 = {
  	.force_cap_7000 = 1,
  };


+#if IS_ENABLED(CONFIG_SPI_MASTER)
 static const struct pcf85063_config config_rv8063 = { .regmap = {
  .reg_bits = 8,

drivers/rtc/rtc-pcf85063.c +1 -0
@@ -574,6 +575,7 @@ static const struct pcf85063_config config_rv8063 = {
  	.has_alarms = 1,
  	.force_cap_7000 = 1,
  };
+#endif


 static int pcf85063_probe(struct device *dev, struct regmap *regmap, int irq, const struct pcf85063_config *config)

Signature · 1 line
Alexander Sverdlin.