Commit 0d79a484 authored by Marcos Antonio de Jesus Filho's avatar Marcos Antonio de Jesus Filho Committed by Greg Kroah-Hartman
Browse files

staging: vt6655: Remove useless else



The else statements are not useful due to the presence of a return
statement on the if block. Remove the else statements, adjust the
indentation of the code, move variable declarations to the beginning of
their scope and remove useless return statement. Reported by checkpatch.

Signed-off-by: default avatarMarcos Antonio de Jesus Filho <mdejesusfilho@gmail.com>
Link: https://lore.kernel.org/r/20201109025641.GA69196@Zangetsu


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b809984c
Loading
Loading
Loading
Loading
+51 −48
Original line number Diff line number Diff line
@@ -440,10 +440,15 @@ s_uFillDataHead(
	bool is_pspoll
)
{
	struct vnt_tx_datahead_ab *buf = pTxDataHead;

	if (!pTxDataHead)
		return 0;

	if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {
		/* Auto Fallback */
		struct vnt_tx_datahead_g_fb *buf = pTxDataHead;

		if (byFBOption == AUTO_FB_NONE) {
			struct vnt_tx_datahead_g *buf = pTxDataHead;
			/* Get SignalField, ServiceField & Length */
@@ -477,9 +482,8 @@ s_uFillDataHead(
			buf->time_stamp_off_b = vnt_time_stamp_off(pDevice, pDevice->byTopCCKBasicRate);

			return buf->duration_a;
		} else {
			/* Auto Fallback */
			struct vnt_tx_datahead_g_fb *buf = pTxDataHead;
		}

		/* Get SignalField, ServiceField & Length */
		vnt_get_phy_field(pDevice, cbFrameLength, wCurrentRate,
				  byPktType, &buf->a);
@@ -501,8 +505,10 @@ s_uFillDataHead(
		buf->time_stamp_off_b = vnt_time_stamp_off(pDevice, pDevice->byTopCCKBasicRate);

		return buf->duration_a;
		} /* if (byFBOption == AUTO_FB_NONE) */
		  /* if (byFBOption == AUTO_FB_NONE) */
	} else if (byPktType == PK_TYPE_11A) {
		struct vnt_tx_datahead_ab *buf = pTxDataHead;

		if (byFBOption != AUTO_FB_NONE) {
			/* Auto Fallback */
			struct vnt_tx_datahead_a_fb *buf = pTxDataHead;
@@ -519,8 +525,8 @@ s_uFillDataHead(
										wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption));
			buf->time_stamp_off = vnt_time_stamp_off(pDevice, wCurrentRate);
			return buf->duration;
		} else {
			struct vnt_tx_datahead_ab *buf = pTxDataHead;
		}

		/* Get SignalField, ServiceField & Length */
		vnt_get_phy_field(pDevice, cbFrameLength, wCurrentRate,
				  byPktType, &buf->ab);
@@ -541,8 +547,7 @@ s_uFillDataHead(
		buf->time_stamp_off = vnt_time_stamp_off(pDevice, wCurrentRate);
		return buf->duration;
	}
	} else {
		struct vnt_tx_datahead_ab *buf = pTxDataHead;

	/* Get SignalField, ServiceField & Length */
	vnt_get_phy_field(pDevice, cbFrameLength, wCurrentRate,
			  byPktType, &buf->ab);
@@ -563,8 +568,6 @@ s_uFillDataHead(
	buf->time_stamp_off = vnt_time_stamp_off(pDevice, wCurrentRate);
	return buf->duration;
}
	return 0;
}

static
void