[OPW,kernel,1/2] staging: dgap: Remove useless cast on NULL
diff mbox

Message ID 8e84c9aeecd9d227128857bed84e0389978e597f.1414673408.git.tapaswenipathak@gmail.com
State New, archived
Headers show

Commit Message

Tapasweni Pathak Oct. 30, 2014, 12:53 p.m. UTC
Cast on NULL to a pointer type is not required. This
patch removes NULL casted to some pointer type.

The sematic patch used is:
@r@
type T;
@@
- (T *)NULL
+ NULL

Build tested it.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
---
 drivers/staging/dgap/dgap.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
1.7.9.5

Comments

Josh Triplett Oct. 30, 2014, 1:34 p.m. UTC | #1
On Thu, Oct 30, 2014 at 06:23:11PM +0530, Tapasweni Pathak wrote:
> Cast on NULL to a pointer type is not required. This
> patch removes NULL casted to some pointer type.
> 
> The sematic patch used is:
> @r@
> type T;
> @@
> - (T *)NULL
> + NULL
> 
> Build tested it.
> 
> Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>

Reviewed-by: Josh Triplett <josh@joshtriplett.org>

>  drivers/staging/dgap/dgap.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
> index ee5a7f2..717131a 100644
> --- a/drivers/staging/dgap/dgap.c
> +++ b/drivers/staging/dgap/dgap.c
> @@ -7028,7 +7028,7 @@ static char *dgap_sindex(char *string, char *group)
>  	char *ptr;
> 
>  	if (!string || !group)
> -		return (char *) NULL;
> +		return NULL;
> 
>  	if (*group == '^') {
>  		group++;
> @@ -7049,7 +7049,7 @@ static char *dgap_sindex(char *string, char *group)
>  		}
>  	}
> 
> -	return (char *) NULL;
> +	return NULL;
>  }
> 
>  /*
> --
> 1.7.9.5
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Patch
diff mbox

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index ee5a7f2..717131a 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -7028,7 +7028,7 @@  static char *dgap_sindex(char *string, char *group)
 	char *ptr;

 	if (!string || !group)
-		return (char *) NULL;
+		return NULL;

 	if (*group == '^') {
 		group++;
@@ -7049,7 +7049,7 @@  static char *dgap_sindex(char *string, char *group)
 		}
 	}

-	return (char *) NULL;
+	return NULL;
 }

 /*