seeq: use PTR_RET at init_module of driver
Subsystems (2)
PATCH 1/1 seeq: use PTR_RET at init_module of driver
the driver sees wether the dev_seeq pointer is having a error that can be read by using the PTR_ERR, and returns it at error case, other wise 0 at success case.
the PTR_RET does the same thing, and use PTR_RET instead of redoing the code of PTR_RET
---
This patch is actually made by using coccinelle, and also by looking at the PTR_RET function.
as its implementation is
static int PTR_RET(void *ptr)
{
if (IS_ERR(ptr)
return PTR_ERR(ptr);
return 0;
}by using this i removed the following code and replaced with PTR_RET....
drivers/net/ethernet/seeq/seeq8005.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/seeq/seeq8005.c +1 -3
@@ -736,9 +736,7 @@ MODULE_PARM_DESC(irq, "SEEQ 8005 IRQ number");int __init init_module (void ) { dev_seeq =seeq8005_probe (-1 ); -if (IS_ERR (dev_seeq)) -return PTR_ERR (dev_seeq); -return 0 ; +return PTR_RET (dev_seeq); } void __exit cleanup_module(void)
Signature · 1 line
1.7.9.5
Quoted 8 lines · Devendra Naga
the driver sees wether the
dev_seeqpointer is having a error that can be read by using thePTR_ERR, and returns it at error case, other wise 0 at success case.the
PTR_RETdoes the same thing, and usePTR_RETinstead of redoing the code ofPTR_RETSigned-off-by Devendra Naga <[email protected]>
Quoted 48 lines · Sun, Jul 29, 2012 at 03:28:47PM CEST, [email protected] wrote:
the driver sees wether the
dev_seeqpointer is having a error that can be read by using thePTR_ERR, and returns it at error case, other wise 0 at success case.the
PTR_RETdoes the same thing, and usePTR_RETinstead of redoing the code ofPTR_RETSigned-off-by Devendra Naga <[email protected]>---
This patch is actually made by using coccinelle, and also by looking at thePTR_RETfunction.as its implementation is
static intPTR_RET(void *ptr){ if (IS_ERR(ptr) return PTR_ERR(ptr); return 0; }by using this i removed the following code and replaced with
PTR_RET....
drivers/net/ethernet/seeq/seeq8005.c| 4 +---1 file changed, 1 insertion(+), 3 deletions(-)drivers/net/ethernet/seeq/seeq8005.c +1
-3@@ -736,9 +736,7 @@ MODULE_PARM_DESC(irq, "SEEQ 8005 IRQ number");int __init init_module (void ) { dev_seeq =seeq8005_probe (-1 ); -if (IS_ERR (dev_seeq)) -return PTR_ERR (dev_seeq); -return 0 ; +return PTR_RET (dev_seeq); } void __exit cleanup_module(void)Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Devendra Naga <[email protected]>
Date: Sun, 29 Jul 2012 19:13:47 +0545
Quoted 8 lines
the driver sees wether the
dev_seeqpointer is having a error that can be read by using thePTR_ERR, and returns it at error case, other wise 0 at success case.the
PTR_RETdoes the same thing, and usePTR_RETinstead of redoing the code ofPTR_RETSigned-off-by Devendra Naga <[email protected]>
Applied.