linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] coresight: cti: remove incorrect NULL return check
@ 2020-05-07  5:35 Calvin Johnson
  2020-05-12 18:00 ` Mathieu Poirier
  0 siblings, 1 reply; 5+ messages in thread
From: Calvin Johnson @ 2020-05-07  5:35 UTC (permalink / raw)
  To: Mike Leach, Mathieu Poirier, Greg Kroah-Hartman, linux.cj
  Cc: Calvin Johnson, Alexander Shishkin, Suzuki K Poulose,
	linux-arm-kernel, linux-kernel

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

Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---

 drivers/hwtracing/coresight/coresight-cti-platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers/hwtracing/coresight/coresight-cti-platform.c
index b44d83142b62..2fdaeec80ee5 100644
--- a/drivers/hwtracing/coresight/coresight-cti-platform.c
+++ b/drivers/hwtracing/coresight/coresight-cti-platform.c
@@ -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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] coresight: cti: remove incorrect NULL return check
  2020-05-07  5:35 [PATCH] coresight: cti: remove incorrect NULL return check Calvin Johnson
@ 2020-05-12 18:00 ` Mathieu Poirier
  2020-05-15 14:22   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: Mathieu Poirier @ 2020-05-12 18:00 UTC (permalink / raw)
  To: Calvin Johnson, Greg Kroah-Hartman
  Cc: Mike Leach, linux.cj, Alexander Shishkin, Suzuki K Poulose,
	linux-arm-kernel, Linux Kernel Mailing List

Hi Greg,

On Wed, 6 May 2020 at 23:36, Calvin Johnson <calvin.johnson@oss.nxp.com> wrote:
>
> fwnode_find_reference() doesn't return NULL and hence that check
> should be avoided.
>
> Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com>
> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>

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

> ---
>
>  drivers/hwtracing/coresight/coresight-cti-platform.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers/hwtracing/coresight/coresight-cti-platform.c
> index b44d83142b62..2fdaeec80ee5 100644
> --- a/drivers/hwtracing/coresight/coresight-cti-platform.c
> +++ b/drivers/hwtracing/coresight/coresight-cti-platform.c
> @@ -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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] coresight: cti: remove incorrect NULL return check
  2020-05-12 18:00 ` Mathieu Poirier
@ 2020-05-15 14:22   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2020-05-15 14:22 UTC (permalink / raw)
  To: Mathieu Poirier
  Cc: Calvin Johnson, Mike Leach, linux.cj, Alexander Shishkin,
	Suzuki K Poulose, linux-arm-kernel, Linux Kernel Mailing List

On Tue, May 12, 2020 at 12:00:21PM -0600, Mathieu Poirier wrote:
> Hi Greg,
> 
> On Wed, 6 May 2020 at 23:36, Calvin Johnson <calvin.johnson@oss.nxp.com> wrote:
> >
> > fwnode_find_reference() doesn't return NULL and hence that check
> > should be avoided.
> >
> > Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com>
> > Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> 
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] coresight: cti: remove incorrect NULL return check
  2020-05-05 13:40 Calvin Johnson
@ 2020-05-06 17:05 ` Mathieu Poirier
  0 siblings, 0 replies; 5+ messages in thread
From: Mathieu Poirier @ 2020-05-06 17:05 UTC (permalink / raw)
  To: Calvin Johnson
  Cc: Mike Leach, linux.cj, Alexander Shishkin, Suzuki K Poulose,
	linux-arm-kernel, linux-kernel

On Tue, May 05, 2020 at 07:10:20PM +0530, Calvin Johnson wrote:
> fwnode_find_reference() doesn't return NULL and hence that check
> should be avoided.
> 
> Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com>
> ---
> 
>  drivers/hwtracing/coresight/coresight-cti-platform.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers/hwtracing/coresight/coresight-cti-platform.c
> index b44d83142b62..2fdaeec80ee5 100644
> --- a/drivers/hwtracing/coresight/coresight-cti-platform.c
> +++ b/drivers/hwtracing/coresight/coresight-cti-platform.c
> @@ -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);

You are correct.

Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>

Greg, can you pick this up as a fix for 5.7?

Thanks,
Mathieu

>  			fwnode_handle_put(cs_fwnode);
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] coresight: cti: remove incorrect NULL return check
@ 2020-05-05 13:40 Calvin Johnson
  2020-05-06 17:05 ` Mathieu Poirier
  0 siblings, 1 reply; 5+ messages in thread
From: Calvin Johnson @ 2020-05-05 13:40 UTC (permalink / raw)
  To: Mike Leach, linux.cj
  Cc: Calvin Johnson, Alexander Shishkin, Mathieu Poirier,
	Suzuki K Poulose, linux-arm-kernel, linux-kernel

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

Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com>
---

 drivers/hwtracing/coresight/coresight-cti-platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers/hwtracing/coresight/coresight-cti-platform.c
index b44d83142b62..2fdaeec80ee5 100644
--- a/drivers/hwtracing/coresight/coresight-cti-platform.c
+++ b/drivers/hwtracing/coresight/coresight-cti-platform.c
@@ -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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-05-15 14:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07  5:35 [PATCH] coresight: cti: remove incorrect NULL return check Calvin Johnson
2020-05-12 18:00 ` Mathieu Poirier
2020-05-15 14:22   ` Greg Kroah-Hartman
  -- strict thread matches above, loose matches on Subject: below --
2020-05-05 13:40 Calvin Johnson
2020-05-06 17:05 ` Mathieu Poirier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).