Skip to contentSkip to conversation

rockchip: ram: fix debug funcfion define when RAM_ROCKCHIP_DEBUG not set

PATCH New Kever Yang 2 participants 2 messages Jul 20, 2020

Subsystems (2)
lore
Share & tools
lore

Kever Yang

author
#0 lore raw

PATCH 1/1 rockchip: ram: fix debug funcfion define when RAM_ROCKCHIP_DEBUG not set

The empty function define should not be in the header file, or else the build will error with function multi definition after CONFIG_RAM_ROCKCHIP_DEBUG is disabled.

---

 arch/arm/include/asm/arch-rockchip/sdram_common.h | 15 ---------------
 drivers/ram/rockchip/sdram_common.c               | 13 +++++++++++++
 2 files changed, 13 insertions(+), 15 deletions(-)
arch/arm/include/asm/arch-rockchip/sdram_common.h +0 -15
index 36d31156be..5efa6e9445 100644
@@ -114,25 +114,10 @@ struct sdram_base_params {
 #define SYS_REG_ENC_CS1_COL(n, ch)	(((n) - 9) << (0 + 2 * (ch)))
 #define SYS_REG_DEC_CS1_COL(n, ch)	(9 + (((n) >> (0 + 2 * (ch))) & 0x3))
 
-#if !defined(CONFIG_RAM_ROCKCHIP_DEBUG)
-inline void sdram_print_dram_type(unsigned char dramtype)
-{
-}
-
-inline void sdram_print_ddr_info(struct sdram_cap_info *cap_info,
-				 struct sdram_base_params *base)
-{
-}
-
-inline void sdram_print_stride(unsigned int stride)
-{
-}
-#else
 void sdram_print_dram_type(unsigned char dramtype);
 void sdram_print_ddr_info(struct sdram_cap_info *cap_info,
 			  struct sdram_base_params *base);
 void sdram_print_stride(unsigned int stride);
-#endif /* CONFIG_RAM_ROCKCHIP_DEBUG */
 
 void sdram_org_config(struct sdram_cap_info *cap_info,
 		      struct sdram_base_params *base,
drivers/ram/rockchip/sdram_common.c +13 -0
index 6bc51572b2..b3e7421d08 100644
@@ -117,6 +117,19 @@ void sdram_print_stride(unsigned int stride)
 		printf("no stride\n");
 	}
 }
+#else
+inline void sdram_print_dram_type(unsigned char dramtype)
+{
+}
+
+inline void sdram_print_ddr_info(struct sdram_cap_info *cap_info,
+				 struct sdram_base_params *base)
+{
+}
+
+inline void sdram_print_stride(unsigned int stride)
+{
+}
 #endif
 
 /*
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 rockchip: ram: fix debug funcfion define when RAM_ROCKCHIP_DEBUG not set

Hi Kever,

Quoted 4 lines · Kever Yang

The empty function define should not be in the header file, or else the build will error with function multi definition after CONFIG_RAM_ROCKCHIP_DEBUG is disabled.

Any specific reason why? usually, it has in the header in most of the code in the tree.

Does it because of the v5.7-rc5 compiler sync patch.

[PATCH 07/10] compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Jagan.

--
Jagan Teki,
Amarula Solutions India Pvt. Ltd.
Co-Founder & Embedded Linux Architect
405/E-Block, Sri Lakshmi Shubham Arcade, Chandanagar, Hyderabad - 500050, India M. (+91) 910 009 0959
[`as] http://www.amarulasolutions.com