All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/4] Staging: rtl8712: ieee80211:fixed warning line over 80 characters coding style issue
@ 2017-05-08 19:22 ` Jaya Durga
  0 siblings, 0 replies; 4+ messages in thread
From: Jaya Durga @ 2017-05-08 19:22 UTC (permalink / raw)
  To: gregkh
  Cc: Larry.Finger, florian.c.schilhabel, driverdev-devel, devel,
	linux-kernel, Jaya Durga

fixed warning line over 80 characters coding style issue

Signed-off-by: Jaya Durga <jayad@cdac.in>
---
 drivers/staging/rtl8712/ieee80211.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/ieee80211.c b/drivers/staging/rtl8712/ieee80211.c
index 42cb46c..a7152df 100644
--- a/drivers/staging/rtl8712/ieee80211.c
+++ b/drivers/staging/rtl8712/ieee80211.c
@@ -222,7 +222,9 @@ unsigned char *r8712_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
 		pbuf = r8712_get_ie(pbuf, _WPA_IE_ID_, &len, limit);
 		if (pbuf) {
 			/*check if oui matches...*/
-			if (memcmp((pbuf + 2), wpa_oui_type, sizeof(wpa_oui_type)))
+			if (memcmp(
+				(pbuf + 2), wpa_oui_type,
+				sizeof(wpa_oui_type)))
 				goto check_next_ie;
 			/*check version...*/
 			memcpy((u8 *)&val16, (pbuf + 6), sizeof(val16));
-- 
1.9.1

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

* [PATCH 4/4] Staging: rtl8712: ieee80211:fixed warning line over 80 characters coding style issue
@ 2017-05-08 19:22 ` Jaya Durga
  0 siblings, 0 replies; 4+ messages in thread
From: Jaya Durga @ 2017-05-08 19:22 UTC (permalink / raw)
  To: gregkh
  Cc: devel, florian.c.schilhabel, Jaya Durga, driverdev-devel,
	linux-kernel, Larry.Finger

fixed warning line over 80 characters coding style issue

Signed-off-by: Jaya Durga <jayad@cdac.in>
---
 drivers/staging/rtl8712/ieee80211.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/ieee80211.c b/drivers/staging/rtl8712/ieee80211.c
index 42cb46c..a7152df 100644
--- a/drivers/staging/rtl8712/ieee80211.c
+++ b/drivers/staging/rtl8712/ieee80211.c
@@ -222,7 +222,9 @@ unsigned char *r8712_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
 		pbuf = r8712_get_ie(pbuf, _WPA_IE_ID_, &len, limit);
 		if (pbuf) {
 			/*check if oui matches...*/
-			if (memcmp((pbuf + 2), wpa_oui_type, sizeof(wpa_oui_type)))
+			if (memcmp(
+				(pbuf + 2), wpa_oui_type,
+				sizeof(wpa_oui_type)))
 				goto check_next_ie;
 			/*check version...*/
 			memcpy((u8 *)&val16, (pbuf + 6), sizeof(val16));
-- 
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 4/4] Staging: rtl8712: ieee80211:fixed warning line over 80 characters coding style issue
  2017-05-08 19:22 ` Jaya Durga
@ 2017-05-08 22:35   ` Joe Perches
  -1 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2017-05-08 22:35 UTC (permalink / raw)
  To: Jaya Durga, gregkh
  Cc: Larry.Finger, florian.c.schilhabel, driverdev-devel, devel, linux-kernel

