soc: mediatek: pwrap: fix compiler errors
Matthias Brugger
maintainerPATCH 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
@@ -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
Matthias Brugger
maintainerPATCH 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
@@ -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
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_idwas
deleted, which leades to the following compiler error:
FATAL:drivers/soc/mediatek/mtk-pmic-wrap: structof_device_idis not terminated with a NULL entry!Fix this by adding the sentinel again.
Signed-off-by Matthias Brugger <[email protected]>--- drivers/soc/mediatek/mtk-pmic-wrap.c | 1 + 1 file changed, 1 insertion(+)drivers/soc/mediatek/mtk-pmic-wrap.c +0
-0
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.
Matthias Brugger
maintainerRe: [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_idwas
deleted, which leades to the following compiler error:
FATAL:drivers/soc/mediatek/mtk-pmic-wrap: structof_device_idis not terminated with a NULL entry!Fix this by adding the sentinel again.
Signed-off-by Matthias Brugger <[email protected]>--- drivers/soc/mediatek/mtk-pmic-wrap.c | 1 + 1 file changed, 1 insertion(+)drivers/soc/mediatek/mtk-pmic-wrap.c +0
-0drivers/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
Acked-by Sean Wang <[email protected]>
Thanks, both patches pushed to v4.14-next/soc