Skip to contentSkip to conversation

coresight: platform: use dev_warn instead of dev_warn_once

PATCH In review Kathiravan T 3 participants 4 messages May 8, 2020 – May 13, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 coresight: platform: use dev_warn instead of dev_warn_once

When more than one coresight components uses the obsolete DT bindings, warning is displayed for only one component and not for the others. Lets warn it for all components by replacing dev_warn_once with dev_warn.

---
 drivers/hwtracing/coresight/coresight-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-platform.c +1 -1
index 43418a2..b7d9a02 100644
@@ -284,7 +284,7 @@ static int of_get_coresight_platform_data(struct device *dev,
 	if (!parent) {
 		legacy_binding = true;
 		parent = node;
-		dev_warn_once(dev, "Uses obsolete Coresight DT bindings\n");
+		dev_warn(dev, "Uses obsolete Coresight DT bindings\n");
 	}
 
 	conn = pdata->conns;
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
#1 lore raw

Hi Kathiravan,

Quoted 14 lines · Kathiravan T

When more than one coresight components uses the obsolete DT bindings, warning is displayed for only one component and not for the others. Lets warn it for all components by replacing dev_warn_once with dev_warn.

---
 drivers/hwtracing/coresight/coresight-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-platform.c +0 -0
index 43418a2..b7d9a02 100644

drivers/hwtracing/coresight/coresight-platform.c static int of_get_coresight_platform_data(struct device *dev, · line 287

Quoted 5 lines
drivers/hwtracing/coresight/coresight-platform.c +1 -1
@@ -284,7 +284,7 @@ static int of_get_coresight_platform_data(struct device *dev,
 	if (!parent) {
 		legacy_binding = true;
 		parent = node;
-		dev_warn_once(dev, "Uses obsolete Coresight DT bindings\n");
+		dev_warn(dev, "Uses obsolete Coresight DT bindings\n");

We made a concious decision to use dev_warn_once() rather than dev_warn(). There can be a lot of coresight devices on a platform and warning for every device doesn't do anything more than adding noise.

If one device is using obsolete bindings the others very likely to do so as well. While fixing one device, checking the remaining devices should be intuitive.

Thanks,
Mathieu

Quoted 6 lines
drivers/hwtracing/coresight/coresight-platform.c +0 -0
 	}
 
 	conn = pdata->conns;
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
maintainer
#2 lore raw
Quoted 27 lines · Mathieu Poirier

Hi Kathiravan,

Quoted 14 lines · Kathiravan T

When more than one coresight components uses the obsolete DT bindings, warning is displayed for only one component and not for the others. Lets warn it for all components by replacing dev_warn_once with dev_warn.

---
  drivers/hwtracing/coresight/coresight-platform.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-platform.c +0 -0
index 43418a2..b7d9a02 100644

drivers/hwtracing/coresight/coresight-platform.c static int of_get_coresight_platform_data(struct device *dev, · line 287

Quoted 5 lines
drivers/hwtracing/coresight/coresight-platform.c +1 -1
@@ -284,7 +284,7 @@ static int of_get_coresight_platform_data(struct device *dev,
  	if (!parent) {
  		legacy_binding = true;
  		parent = node;
-		dev_warn_once(dev, "Uses obsolete Coresight DT bindings\n");
+		dev_warn(dev, "Uses obsolete Coresight DT bindings\n");

We made a concious decision to use dev_warn_once() rather than dev_warn(). There can be a lot of coresight devices on a platform and warning for every device doesn't do anything more than adding noise.

Quoted 3 lines

If one device is using obsolete bindings the others very likely to do so as well. While fixing one device, checking the remaining devices should be intuitive.

Exactly ! Or someone could repeat the process until all are fixed ;-)

Cheers
Suzuki

#3 lore raw
Quoted 29 lines · Suzuki K Poulose
Quoted 28 lines · Mathieu Poirier

Hi Kathiravan,

Quoted 14 lines · Kathiravan T

When more than one coresight components uses the obsolete DT bindings, warning is displayed for only one component and not for the others. Lets warn it for all components by replacing dev_warn_once with dev_warn.

---
  drivers/hwtracing/coresight/coresight-platform.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-platform.c +0 -0
index 43418a2..b7d9a02 100644

drivers/hwtracing/coresight/coresight-platform.c static int of_get_coresight_platform_data(struct · line 288

Quoted 6 lines
drivers/hwtracing/coresight/coresight-platform.c +1 -1
@@ -284,7 +284,7 @@ static int of_get_coresight_platform_data(struct 
 device *dev,
       if (!parent) {
           legacy_binding = true;
           parent = node;
-        dev_warn_once(dev, "Uses obsolete Coresight DT bindings\n");
+        dev_warn(dev, "Uses obsolete Coresight DT bindings\n");

We made a concious decision to use dev_warn_once() rather than dev_warn(). There can be a lot of coresight devices on a platform and warning for every device doesn't do anything more than adding noise.

Quoted 8 lines
Quoted 3 lines

If one device is using obsolete bindings the others very likely to do so as well.  While fixing one device, checking the remaining devices should be intuitive.

Exactly ! Or someone could repeat the process until all are fixed ;-)

Cheers
Suzuki

Thanks Mathieu and Suzuki for the inputs. I shall drop this patch.

Thanks,

Kathiravan T.