phy: mediatek: fix returning garbage
Subsystems (4)
PATCH 1/1 phy: mediatek: fix returning garbage
clang reports drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:298:6: error: variable
'ret' is uninitialized when used here [-Werror,-Wuninitialized]
if (ret)
^~~ret should have been set by the preceding call to mtk_hdmi_pll_set_hw.
--- drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c +3 -3
@@ -292,9 +292,9 @@ static int mtk_hdmi_pll_calc(struct mtk_hdmi_phy *hdmi_phy, struct clk_hw *hw,if (!(digital_div <=32 && digital_div >=1 ))return -EINVAL ; -mtk_hdmi_pll_set_hw (hw,PLL_PREDIV , fbkdiv_high, fbkdiv_low, -PLL_FBKDIV_HS3 , posdiv1, posdiv2, txprediv, - txposdiv, digital_div); + ret =mtk_hdmi_pll_set_hw (hw,PLL_PREDIV , fbkdiv_high, fbkdiv_low, +PLL_FBKDIV_HS3 , posdiv1, posdiv2, txprediv, + txposdiv, digital_div);if (ret)return -EINVAL ;
Signature · 1 line
2.27.0
Quoted 9 lines · Tom Rix
clang reports
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:298:6: error: variable
'ret' is uninitialized when used here [-Werror,-Wuninitialized]if (ret) ^~~ret should have been set by the preceding call to
mtk_hdmi_pll_set_hw.Fixes 45810d486bb4 ("phy: mediatek: add support for phy-mtk-hdmi-mt8195")Signed-off-by Tom Rix <[email protected]>
Quoted 21 lines
--- drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c +3
-3@@ -292,9 +292,9 @@ static int mtk_hdmi_pll_calc(struct mtk_hdmi_phy *hdmi_phy, struct clk_hw *hw,if (!(digital_div <=32 && digital_div >=1 ))return -EINVAL ; -mtk_hdmi_pll_set_hw (hw,PLL_PREDIV , fbkdiv_high, fbkdiv_low, -PLL_FBKDIV_HS3 , posdiv1, posdiv2, txprediv, - txposdiv, digital_div); + ret =mtk_hdmi_pll_set_hw (hw,PLL_PREDIV , fbkdiv_high, fbkdiv_low, +PLL_FBKDIV_HS3 , posdiv1, posdiv2, txprediv, + txposdiv, digital_div);if (ret)return -EINVAL ;
Matthias Brugger
maintainerQuoted 10 lines · Matthias Brugger
Quoted 7 lines · Tom Rix
clang reports
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:298:6: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized] if (ret)
^~~
ret should have been set by the preceding call tomtk_hdmi_pll_set_hw.
Quoted 5 lines
Quoted 2 lines
Fixes 45810d486bb4 ("phy: mediatek: add support for phy-mtk-hdmi-mt8195")Signed-off-by Tom Rix <[email protected]>Reviewed-by Matthias Brugger <[email protected]>
Please also add
see CA+G9fYu4o0-ZKSthi7kdCjz_kFazZS-rn17Z2NPz3=1Oayr9cw@mail.gmail.com
Regards,
Matthias
Quoted 20 lines
Quoted 20 lines
---
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c| 6 +++---1 file changed, 3 insertions(+), 3 deletions(-)drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c +3
-3@@ -292,9 +292,9 @@ static int mtk_hdmi_pll_calc(struct mtk_hdmi_phy *hdmi_phy, struct clk_hw *hw, if (!(digital_div <= 32 && digital_div >= 1)) return -EINVAL; - mtk_hdmi_pll_set_hw(hw, PLL_PREDIV, fbkdiv_high, fbkdiv_low, - PLL_FBKDIV_HS3, posdiv1, posdiv2, txprediv, - txposdiv, digital_div); + ret = mtk_hdmi_pll_set_hw(hw, PLL_PREDIV, fbkdiv_high, fbkdiv_low, + PLL_FBKDIV_HS3, posdiv1, posdiv2, txprediv, + txposdiv, digital_div); if (ret) return -EINVAL;
Quoted 9 lines · Tom Rix
clang reports
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:298:6: error: variable
'ret' is uninitialized when used here [-Werror,-Wuninitialized]if (ret) ^~~ret should have been set by the preceding call to
mtk_hdmi_pll_set_hw.Fixes 45810d486bb4 ("phy: mediatek: add support for phy-mtk-hdmi-mt8195")Signed-off-by Tom Rix <[email protected]>
Angelo brought up a good point on another patch to fix this issue that we should probably be returning ret instead of unconditionally returning -EINVAL but it sounds like it does not really matter at the moment since mtk_hdmi_pll_set_hw() can only return -EINVAL or 0.
https://lore.kernel.org/[email protected]/
Quoted 24 lines
--- drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c +3
-3@@ -292,9 +292,9 @@ static int mtk_hdmi_pll_calc(struct mtk_hdmi_phy *hdmi_phy, struct clk_hw *hw,if (!(digital_div <=32 && digital_div >=1 ))return -EINVAL ; -mtk_hdmi_pll_set_hw (hw,PLL_PREDIV , fbkdiv_high, fbkdiv_low, -PLL_FBKDIV_HS3 , posdiv1, posdiv2, txprediv, - txposdiv, digital_div); + ret =mtk_hdmi_pll_set_hw (hw,PLL_PREDIV , fbkdiv_high, fbkdiv_low, +PLL_FBKDIV_HS3 , posdiv1, posdiv2, txprediv, + txposdiv, digital_div);if (ret)return -EINVAL ;Signature · 1 line
2.27.0
Il 14/04/23 14:22, Tom Rix ha scritto:
Quoted 9 lines
clang reports
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:298:6: error: variable
'ret' is uninitialized when used here [-Werror,-Wuninitialized]if (ret) ^~~ret should have been set by the preceding call to
mtk_hdmi_pll_set_hw.Fixes 45810d486bb4 ("phy: mediatek: add support for phy-mtk-hdmi-mt8195")Signed-off-by Tom Rix <[email protected]>
Vinod Koul
maintainerQuoted 6 lines · Tom Rix
clang reports
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:298:6: error: variable
'ret' is uninitialized when used here [-Werror,-Wuninitialized]if (ret) ^~~ret should have been set by the preceding call to
mtk_hdmi_pll_set_hw.
I have applied "phy: mediatek: hdmi: mt8195: fix uninitialized variable usage in pll_calc"
Signature · 1 line
~Vinod
Matthias Brugger
maintainerQuoted 10 lines · Vinod Koul
Quoted 6 lines · Tom Rix
clang reports
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:298:6: error: variable
'ret' is uninitialized when used here [-Werror,-Wuninitialized]if (ret) ^~~ret should have been set by the preceding call to
mtk_hdmi_pll_set_hw.I have applied "phy: mediatek: hdmi: mt8195: fix uninitialized variable usage in
pll_calc"
Thanks Vinod, that was on my list for today as well. I was a bit puzzled because you took the patch that added it, but I wasn't sure if you would take the fix. How do you want to handle things like this in the future?
Regards,
Matthias
Vinod Koul
maintainerQuoted 11 lines · Matthias Brugger
Quoted 8 lines · Vinod Koul
Quoted 6 lines · Tom Rix
clang reports
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:298:6: error: variable
'ret' is uninitialized when used here [-Werror,-Wuninitialized]if (ret) ^~~ret should have been set by the preceding call to
mtk_hdmi_pll_set_hw.
Quoted 6 lines
Quoted 2 lines
I have applied "phy: mediatek: hdmi: mt8195: fix uninitialized variable usage in
pll_calc"Thanks Vinod, that was on my list for today as well. I was a bit puzzled because you took the patch that added it, but I wasn't sure if you would take the fix. How do you want to handle things like this in the future?
Fixes should be sent as Fixes patch
Signature · 1 line
~Vinod
Matthias Brugger
maintainerQuoted 12 lines · Vinod Koul
Quoted 11 lines · Matthias Brugger
Quoted 8 lines · Vinod Koul
Quoted 6 lines · Tom Rix
clang reports
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:298:6: error: variable
'ret' is uninitialized when used here [-Werror,-Wuninitialized]
if (ret)
^~~
ret should have been set by the preceding call tomtk_hdmi_pll_set_hw.
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
I have applied "phy: mediatek: hdmi: mt8195: fix uninitialized variable usage in
pll_calc"Thanks Vinod, that was on my list for today as well. I was a bit puzzled because you took the patch that added it, but I wasn't sure if you would take the fix. How do you want to handle things like this in the future?
Fixes should be sent as Fixes patch
I'm not sure what do you mean. Patch subject includes the word fix and the patch has a fixes tag. What was missing here?
Does this mean you will take fixes for this driver in the future or do you want me to take care of them?
Regards,
Matthias
Vinod Koul
maintainerQuoted 22 lines · Matthias Brugger
Quoted 19 lines · Vinod Koul
Quoted 17 lines · Matthias Brugger
Quoted 10 lines · Vinod Koul
Quoted 6 lines · Tom Rix
clang reports
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:298:6: error: variable
'ret' is uninitialized when used here [-Werror,-Wuninitialized]
if (ret)
^~~
ret should have been set by the preceding call tomtk_hdmi_pll_set_hw.I have applied "phy: mediatek: hdmi: mt8195: fix uninitialized variable usage in
pll_calc"Thanks Vinod, that was on my list for today as well. I was a bit puzzled because you took the patch that added it, but I wasn't sure if you would take the fix. How do you want to handle things like this in the future?
Quoted 8 lines
Quoted 2 lines
Fixes should be sent as Fixes patch
I'm not sure what do you mean. Patch subject includes the word fix and the patch has a fixes tag. What was missing here?
Does this mean you will take fixes for this driver in the future or do you want me to take care of them?
Yes I would take the fixes as well for the drivers
Signature · 1 line
~Vinod