Skip to contentSkip to conversation

coresight: cti: remove incorrect NULL return check

PATCH In review Calvin Johnson 3 participants 3 messages May 7, 2020 – May 15, 2020

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

PATCH 1/1 coresight: cti: remove incorrect NULL return check

fwnode_find_reference() doesn't return NULL and hence that check should be avoided.

---

 drivers/hwtracing/coresight/coresight-cti-platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hwtracing/coresight/coresight-cti-platform.c +2 -2
index b44d83142b62..2fdaeec80ee5 100644
@@ -120,7 +120,7 @@ static int cti_plat_create_v8_etm_connection(struct device *dev,
 
 	/* Can optionally have an etm node - return if not  */
 	cs_fwnode = fwnode_find_reference(root_fwnode, CTI_DT_CSDEV_ASSOC, 0);
-	if (IS_ERR_OR_NULL(cs_fwnode))
+	if (IS_ERR(cs_fwnode))
 		return 0;
 
 	/* allocate memory */
@@ -393,7 +393,7 @@ static int cti_plat_create_connection(struct device *dev,
 		/* associated device ? */
 		cs_fwnode = fwnode_find_reference(fwnode,
 						  CTI_DT_CSDEV_ASSOC, 0);
-		if (!IS_ERR_OR_NULL(cs_fwnode)) {
+		if (!IS_ERR(cs_fwnode)) {
 			assoc_name = cti_plat_get_csdev_or_node_name(cs_fwnode,
 								     &csdev);
 			fwnode_handle_put(cs_fwnode);
Signature · 1 line
2.17.1
#1 lore raw

Hi Greg,

Quoted 6 lines · Calvin Johnson

fwnode_find_reference() doesn't return NULL and hence that check should be avoided.

I just noticed you were not CC'ed on the original conversation Calvin and I had and as such you probably don't know what to do with this patch. Please see if you can pick it up as a fix for 5.7. If that is not possible I will queue it up for inclusion in the 5.8 cycle.

Thanks,
Mathieu

Quoted 30 lines

---

 drivers/hwtracing/coresight/coresight-cti-platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hwtracing/coresight/coresight-cti-platform.c +2 -3
index b44d83142b62..2fdaeec80ee5 100644
@@ -120,7 +120,7 @@ static int cti_plat_create_v8_etm_connection(struct device *dev,
 
        /* Can optionally have an etm node - return if not  */
        cs_fwnode = fwnode_find_reference(root_fwnode, CTI_DT_CSDEV_ASSOC, 0);
-       if (IS_ERR_OR_NULL(cs_fwnode))
+       if (IS_ERR(cs_fwnode))
                return 0;
 
        /* allocate memory */
@@ -393,7 +393,7 @@ static int cti_plat_create_connection(struct device *dev,
                /* associated device ? */
                cs_fwnode = fwnode_find_reference(fwnode,
                                                  CTI_DT_CSDEV_ASSOC, 0);
-               if (!IS_ERR_OR_NULL(cs_fwnode)) {
+               if (!IS_ERR(cs_fwnode)) {
                        assoc_name = cti_plat_get_csdev_or_node_name(cs_fwnode,
                                                                     &csdev);
                        fwnode_handle_put(cs_fwnode);
--

2.17.1

#2 lore raw
Quoted 7 lines · Mathieu Poirier

Hi Greg,

Quoted 4 lines · Calvin Johnson

fwnode_find_reference() doesn't return NULL and hence that check should be avoided.

Quoted 7 lines
Quoted 2 lines

I just noticed you were not CC'ed on the original conversation Calvin and I had and as such you probably don't know what to do with this patch. Please see if you can pick it up as a fix for 5.7. If that is not possible I will queue it up for inclusion in the 5.8 cycle.

I can take this for 5.7-final, thanks.

greg k-h