Skip to contentSkip to conversation

media: qcom: iris: initialize OPP pointer at declaration

PATCH In review Hungyu Lin 3 participants 3 messages Jun 8 – Jul 28

Subsystems (4)
lore
Share & tools
lore

Hungyu Lin

author
#0 lore raw

PATCH v2 1/1 media: qcom: iris: initialize OPP pointer at declaration

Initialize the managed OPP pointer at declaration rather than assigning it in a separate statement.

This avoids a checkpatch warning about a potentially uninitialized managed pointer.

---
Changes in v2:
- Initialize the managed pointer directly at declaration as suggested by Dmitry Baryshkov.

 drivers/media/platform/qcom/iris/iris_resources.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/qcom/iris/iris_resources.c +2 -2
index 773f6548370a..fd643cbff8d2 100644
@@ -61,9 +61,9 @@ int iris_unset_icc_bw(struct iris_core *core)
 
 int iris_opp_set_rate(struct device *dev, unsigned long freq)
 {
-	struct dev_pm_opp *opp __free(put_opp);
+	struct dev_pm_opp *opp __free(put_opp) =
+		devfreq_recommended_opp(dev, &freq, 0);
 
-	opp = devfreq_recommended_opp(dev, &freq, 0);
 	if (IS_ERR(opp))
 		return PTR_ERR(opp);
 
Signature · 1 line
2.34.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 32 lines · Hungyu Lin

Initialize the managed OPP pointer at declaration rather than assigning it in a separate statement.

This avoids a checkpatch warning about a potentially uninitialized managed pointer.

---
Changes in v2:
- Initialize the managed pointer directly at declaration as suggested by Dmitry Baryshkov.

  drivers/media/platform/qcom/iris/iris_resources.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/qcom/iris/iris_resources.c +2 -3
index 773f6548370a..fd643cbff8d2 100644
@@ -61,9 +61,9 @@ int iris_unset_icc_bw(struct iris_core *core)
 
  int iris_opp_set_rate(struct device *dev, unsigned long freq)
  {
-	struct dev_pm_opp *opp __free(put_opp);
+	struct dev_pm_opp *opp __free(put_opp) =
+		devfreq_recommended_opp(dev, &freq, 0);
 
-	opp = devfreq_recommended_opp(dev, &freq, 0);
  	if (IS_ERR(opp))
  		return PTR_ERR(opp);
 
--
Quoted 2 lines

2.34.1

Reviewed-by on v2 1/1
#2 lore raw
In reply to Hungyu Lin
Quoted 6 lines · Hungyu Lin

Initialize the managed OPP pointer at declaration rather than assigning it in a separate statement.

This avoids a checkpatch warning about a potentially uninitialized managed pointer.

Quoted 9 lines

---
Changes in v2:
- Initialize the managed pointer directly at declaration as suggested by Dmitry Baryshkov.

 drivers/media/platform/qcom/iris/iris_resources.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 1 line
Signature · 2 lines
With best wishes
Dmitry