Commit 1521968f authored by Srishti Sharma's avatar Srishti Sharma Committed by Greg Kroah-Hartman
Browse files

Staging: irda: Don't use assignment inside if statement



Write assignment statement outside of the if statement. Done
using the following semantic patch by coccinelle.

@@
identifier E;
expression F;
statement S;
@@

-if((E = F))
+E = F;
+if(E)
    S

Signed-off-by: default avatarSrishti Sharma <srishtishar@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6561e82d
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -334,10 +334,10 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self)
	urb->transfer_flags = 0;
	urb->transfer_flags = 0;


	/* Irq disabled -> GFP_ATOMIC */
	/* Irq disabled -> GFP_ATOMIC */
	if ((ret = usb_submit_urb(urb, GFP_ATOMIC))) {
	ret = usb_submit_urb(urb, GFP_ATOMIC);
	if (ret)
		net_warn_ratelimited("%s(), failed Speed URB\n", __func__);
		net_warn_ratelimited("%s(), failed Speed URB\n", __func__);
}
}
}


/*------------------------------------------------------------------*/
/*------------------------------------------------------------------*/
/*
/*
+6 −3
Original line number Original line Diff line number Diff line
@@ -605,19 +605,22 @@ static int mcs_speed_change(struct mcs_cb *mcs)
	if (mcs->new_speed <= 115200) {
	if (mcs->new_speed <= 115200) {
		rval &= ~MCS_FIR;
		rval &= ~MCS_FIR;


		if ((rst = (mcs->speed > 115200)))
		rst = (mcs->speed > 115200);
		if (rst)
			mcs_set_reg(mcs, MCS_MINRXPW_REG, 0);
			mcs_set_reg(mcs, MCS_MINRXPW_REG, 0);


	} else if (mcs->new_speed <= 1152000) {
	} else if (mcs->new_speed <= 1152000) {
		rval &= ~MCS_FIR;
		rval &= ~MCS_FIR;


		if ((rst = !(mcs->speed == 576000 || mcs->speed == 1152000)))
		rst = !(mcs->speed == 576000 || mcs->speed == 1152000);
		if (rst)
			mcs_set_reg(mcs, MCS_MINRXPW_REG, 5);
			mcs_set_reg(mcs, MCS_MINRXPW_REG, 5);


	} else {
	} else {
		rval |= MCS_FIR;
		rval |= MCS_FIR;


		if ((rst = (mcs->speed != 4000000)))
		rst = (mcs->speed != 4000000);
		if (rst)
			mcs_set_reg(mcs, MCS_MINRXPW_REG, 5);
			mcs_set_reg(mcs, MCS_MINRXPW_REG, 5);


	}
	}
+2 −1
Original line number Original line Diff line number Diff line
@@ -217,7 +217,8 @@ static __u32 hash( const char* name)


	while(*name) {
	while(*name) {
		h = (h<<4) + *name++;
		h = (h<<4) + *name++;
		if ((g = (h & 0xf0000000)))
		g = (h & 0xf0000000);
		if (g)
			h ^=g>>24;
			h ^=g>>24;
		h &=~g;
		h &=~g;
	}
	}