drivers: edac: zynqmp_edac: Updates return value check
Subsystems (3)
PATCH 1/1 drivers: edac: zynqmp_edac: Updates return value check
Updating the check of return value from edac_debugfs_create_dir to use IS_ERR.
--- drivers/edac/zynqmp_edac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/edac/zynqmp_edac.c +1 -1
@@ -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,
Signature · 1 line
2.25.1
Quoted 13 lines · Atul Kumar Pant
Updating the check of return value from
edac_debugfs_create_dirto useIS_ERR.Signed-off-by Atul Kumar Pant <[email protected]>--- drivers/edac/zynqmp_edac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/edac/zynqmp_edac.c +0
-0
drivers/edac/zynqmp_edac.c static void setup_debugfs(struct edac_device_ctl_info *edac_dev) · line 355
Quoted 6 lines
drivers/edac/zynqmp_edac.c +1
-1@@ -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
Quoted 16 lines · Greg KH
Quoted 15 lines · Atul Kumar Pant
Updating the check of return value from
edac_debugfs_create_dirto useIS_ERR.Signed-off-by Atul Kumar Pant <[email protected]>--- drivers/edac/zynqmp_edac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/edac/zynqmp_edac.c +0
-0@@ -351,7 +351,7 @@ static void setup_debugfs(struct edac_device_ctl_info *edac_dev)struct edac_priv *priv = edac_dev->pvt_info;
Quoted 9 lines
drivers/edac/zynqmp_edac.c static void setup_debugfs(struct edac_device_ctl_info *edac_dev) · line 355
Quoted 4 lines
drivers/edac/zynqmp_edac.c +1
-1priv->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.
Quoted 3 lines
thanks,
greg k-h
Quoted 24 lines · Atul Kumar Pant
Quoted 23 lines · Greg KH
Quoted 13 lines · Atul Kumar Pant
Updating the check of return value from
edac_debugfs_create_dirto useIS_ERR.Signed-off-by Atul Kumar Pant <[email protected]>--- drivers/edac/zynqmp_edac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/edac/zynqmp_edac.c +0
-0drivers/edac/zynqmp_edac.c static void setup_debugfs(struct edac_device_ctl_info *edac_dev) · line 355
Quoted 6 lines
drivers/edac/zynqmp_edac.c +1
-1@@ -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.
Quoted 5 lines
Quoted 2 lines
Why do you feel this is needed at all?
edac_debugfs_create_dirusesdebugfs_create_dirthat returnERR_PTR. Hence to check the return value by this function I changed null comparison withIS_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
Quoted 27 lines · Greg KH
Quoted 26 lines · Atul Kumar Pant
Quoted 25 lines · Greg KH
Quoted 13 lines · Atul Kumar Pant
Updating the check of return value from
edac_debugfs_create_dirto useIS_ERR.Signed-off-by Atul Kumar Pant <[email protected]>--- drivers/edac/zynqmp_edac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/edac/zynqmp_edac.c +0
-0drivers/edac/zynqmp_edac.c static void setup_debugfs(struct edac_device_ctl_info *edac_dev) · line 355
Quoted 6 lines
drivers/edac/zynqmp_edac.c +1
-1@@ -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?
Quoted 7 lines
Quoted 3 lines
edac_debugfs_create_dirusesdebugfs_create_dirthat returnERR_PTR. Hence to check the return value by this function I changed null comparison withIS_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
Quoted 2 lines
greg k-h
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees