Skip to contentSkip to conversation

controlcenterd_36BIT_SDCARD: Fix unused variable warning

PATCH New Tom Rini 3 participants 8 messages Jun 16, 2017 – Jun 24, 2017

Subsystems (2)
lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/3 controlcenterd_36BIT_SDCARD: Fix unused variable warning

On the controlcenterd_36BIT_SDCARD config we get a warning about prg_stage1_prepare being unused. Move the declaration closer to usage and hide under the existing #if tests.

---
 board/gdsys/p1022/controlcenterd-id.c | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)
board/gdsys/p1022/controlcenterd-id.c +13 -14
index db8a91756373..95f11fb69f36 100644
@@ -142,20 +142,6 @@ static int hre_err = HRE_E_OK;
 #define IS_VAR_HREG(spec) (((spec) & 0x38) == 0x10)
 #define HREG_IDX(spec) ((spec) & (IS_PCR_HREG(spec) ? 0x1f : 0x7))
 
-
-static const uint8_t prg_stage1_prepare[] = {
-	0x00, 0x20, 0x00, 0x00, /* opcode: SYNC f0 */
-	0x00, 0x24, 0x00, 0x00, /* opcode: SYNC f1 */
-	0x01, 0x80, 0x00, 0x00, /* opcode: CHECK0 PCR0 */
-	0x81, 0x22, 0x00, 0x00, /* opcode: LOAD PCR0, f0 */
-	0x01, 0x84, 0x00, 0x00, /* opcode: CHECK0 PCR1 */
-	0x81, 0x26, 0x10, 0x00, /* opcode: LOAD PCR1, f1 */
-	0x01, 0x88, 0x00, 0x00, /* opcode: CHECK0 PCR2 */
-	0x81, 0x2a, 0x20, 0x00, /* opcode: LOAD PCR2, f2 */
-	0x01, 0x8c, 0x00, 0x00, /* opcode: CHECK0 PCR3 */
-	0x81, 0x2e, 0x30, 0x00, /* opcode: LOAD PCR3, f3 */
-};
-
 static const uint8_t vendor[] = "Guntermann & Drunck";
 
 /**
@@ -931,6 +917,19 @@ end:
 #endif
 
 #if defined(CCDM_FIRST_STAGE) || (defined CCDM_AUTO_FIRST_STAGE)
+static const uint8_t prg_stage1_prepare[] = {
+	0x00, 0x20, 0x00, 0x00, /* opcode: SYNC f0 */
+	0x00, 0x24, 0x00, 0x00, /* opcode: SYNC f1 */
+	0x01, 0x80, 0x00, 0x00, /* opcode: CHECK0 PCR0 */
+	0x81, 0x22, 0x00, 0x00, /* opcode: LOAD PCR0, f0 */
+	0x01, 0x84, 0x00, 0x00, /* opcode: CHECK0 PCR1 */
+	0x81, 0x26, 0x10, 0x00, /* opcode: LOAD PCR1, f1 */
+	0x01, 0x88, 0x00, 0x00, /* opcode: CHECK0 PCR2 */
+	0x81, 0x2a, 0x20, 0x00, /* opcode: LOAD PCR2, f2 */
+	0x01, 0x8c, 0x00, 0x00, /* opcode: CHECK0 PCR3 */
+	0x81, 0x2e, 0x30, 0x00, /* opcode: LOAD PCR3, f3 */
+};
+
 static int first_stage_actions(void)
 {
 	int result = 0;
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/3 controlcenterd_36BIT_SDCARD: Fix unused variable warning

Quoted 6 lines · Tom Rini

On the controlcenterd_36BIT_SDCARD config we get a warning about prg_stage1_prepare being unused. Move the declaration closer to usage and hide under the existing #if tests.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170624/237a0ad2/attachment.sig>
author
#2 lore raw

PATCH 2/3 post: Fix unused variable warning on lwmon5

In reply to Tom Rini

The variable syndrome_codes is only used when DEBUG is define, add #if guards around it in the same style as the rest of the file.

Cc Stefan Roese <[email protected]>
---
 post/cpu/ppc4xx/denali_ecc.c | 2 ++
 1 file changed, 2 insertions(+)
post/cpu/ppc4xx/denali_ecc.c +2 -0
index 1190739ae1a9..ad5e64fbb008 100644
@@ -33,6 +33,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if defined(DEBUG)
 const static uint8_t syndrome_codes[] = {
 	0xF4, 0XF1, 0XEC, 0XEA, 0XE9, 0XE6, 0XE5, 0XE3,
 	0XDC, 0XDA, 0XD9, 0XD6, 0XD5, 0XD3, 0XCE, 0XCB,
@@ -44,6 +45,7 @@ const static uint8_t syndrome_codes[] = {
 	0X1C, 0X1A, 0X19, 0X16, 0X15, 0X13, 0X0E, 0X0B,
 	0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01
 };
+#endif
 
 #define ECC_START_ADDR		0x10
 #define ECC_STOP_ADDR		0x2000
Signature · 1 line
1.9.1
author
#4 lore raw

PATCH 2/3 post: Fix unused variable warning on lwmon5

In reply to Tom Rini
Quoted 6 lines · Tom Rini

The variable syndrome_codes is only used when DEBUG is define, add #if guards around it in the same style as the rest of the file.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170624/8c5f8946/attachment.sig>
author
#5 lore raw

PATCH 3/3 clk_rv1108.c: Fix unused variable warning

In reply to Tom Rini

The variables gpll_init_cfg and apll_init_cfg are unused in this file, remove them.

Cc Simon Glass <[email protected]>
Cc Philipp Tomsich <[email protected]>
---
 drivers/clk/rockchip/clk_rv1108.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/clk/rockchip/clk_rv1108.c +0 -3
index 0a3ba3bff9f7..818293dfe87a 100644
@@ -40,9 +40,6 @@ enum {
 			 "divisors on line " __stringify(__LINE__));
 
 /* use interge mode*/
-static const struct pll_div apll_init_cfg = PLL_DIVISORS(APLL_HZ, 1, 3, 1);
-static const struct pll_div gpll_init_cfg = PLL_DIVISORS(GPLL_HZ, 2, 2, 1);
-
 static inline int rv1108_pll_id(enum rk_clk_id clk_id)
 {
 	int id = 0;
Signature · 1 line
1.9.1
author
#7 lore raw

PATCH 3/3 clk_rv1108.c: Fix unused variable warning

In reply to Tom Rini
Quoted 7 lines · Tom Rini

The variables gpll_init_cfg and apll_init_cfg are unused in this file, remove them.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170624/c2969c85/attachment.sig>