diff mbox

[OPW,kernel] staging:sbe-2t3e3: remove assignment in if condition

Message ID 20140301213846.GA8093@himangi-Inspiron-N5110gmail.com
State New, archived
Headers show

Commit Message

HIMANGI SARAOGI March 1, 2014, 9:38 p.m. UTC
This patch removes the assignment in an if condition to do away with 
the checkpatch warning :'do not use assignment in if condition'.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
---
 drivers/staging/sbe-2t3e3/dc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Paul E. McKenney March 2, 2014, 1:33 a.m. UTC | #1
On Sun, Mar 02, 2014 at 03:08:46AM +0530, Himangi Saraogi wrote:
> This patch removes the assignment in an if condition to do away with 
> the checkpatch warning :'do not use assignment in if condition'.
> 
> Signed-off-by: Himangi Saraogi <himangi774@gmail.com>

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

> ---
>  drivers/staging/sbe-2t3e3/dc.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/sbe-2t3e3/dc.c b/drivers/staging/sbe-2t3e3/dc.c
> index f207b9e..42ae67c 100644
> --- a/drivers/staging/sbe-2t3e3/dc.c
> +++ b/drivers/staging/sbe-2t3e3/dc.c
> @@ -339,7 +339,8 @@ static int dc_init_descriptor_list(struct channel *sc)
>  			SBE_2T3E3_RX_DESC_SECOND_ADDRESS_CHAINED | SBE_2T3E3_MTU;
> 
>  		if (sc->ether.rx_data[i] == NULL) {
> -			if (!(m = dev_alloc_skb(MCLBYTES))) {
> +			m = dev_alloc_skb(MCLBYTES);
> +			if (!m) {
>  				for (j = 0; j < i; j++) {
>  					dev_kfree_skb_any(sc->ether.rx_data[j]);
>  					sc->ether.rx_data[j] = 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/groups/opt_out.
>
diff mbox

Patch

diff --git a/drivers/staging/sbe-2t3e3/dc.c b/drivers/staging/sbe-2t3e3/dc.c
index f207b9e..42ae67c 100644
--- a/drivers/staging/sbe-2t3e3/dc.c
+++ b/drivers/staging/sbe-2t3e3/dc.c
@@ -339,7 +339,8 @@  static int dc_init_descriptor_list(struct channel *sc)
 			SBE_2T3E3_RX_DESC_SECOND_ADDRESS_CHAINED | SBE_2T3E3_MTU;
 
 		if (sc->ether.rx_data[i] == NULL) {
-			if (!(m = dev_alloc_skb(MCLBYTES))) {
+			m = dev_alloc_skb(MCLBYTES);
+			if (!m) {
 				for (j = 0; j < i; j++) {
 					dev_kfree_skb_any(sc->ether.rx_data[j]);
 					sc->ether.rx_data[j] = NULL;