Skip to contentSkip to conversation

soc: mediatek: pwrap: fix compiler errors

PATCH In review Matthias Brugger 2 participants 4 messages Oct 21, 2017 – Oct 22, 2017 Arm MediaTek

lore
Share & tools
lore

Matthias Brugger

author maintainer
#0 lore raw

PATCH 1/2 soc: mediatek: pwrap: fix compiler errors

When compiling using sparse, we got the following error:
drivers/soc/mediatek/mtk-pmic-wrap.c:686:25: error: dubious one-bit signed bitfield

Changing the data type to unsigned fixes this.

---
 drivers/soc/mediatek/mtk-pmic-wrap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/mediatek/mtk-pmic-wrap.c +1 -1
index 5d61d127e1d7..912edf93c192 100644
@@ -683,7 +683,7 @@ struct pmic_wrapper_type {
 	u32 int_en_all;
 	u32 spi_w;
 	u32 wdt_src;
-	int has_bridge:1;
+	unsigned int has_bridge:1;
 	int (*init_reg_clock)(struct pmic_wrapper *wrp);
 	int (*init_soc_specific)(struct pmic_wrapper *wrp);
 };
Signature · 1 line
2.14.2
author maintainer
#1 lore raw

PATCH 2/2 soc: mediatek: pwrap: fix fatal compiler error

When adding the MT6380 compatible, the sentinel for of_device_id was
deleted, which leades to the following compiler error:
FATAL: drivers/soc/mediatek/mtk-pmic-wrap: struct of_device_id is not terminated with a NULL entry!

Fix this by adding the sentinel again.

---
 drivers/soc/mediatek/mtk-pmic-wrap.c | 1 +
 1 file changed, 1 insertion(+)
drivers/soc/mediatek/mtk-pmic-wrap.c +1 -0
index 912edf93c192..e9e054a15b7d 100644
@@ -1380,6 +1380,7 @@ static const struct of_device_id of_slave_match_tbl[] = {
 	}, {
 		.compatible = "mediatek,mt6397",
 		.data = &pmic_mt6397,
+	}, {
 		/* sentinel */
 	}
 };
Signature · 1 line
2.14.2
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] soc: mediatek: pwrap: fix fatal compiler error

Quoted 16 lines · Matthias Brugger

When adding the MT6380 compatible, the sentinel for of_device_id was
deleted, which leades to the following compiler error:
FATAL: drivers/soc/mediatek/mtk-pmic-wrap: struct of_device_id is not terminated with a NULL entry!

Fix this by adding the sentinel again.

---
 drivers/soc/mediatek/mtk-pmic-wrap.c | 1 +
 1 file changed, 1 insertion(+)
drivers/soc/mediatek/mtk-pmic-wrap.c +0 -0
index 912edf93c192..e9e054a15b7d 100644

drivers/soc/mediatek/mtk-pmic-wrap.c static const struct of_device_id of_slave_match_tbl[] = { · line 1386

Quoted 7 lines
drivers/soc/mediatek/mtk-pmic-wrap.c +1 -0
@@ -1380,6 +1380,7 @@ static const struct of_device_id of_slave_match_tbl[] = {
 	}, {
 		.compatible = "mediatek,mt6397",
 		.data = &pmic_mt6397,
+	}, {
 		/* sentinel */
 	}
 };

Thanks for patching the mistaken edit I made.

author maintainer
#3 lore raw

Re: [PATCH 2/2] soc: mediatek: pwrap: fix fatal compiler error

Quoted 27 lines · Sean Wang
Quoted 16 lines · Matthias Brugger

When adding the MT6380 compatible, the sentinel for of_device_id was
deleted, which leades to the following compiler error:
FATAL: drivers/soc/mediatek/mtk-pmic-wrap: struct of_device_id is not terminated with a NULL entry!

Fix this by adding the sentinel again.

---
  drivers/soc/mediatek/mtk-pmic-wrap.c | 1 +
  1 file changed, 1 insertion(+)
drivers/soc/mediatek/mtk-pmic-wrap.c +0 -0
index 912edf93c192..e9e054a15b7d 100644

drivers/soc/mediatek/mtk-pmic-wrap.c static const struct of_device_id of_slave_match_tbl[] = { · line 1386

Quoted 7 lines
drivers/soc/mediatek/mtk-pmic-wrap.c +1 -0
@@ -1380,6 +1380,7 @@ static const struct of_device_id of_slave_match_tbl[] = {
  	}, {
  		.compatible = "mediatek,mt6397",
  		.data = &pmic_mt6397,
+	}, {
  		/* sentinel */
  	}
  };

Thanks for patching the mistaken edit I made.

Quoted 3 lines

Thanks, both patches pushed to v4.14-next/soc