[PATCH v1] drivers: edac: zynqmp_edac: Updates return value check

Subsystems: edac-core, the rest, xilinx zynqmp ocm edac driver

STALE1082d

5 messages, 2 authors, 2023-08-15 · open the first message on its own page

[PATCH v1] drivers: edac: zynqmp_edac: Updates return value check

From: Atul Kumar Pant <hidden>
Date: 2023-08-06 13:05:27

Updating the check of return value from edac_debugfs_create_dir
to use IS_ERR.

Signed-off-by: Atul Kumar Pant <redacted>
---
 drivers/edac/zynqmp_edac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/edac/zynqmp_edac.c b/drivers/edac/zynqmp_edac.c
index ac7d1e0b324c..cefbbafb945e 100644
--- a/drivers/edac/zynqmp_edac.c
+++ b/drivers/edac/zynqmp_edac.c
@@ -351,7 +351,7 @@ static void setup_debugfs(struct edac_device_ctl_info *edac_dev)
 	struct edac_priv *priv = edac_dev->pvt_info;
 
 	priv->debugfs_dir = edac_debugfs_create_dir("ocm");
-	if (!priv->debugfs_dir)
+	if (IS_ERR(priv->debugfs_dir))
 		return;
 
 	edac_debugfs_create_x32("inject_fault_count", 0644, priv->debugfs_dir,
-- 
2.25.1

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

Re: [PATCH v1] drivers: edac: zynqmp_edac: Updates return value check

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2023-08-06 13:37:08

On Sun, Aug 06, 2023 at 06:35:14PM +0530, Atul Kumar Pant wrote:
quoted hunk
Updating the check of return value from edac_debugfs_create_dir
to use IS_ERR.

Signed-off-by: Atul Kumar Pant <redacted>
---
 drivers/edac/zynqmp_edac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/edac/zynqmp_edac.c b/drivers/edac/zynqmp_edac.c
index ac7d1e0b324c..cefbbafb945e 100644
--- a/drivers/edac/zynqmp_edac.c
+++ b/drivers/edac/zynqmp_edac.c
@@ -351,7 +351,7 @@ static void setup_debugfs(struct edac_device_ctl_info *edac_dev)
 	struct edac_priv *priv = edac_dev->pvt_info;
 
 	priv->debugfs_dir = edac_debugfs_create_dir("ocm");
-	if (!priv->debugfs_dir)
+	if (IS_ERR(priv->debugfs_dir))
 		return;
Again, not correct, sorry.  Please do not make these types of changes.

Why do you feel this is needed at all?

thanks,

greg k-h
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

Re: [PATCH v1] drivers: edac: zynqmp_edac: Updates return value check

From: Atul Kumar Pant <hidden>
Date: 2023-08-07 02:31:15

On Sun, Aug 06, 2023 at 03:37:01PM +0200, Greg KH wrote:
On Sun, Aug 06, 2023 at 06:35:14PM +0530, Atul Kumar Pant wrote:
quoted
Updating the check of return value from edac_debugfs_create_dir
to use IS_ERR.

Signed-off-by: Atul Kumar Pant <redacted>
---
 drivers/edac/zynqmp_edac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/edac/zynqmp_edac.c b/drivers/edac/zynqmp_edac.c
index ac7d1e0b324c..cefbbafb945e 100644
--- a/drivers/edac/zynqmp_edac.c
+++ b/drivers/edac/zynqmp_edac.c
@@ -351,7 +351,7 @@ static void setup_debugfs(struct edac_device_ctl_info *edac_dev)
 	struct edac_priv *priv = edac_dev->pvt_info;
 
 	priv->debugfs_dir = edac_debugfs_create_dir("ocm");
-	if (!priv->debugfs_dir)
+	if (IS_ERR(priv->debugfs_dir))
 		return;
Again, not correct, sorry.  Please do not make these types of changes.

Why do you feel this is needed at all?
    edac_debugfs_create_dir uses debugfs_create_dir that return ERR_PTR.
    Hence to check the return value by this function I changed null
    comparison with IS_ERR.
thanks,

greg k-h
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

Re: [PATCH v1] drivers: edac: zynqmp_edac: Updates return value check

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2023-08-07 06:02:03

On Mon, Aug 07, 2023 at 08:01:04AM +0530, Atul Kumar Pant wrote:
On Sun, Aug 06, 2023 at 03:37:01PM +0200, Greg KH wrote:
quoted
On Sun, Aug 06, 2023 at 06:35:14PM +0530, Atul Kumar Pant wrote:
quoted
Updating the check of return value from edac_debugfs_create_dir
to use IS_ERR.

Signed-off-by: Atul Kumar Pant <redacted>
---
 drivers/edac/zynqmp_edac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/edac/zynqmp_edac.c b/drivers/edac/zynqmp_edac.c
index ac7d1e0b324c..cefbbafb945e 100644
--- a/drivers/edac/zynqmp_edac.c
+++ b/drivers/edac/zynqmp_edac.c
@@ -351,7 +351,7 @@ static void setup_debugfs(struct edac_device_ctl_info *edac_dev)
 	struct edac_priv *priv = edac_dev->pvt_info;
 
 	priv->debugfs_dir = edac_debugfs_create_dir("ocm");
-	if (!priv->debugfs_dir)
+	if (IS_ERR(priv->debugfs_dir))
 		return;
Again, not correct, sorry.  Please do not make these types of changes.

Why do you feel this is needed at all?
    edac_debugfs_create_dir uses debugfs_create_dir that return ERR_PTR.
    Hence to check the return value by this function I changed null
    comparison with IS_ERR.
But that's not needed at all, right?

As this check has not ever really worked, why check it at all?

greg k-h
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

Re: [PATCH v1] drivers: edac: zynqmp_edac: Updates return value check

From: Atul Kumar Pant <hidden>
Date: 2023-08-15 20:36:43

On Mon, Aug 07, 2023 at 08:01:56AM +0200, Greg KH wrote:
On Mon, Aug 07, 2023 at 08:01:04AM +0530, Atul Kumar Pant wrote:
quoted
On Sun, Aug 06, 2023 at 03:37:01PM +0200, Greg KH wrote:
quoted
On Sun, Aug 06, 2023 at 06:35:14PM +0530, Atul Kumar Pant wrote:
quoted
Updating the check of return value from edac_debugfs_create_dir
to use IS_ERR.

Signed-off-by: Atul Kumar Pant <redacted>
---
 drivers/edac/zynqmp_edac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/edac/zynqmp_edac.c b/drivers/edac/zynqmp_edac.c
index ac7d1e0b324c..cefbbafb945e 100644
--- a/drivers/edac/zynqmp_edac.c
+++ b/drivers/edac/zynqmp_edac.c
@@ -351,7 +351,7 @@ static void setup_debugfs(struct edac_device_ctl_info *edac_dev)
 	struct edac_priv *priv = edac_dev->pvt_info;
 
 	priv->debugfs_dir = edac_debugfs_create_dir("ocm");
-	if (!priv->debugfs_dir)
+	if (IS_ERR(priv->debugfs_dir))
 		return;
Again, not correct, sorry.  Please do not make these types of changes.

Why do you feel this is needed at all?
    edac_debugfs_create_dir uses debugfs_create_dir that return ERR_PTR.
    Hence to check the return value by this function I changed null
    comparison with IS_ERR.
But that's not needed at all, right?

As this check has not ever really worked, why check it at all?
	I'll fix this in a new patch
greg k-h
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help