diff mbox

[OPW,kernel] stating: cxt1e1: Do not use assignment in if condition

Message ID 20140313164756.GA8120@fireworks
State New, archived
Headers show

Commit Message

Georgiana Rodica Chelu March 13, 2014, 4:47 p.m. UTC
Fixed "do not use assignment in if condition" 
issue by using a semantic patch

Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>
---
 drivers/staging/cxt1e1/sbeproc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Paul E. McKenney March 13, 2014, 5:02 p.m. UTC | #1
On Thu, Mar 13, 2014 at 06:47:57PM +0200, Georgiana Rodica Chelu wrote:
> Fixed "do not use assignment in if condition" 
> issue by using a semantic patch
> 
> Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>

Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

> ---
>  drivers/staging/cxt1e1/sbeproc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/cxt1e1/sbeproc.c b/drivers/staging/cxt1e1/sbeproc.c
> index e08f79b..840c647 100644
> --- a/drivers/staging/cxt1e1/sbeproc.c
> +++ b/drivers/staging/cxt1e1/sbeproc.c
> @@ -72,7 +72,8 @@ static int sbecom_proc_get_sbe_info(struct seq_file *m, void *v)
>  	char       *spd;
>  	struct sbe_brd_info *bip;
> 
> -	if (!(bip = OS_kmalloc(sizeof(struct sbe_brd_info))))
> +	bip = OS_kmalloc(sizeof(struct sbe_brd_info));
> +	if (!bip)
>  		return -ENOMEM;
> 
>  	pr_devel(">> sbecom_proc_get_sbe_info: entered\n");
> -- 
> 1.8.1.2
> 
> -- 
> 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.
>
Waskiewicz Jr, Peter P March 17, 2014, 12:48 a.m. UTC | #2
On Thu, 2014-03-13 at 18:47 +0200, Georgiana Rodica Chelu wrote:
> Fixed "do not use assignment in if condition" 
> issue by using a semantic patch
> 
> Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>

This patch was already merged earlier, thanks anyways!

> ---
>  drivers/staging/cxt1e1/sbeproc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/cxt1e1/sbeproc.c b/drivers/staging/cxt1e1/sbeproc.c
> index e08f79b..840c647 100644
> --- a/drivers/staging/cxt1e1/sbeproc.c
> +++ b/drivers/staging/cxt1e1/sbeproc.c
> @@ -72,7 +72,8 @@ static int sbecom_proc_get_sbe_info(struct seq_file *m, void *v)
>  	char       *spd;
>  	struct sbe_brd_info *bip;
>  
> -	if (!(bip = OS_kmalloc(sizeof(struct sbe_brd_info))))
> +	bip = OS_kmalloc(sizeof(struct sbe_brd_info));
> +	if (!bip)
>  		return -ENOMEM;
>  
>  	pr_devel(">> sbecom_proc_get_sbe_info: entered\n");
> -- 
> 1.8.1.2
>
diff mbox

Patch

diff --git a/drivers/staging/cxt1e1/sbeproc.c b/drivers/staging/cxt1e1/sbeproc.c
index e08f79b..840c647 100644
--- a/drivers/staging/cxt1e1/sbeproc.c
+++ b/drivers/staging/cxt1e1/sbeproc.c
@@ -72,7 +72,8 @@  static int sbecom_proc_get_sbe_info(struct seq_file *m, void *v)
 	char       *spd;
 	struct sbe_brd_info *bip;
 
-	if (!(bip = OS_kmalloc(sizeof(struct sbe_brd_info))))
+	bip = OS_kmalloc(sizeof(struct sbe_brd_info));
+	if (!bip)
 		return -ENOMEM;
 
 	pr_devel(">> sbecom_proc_get_sbe_info: entered\n");