On Tue, 2017-05-09 at 00:52 +0530, Jaya Durga wrote:
> fixed warning line over 80 characters coding style issue
> 
> Signed-off-by: Jaya Durga <jayad@cdac.in>
> ---
>  drivers/staging/rtl8712/ieee80211.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8712/ieee80211.c b/drivers/staging/rtl8712/ieee80211.c
> index 42cb46c..a7152df 100644
> --- a/drivers/staging/rtl8712/ieee80211.c
> +++ b/drivers/staging/rtl8712/ieee80211.c
> @@ -222,7 +222,9 @@ unsigned char *r8712_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
>  		pbuf = r8712_get_ie(pbuf, _WPA_IE_ID_, &len, limit);
>  		if (pbuf) {
>  			/*check if oui matches...*/
> -			if (memcmp((pbuf + 2), wpa_oui_type, sizeof(wpa_oui_type)))
> +			if (memcmp(
> +				(pbuf + 2), wpa_oui_type,
> +				sizeof(wpa_oui_type)))
>  				goto check_next_ie;
>  			/*check version...*/
>  			memcpy((u8 *)&val16, (pbuf + 6), sizeof(val16));

This is a oddly written function.
Perhaps something like this would be more obvious:

unsigned char *r8712_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
{
	u8 *pbuf = pie;

	while (1) {
		int len;

		pbuf = r8712_get_ie(pbuf, _WPA_IE_ID_, &len, limit);
		if (!pbuf)
			break;
		/* check if oui matches... */
		if (memcmp(pbuf + 2, WPA_OUI_TYPE, sizeof(WPA_OUI_TYPE)) == 0 &&
		    get_unaligned_le16(pbuf + 6) == 0x0001) {
			*wpa_ie_len = *(pbuf + 1);
			return pbuf;
		}
		limit = limit - (pbuf - pie) - 2 - len;
		if (limit <= 0)
			break;
		pbuf += 2 + len;
	}

	*wpa_ie_len = 0;
	return NULL;
}

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

* Re: [PATCH 4/4] Staging: rtl8712: ieee80211:fixed warning line over 80 characters coding style issue
@ 2017-05-08 22:35   ` Joe Perches
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2017-05-08 22:35 UTC (permalink / raw)
  To: Jaya Durga, gregkh
  Cc: devel, florian.c.schilhabel, driverdev-devel, linux-kernel, Larry.Finger

On Tue, 2017-05-09 at 00:52 +0530, Jaya Durga wrote:
> fixed warning line over 80 characters coding style issue
> 
> Signed-off-by: Jaya Durga <jayad@cdac.in>
> ---
>  drivers/staging/rtl8712/ieee80211.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8712/ieee80211.c b/drivers/staging/rtl8712/ieee80211.c
> index 42cb46c..a7152df 100644
> --- a/drivers/staging/rtl8712/ieee80211.c
> +++ b/drivers/staging/rtl8712/ieee80211.c
> @@ -222,7 +222,9 @@ unsigned char *r8712_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
>  		pbuf = r8712_get_ie(pbuf, _WPA_IE_ID_, &len, limit);
>  		if (pbuf) {
>  			/*check if oui matches...*/
> -			if (memcmp((pbuf + 2), wpa_oui_type, sizeof(wpa_oui_type)))
> +			if (memcmp(
> +				(pbuf + 2), wpa_oui_type,
> +				sizeof(wpa_oui_type)))
>  				goto check_next_ie;
>  			/*check version...*/
>  			memcpy((u8 *)&val16, (pbuf + 6), sizeof(val16));

This is a oddly written function.
Perhaps something like this would be more obvious:

unsigned char *r8712_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
{
	u8 *pbuf = pie;

	while (1) {
		int len;

		pbuf = r8712_get_ie(pbuf, _WPA_IE_ID_, &len, limit);
		if (!pbuf)
			break;
		/* check if oui matches... */
		if (memcmp(pbuf + 2, WPA_OUI_TYPE, sizeof(WPA_OUI_TYPE)) == 0 &&
		    get_unaligned_le16(pbuf + 6) == 0x0001) {
			*wpa_ie_len = *(pbuf + 1);
			return pbuf;
		}
		limit = limit - (pbuf - pie) - 2 - len;
		if (limit <= 0)
			break;
		pbuf += 2 + len;
	}

	*wpa_ie_len = 0;
	return NULL;
}
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2017-05-09 15:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-08 19:22 [PATCH 4/4] Staging: rtl8712: ieee80211:fixed warning line over 80 characters coding style issue Jaya Durga
2017-05-08 19:22 ` Jaya Durga
2017-05-08 22:35 ` Joe Perches
2017-05-08 22:35   ` Joe Perches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.