public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 01/12] staging: rtl8188eu: if/else replaced by min_t
@ 2015-11-08  7:07 Ivan Safonov
  2015-11-08 17:10 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Ivan Safonov @ 2015-11-08  7:07 UTC (permalink / raw)
  To: devel
  Cc: Greg Kroah-Hartman, Vaishali Thakkar, Jakub Sitnicki, Anish Bhatt,
	Joe Perches, Ivan Safonov, Nicholas Mc Guire, Alexey Khoroshilov,
	Rémy Oudompheng, Sudip Mukherjee, Shraddha Barke,
	linux-kernel

Duplicated code removed.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_cmd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index 433b926..69f8744d9 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -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 */
-- 
2.4.10


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 01/12] staging: rtl8188eu: if/else replaced by min_t
  2015-11-08  7:07 [PATCH v2 01/12] staging: rtl8188eu: if/else replaced by min_t Ivan Safonov
@ 2015-11-08 17:10 ` Greg Kroah-Hartman
  2015-11-10  9:13   ` Ivan Safonov
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2015-11-08 17:10 UTC (permalink / raw)
  To: Ivan Safonov
  Cc: devel, Anish Bhatt, Vaishali Thakkar, linux-kernel,
	Nicholas Mc Guire, Joe Perches, Sudip Mukherjee,
	Alexey Khoroshilov

On Sun, Nov 08, 2015 at 02:07:11PM +0700, Ivan Safonov wrote:
> Duplicated code removed.
> 
> Signed-off-by: Ivan Safonov <insafonov@gmail.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 01/12] staging: rtl8188eu: if/else replaced by min_t
  2015-11-08 17:10 ` Greg Kroah-Hartman
@ 2015-11-10  9:13   ` Ivan Safonov
  0 siblings, 0 replies; 3+ messages in thread
From: Ivan Safonov @ 2015-11-10  9:13 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: devel, Anish Bhatt, Vaishali Thakkar, linux-kernel,
	Nicholas Mc Guire, Joe Perches, Sudip Mukherjee,
	Alexey Khoroshilov

On 11/09/2015 12:10 AM, Greg Kroah-Hartman wrote:
> On Sun, Nov 08, 2015 at 02:07:11PM +0700, Ivan Safonov wrote:
>> Duplicated code removed.
>>
>> Signed-off-by: Ivan Safonov <insafonov@gmail.com>
>> ---
>>   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

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-10  9:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-08  7:07 [PATCH v2 01/12] staging: rtl8188eu: if/else replaced by min_t Ivan Safonov
2015-11-08 17:10 ` Greg Kroah-Hartman
2015-11-10  9:13   ` Ivan Safonov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox