Skip to contentSkip to conversation

staging: rtl8188eu: if/else replaced by min_t

PATCH In review Ivan Safonov 2 participants 3 messages Nov 8, 2015 – Nov 10, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/12 staging: rtl8188eu: if/else replaced by min_t

Duplicated code removed.

---
 drivers/staging/rtl8188eu/core/rtw_cmd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/rtl8188eu/core/rtw_cmd.c +2 -4
index 433b926..69f8744d9 100644
@@ -442,10 +442,8 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct wlan_network *pnetwork)
 
 	psecuritypriv->authenticator_ie[0] = (unsigned char)psecnetwork->IELength;
 
-	if ((psecnetwork->IELength-12) < (256-1))
-		memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], psecnetwork->IELength-12);
-	else
-		memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], (256-1));
+	memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12],
+	       min_t(size_t, psecnetwork->IELength - 12, 256 - 1));
 
 	psecnetwork->IELength = 0;
 	/*  Added by Albert 2009/02/18 */
Signature · 1 line
2.4.10
#1 lore raw
Quoted 6 lines · Ivan Safonov

Duplicated code removed.

---
 drivers/staging/rtl8188eu/core/rtw_cmd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

You sent 3 versions of this patch, is this series the "real" one? When you resend, you need to say why you resent things, below the --- line put the difference between v1 and v2 there so that we know what changed.

So I'm going to assume that the v2 series is the one you want to have applied, if this isn't correct, please let me know.

thanks,

greg k-h

#2 lore raw
Quoted 11 lines · Greg Kroah-Hartman
Quoted 6 lines · Ivan Safonov

Duplicated code removed.

---
  drivers/staging/rtl8188eu/core/rtw_cmd.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)

You sent 3 versions of this patch, is this series the "real" one? When you resend, you need to say why you resent things, below the --- line put the difference between v1 and v2 there so that we know what changed.

Quoted 6 lines

So I'm going to assume that the v2 series is the one you want to have applied, if this isn't correct, please let me know.

thanks,

greg k-h

Yes, that's right, the second version is the only correct.