All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/9] staging: rtl8712: r8712_os_recv_resource_alloc(): Change return type
@ 2019-08-02  6:42 Nishka Dasgupta
  2019-08-02  6:42 ` [PATCH 2/9] staging: rtl8712: _r8712_init_recv_priv(): " Nishka Dasgupta
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Nishka Dasgupta @ 2019-08-02  6:42 UTC (permalink / raw)


Change return type of function r8712_os_recv_resource_alloc from int to
void as its return value is never used.

Signed-off-by: Nishka Dasgupta <nishkadg.linux at gmail.com>
---
 drivers/staging/rtl8712/recv_linux.c | 5 ++---
 drivers/staging/rtl8712/recv_osdep.h | 4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c
index 70a4dcd4a1e5..aaa77823115a 100644
--- a/drivers/staging/rtl8712/recv_linux.c
+++ b/drivers/staging/rtl8712/recv_linux.c
@@ -29,12 +29,11 @@
 
 /*init os related resource in struct recv_priv*/
 /*alloc os related resource in union recv_frame*/
-int r8712_os_recv_resource_alloc(struct _adapter *padapter,
-				 union recv_frame *precvframe)
+void r8712_os_recv_resource_alloc(struct _adapter *padapter,
+				  union recv_frame *precvframe)
 {
 	precvframe->u.hdr.pkt_newalloc = NULL;
 	precvframe->u.hdr.pkt = NULL;
-	return _SUCCESS;
 }
 
 /*alloc os related resource in struct recv_buf*/
diff --git a/drivers/staging/rtl8712/recv_osdep.h b/drivers/staging/rtl8712/recv_osdep.h
index dcd3b484c793..c93ba4c3eb9b 100644
--- a/drivers/staging/rtl8712/recv_osdep.h
+++ b/drivers/staging/rtl8712/recv_osdep.h
@@ -28,8 +28,8 @@ void r8712_handle_tkip_mic_err(struct _adapter *padapter, u8 bgroup);
 int r8712_init_recv_priv(struct recv_priv *precvpriv,
 			 struct _adapter *padapter);
 void r8712_free_recv_priv(struct recv_priv *precvpriv);
-int r8712_os_recv_resource_alloc(struct _adapter *padapter,
-				 union recv_frame *precvframe);
+void r8712_os_recv_resource_alloc(struct _adapter *padapter,
+				  union recv_frame *precvframe);
 int r8712_os_recvbuf_resource_alloc(struct _adapter *padapter,
 				    struct recv_buf *precvbuf);
 int r8712_os_recvbuf_resource_free(struct _adapter *padapter,
-- 
2.19.1

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

* [PATCH 2/9] staging: rtl8712: _r8712_init_recv_priv(): Change return type
  2019-08-02  6:42 [PATCH 1/9] staging: rtl8712: r8712_os_recv_resource_alloc(): Change return type Nishka Dasgupta
@ 2019-08-02  6:42 ` Nishka Dasgupta
  2019-08-02  6:42 ` [PATCH 3/9] staging: rtl8712: r8712_init_recv_priv(): " Nishka Dasgupta
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Nishka Dasgupta @ 2019-08-02  6:42 UTC (permalink / raw)


Change return type of _r8712_init_recv_priv as its return value is never
checked or used. Modify return statements accordingly.

Signed-off-by: Nishka Dasgupta <nishkadg.linux at gmail.com>
---
 drivers/staging/rtl8712/recv_osdep.h   | 2 +-
 drivers/staging/rtl8712/rtl871x_recv.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8712/recv_osdep.h b/drivers/staging/rtl8712/recv_osdep.h
index c93ba4c3eb9b..7a0fa227de73 100644
--- a/drivers/staging/rtl8712/recv_osdep.h
+++ b/drivers/staging/rtl8712/recv_osdep.h
@@ -18,7 +18,7 @@
 #include "drv_types.h"
 #include <linux/skbuff.h>
 
-sint _r8712_init_recv_priv(struct recv_priv *precvpriv,
+void _r8712_init_recv_priv(struct recv_priv *precvpriv,
 			   struct _adapter *padapter);
 void _r8712_free_recv_priv(struct recv_priv *precvpriv);
 s32  r8712_recv_entry(union recv_frame *precv_frame);
diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c
index 9969e5265a40..79c7a329e9f6 100644
--- a/drivers/staging/rtl8712/rtl871x_recv.c
+++ b/drivers/staging/rtl8712/rtl871x_recv.c
@@ -48,7 +48,7 @@ void _r8712_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)
 	_init_queue(&psta_recvpriv->defrag_q);
 }
 
-sint _r8712_init_recv_priv(struct recv_priv *precvpriv,
+void _r8712_init_recv_priv(struct recv_priv *precvpriv,
 			   struct _adapter *padapter)
 {
 	sint i;
@@ -64,7 +64,7 @@ sint _r8712_init_recv_priv(struct recv_priv *precvpriv,
 				sizeof(union recv_frame) + RXFRAME_ALIGN_SZ,
 				GFP_ATOMIC);
 	if (precvpriv->pallocated_frame_buf == NULL)
-		return _FAIL;
+		return;
 	kmemleak_not_leak(precvpriv->pallocated_frame_buf);
 	precvpriv->precv_frame_buf = precvpriv->pallocated_frame_buf +
 				    RXFRAME_ALIGN_SZ -
@@ -80,7 +80,7 @@ sint _r8712_init_recv_priv(struct recv_priv *precvpriv,
 		precvframe++;
 	}
 	precvpriv->rx_pending_cnt = 1;
-	return r8712_init_recv_priv(precvpriv, padapter);
+	r8712_init_recv_priv(precvpriv, padapter);
 }
 
 void _r8712_free_recv_priv(struct recv_priv *precvpriv)
-- 
2.19.1

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

* [PATCH 3/9] staging: rtl8712: r8712_init_recv_priv(): Change return type
  2019-08-02  6:42 [PATCH 1/9] staging: rtl8712: r8712_os_recv_resource_alloc(): Change return type Nishka Dasgupta
  2019-08-02  6:42 ` [PATCH 2/9] staging: rtl8712: _r8712_init_recv_priv(): " Nishka Dasgupta
@ 2019-08-02  6:42 ` Nishka Dasgupta
  2019-08-02  6:42 ` [PATCH 4/9] staging: rtl8712: r8712_os_recvbuf_resource_alloc(): Change return values Nishka Dasgupta
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Nishka Dasgupta @ 2019-08-02  6:42 UTC (permalink / raw)


Change return type of r8712_init_recv_priv from int to void as its
return value is never used. Remove return statements accordingly.

Signed-off-by: Nishka Dasgupta <nishkadg.linux at gmail.com>
---
 drivers/staging/rtl8712/recv_osdep.h   | 4 ++--
 drivers/staging/rtl8712/rtl8712_recv.c | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8712/recv_osdep.h b/drivers/staging/rtl8712/recv_osdep.h
index 7a0fa227de73..3cfafef1af91 100644
--- a/drivers/staging/rtl8712/recv_osdep.h
+++ b/drivers/staging/rtl8712/recv_osdep.h
@@ -25,8 +25,8 @@ s32  r8712_recv_entry(union recv_frame *precv_frame);
 void r8712_recv_indicatepkt(struct _adapter *adapter,
 			    union recv_frame *precv_frame);
 void r8712_handle_tkip_mic_err(struct _adapter *padapter, u8 bgroup);
-int r8712_init_recv_priv(struct recv_priv *precvpriv,
-			 struct _adapter *padapter);
+void r8712_init_recv_priv(struct recv_priv *precvpriv,
+			  struct _adapter *padapter);
 void r8712_free_recv_priv(struct recv_priv *precvpriv);
 void r8712_os_recv_resource_alloc(struct _adapter *padapter,
 				  union recv_frame *precvframe);
diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c
index d9574ea3ffb2..bb0407cac1ae 100644
--- a/drivers/staging/rtl8712/rtl8712_recv.c
+++ b/drivers/staging/rtl8712/rtl8712_recv.c
@@ -35,7 +35,7 @@ static u8 rfc1042_header[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00};
 
 static void recv_tasklet(void *priv);
 
-int r8712_init_recv_priv(struct recv_priv *precvpriv, struct _adapter *padapter)
+void r8712_init_recv_priv(struct recv_priv *precvpriv, struct _adapter *padapter)
 {
 	int i;
 	struct recv_buf *precvbuf;
@@ -83,7 +83,6 @@ int r8712_init_recv_priv(struct recv_priv *precvpriv, struct _adapter *padapter)
 		}
 		pskb = NULL;
 	}
-	return res;
 }
 
 void r8712_free_recv_priv(struct recv_priv *precvpriv)
-- 
2.19.1

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

* [PATCH 4/9] staging: rtl8712: r8712_os_recvbuf_resource_alloc(): Change return values
  2019-08-02  6:42 [PATCH 1/9] staging: rtl8712: r8712_os_recv_resource_alloc(): Change return type Nishka Dasgupta
  2019-08-02  6:42 ` [PATCH 2/9] staging: rtl8712: _r8712_init_recv_priv(): " Nishka Dasgupta
  2019-08-02  6:42 ` [PATCH 3/9] staging: rtl8712: r8712_init_recv_priv(): " Nishka Dasgupta
@ 2019-08-02  6:42 ` Nishka Dasgupta
  2019-08-02  6:42 ` [PATCH 5/9] staging: rtl8712: r8712_os_recvbuf_resource_free(): Change return type Nishka Dasgupta
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Nishka Dasgupta @ 2019-08-02  6:42 UTC (permalink / raw)


Change return values of r8712_os_recvbuf_resource_alloc from
_SUCCESS/_FAIL to 0/-ENOMEM respectively.
Modify check at call site to check for non-zero return value instead of
_FAIL. Thereafter remove variable at call site that stored the return
value and perform the check directly.

Signed-off-by: Nishka Dasgupta <nishkadg.linux at gmail.com>
---
 drivers/staging/rtl8712/recv_linux.c   | 4 ++--
 drivers/staging/rtl8712/rtl8712_recv.c | 6 ++----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c
index aaa77823115a..682f5b2802ee 100644
--- a/drivers/staging/rtl8712/recv_linux.c
+++ b/drivers/staging/rtl8712/recv_linux.c
@@ -40,12 +40,12 @@ void r8712_os_recv_resource_alloc(struct _adapter *padapter,
 int r8712_os_recvbuf_resource_alloc(struct _adapter *padapter,
 				    struct recv_buf *precvbuf)
 {
-	int res = _SUCCESS;
+	int res = 0;
 
 	precvbuf->irp_pending = false;
 	precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL);
 	if (!precvbuf->purb)
-		res = _FAIL;
+		res = -ENOMEM;
 	precvbuf->pskb = NULL;
 	precvbuf->pallocated_buf = NULL;
 	precvbuf->pbuf = NULL;
diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c
index bb0407cac1ae..eb9a4a5ed740 100644
--- a/drivers/staging/rtl8712/rtl8712_recv.c
+++ b/drivers/staging/rtl8712/rtl8712_recv.c
@@ -39,7 +39,6 @@ void r8712_init_recv_priv(struct recv_priv *precvpriv, struct _adapter *padapter
 {
 	int i;
 	struct recv_buf *precvbuf;
-	int res = _SUCCESS;
 	addr_t tmpaddr = 0;
 	int alignment = 0;
 	struct sk_buff *pskb = NULL;
@@ -49,15 +48,14 @@ void r8712_init_recv_priv(struct recv_priv *precvpriv, struct _adapter *padapter
 	precvpriv->pallocated_recv_buf =
 		kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_ATOMIC);
 	if (!precvpriv->pallocated_recv_buf)
-		return _FAIL;
+		return;
 	precvpriv->precv_buf = precvpriv->pallocated_recv_buf + 4 -
 			      ((addr_t)(precvpriv->pallocated_recv_buf) & 3);
 	precvbuf = (struct recv_buf *)precvpriv->precv_buf;
 	for (i = 0; i < NR_RECVBUFF; i++) {
 		INIT_LIST_HEAD(&precvbuf->list);
 		spin_lock_init(&precvbuf->recvbuf_lock);
-		res = r8712_os_recvbuf_resource_alloc(padapter, precvbuf);
-		if (res == _FAIL)
+		if (r8712_os_recvbuf_resource_alloc(padapter, precvbuf))
 			break;
 		precvbuf->ref_cnt = 0;
 		precvbuf->adapter = padapter;
-- 
2.19.1

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

* [PATCH 5/9] staging: rtl8712: r8712_os_recvbuf_resource_free(): Change return type
  2019-08-02  6:42 [PATCH 1/9] staging: rtl8712: r8712_os_recv_resource_alloc(): Change return type Nishka Dasgupta
                   ` (2 preceding siblings ...)
  2019-08-02  6:42 ` [PATCH 4/9] staging: rtl8712: r8712_os_recvbuf_resource_alloc(): Change return values Nishka Dasgupta
@ 2019-08-02  6:42 ` Nishka Dasgupta
  2019-08-02  6:42 ` [PATCH 6/9] staging: rtl8712: r8712_tkip_decrypt(): " Nishka Dasgupta
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Nishka Dasgupta @ 2019-08-02  6:42 UTC (permalink / raw)


Change return type of r8712_os_recvbuf_resource_free from int to void as
it always returns _SUCCESS and this return value is never stored,
checked or otherwise used. Remove return statement accordingly.

Signed-off-by: Nishka Dasgupta <nishkadg.linux at gmail.com>
---
 drivers/staging/rtl8712/recv_linux.c | 5 ++---
 drivers/staging/rtl8712/recv_osdep.h | 4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c
index 682f5b2802ee..215fca4abb3a 100644
--- a/drivers/staging/rtl8712/recv_linux.c
+++ b/drivers/staging/rtl8712/recv_linux.c
@@ -59,8 +59,8 @@ int r8712_os_recvbuf_resource_alloc(struct _adapter *padapter,
 }
 
 /*free os related resource in struct recv_buf*/
-int r8712_os_recvbuf_resource_free(struct _adapter *padapter,
-			     struct recv_buf *precvbuf)
+void r8712_os_recvbuf_resource_free(struct _adapter *padapter,
+				    struct recv_buf *precvbuf)
 {
 	if (precvbuf->pskb)
 		dev_kfree_skb_any(precvbuf->pskb);
@@ -68,7 +68,6 @@ int r8712_os_recvbuf_resource_free(struct _adapter *padapter,
 		usb_kill_urb(precvbuf->purb);
 		usb_free_urb(precvbuf->purb);
 	}
-	return _SUCCESS;
 }
 
 void r8712_handle_tkip_mic_err(struct _adapter *adapter, u8 bgroup)
diff --git a/drivers/staging/rtl8712/recv_osdep.h b/drivers/staging/rtl8712/recv_osdep.h
index 3cfafef1af91..792f9cfbacd9 100644
--- a/drivers/staging/rtl8712/recv_osdep.h
+++ b/drivers/staging/rtl8712/recv_osdep.h
@@ -32,8 +32,8 @@ void r8712_os_recv_resource_alloc(struct _adapter *padapter,
 				  union recv_frame *precvframe);
 int r8712_os_recvbuf_resource_alloc(struct _adapter *padapter,
 				    struct recv_buf *precvbuf);
-int r8712_os_recvbuf_resource_free(struct _adapter *padapter,
-				   struct recv_buf *precvbuf);
+void r8712_os_recvbuf_resource_free(struct _adapter *padapter,
+				    struct recv_buf *precvbuf);
 void r8712_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl);
 
 #endif
-- 
2.19.1

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

* [PATCH 6/9] staging: rtl8712: r8712_tkip_decrypt(): Change return type
  2019-08-02  6:42 [PATCH 1/9] staging: rtl8712: r8712_os_recv_resource_alloc(): Change return type Nishka Dasgupta
                   ` (3 preceding siblings ...)
  2019-08-02  6:42 ` [PATCH 5/9] staging: rtl8712: r8712_os_recvbuf_resource_free(): Change return type Nishka Dasgupta
@ 2019-08-02  6:42 ` Nishka Dasgupta
  2019-08-02  6:42 ` [PATCH 7/9] staging: rtl8712: aes_cipher(): " Nishka Dasgupta
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Nishka Dasgupta @ 2019-08-02  6:42 UTC (permalink / raw)


Change return type of r8712_tkip_decrypt from u8 to void as the
return value is never used. Modify or remove return statements
accordingly.

Signed-off-by: Nishka Dasgupta <nishkadg.linux at gmail.com>
---
 drivers/staging/rtl8712/rtl871x_security.c | 12 ++----------
 drivers/staging/rtl8712/rtl871x_security.h |  2 +-
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_security.c b/drivers/staging/rtl8712/rtl871x_security.c
index 693008bba83e..66586a9d9f73 100644
--- a/drivers/staging/rtl8712/rtl871x_security.c
+++ b/drivers/staging/rtl8712/rtl871x_security.c
@@ -636,7 +636,7 @@ u32 r8712_tkip_encrypt(struct _adapter *padapter, u8 *pxmitframe)
 }
 
 /* The hlen doesn't include the IV */
-u32 r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe)
+void r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe)
 {	/* exclude ICV */
 	u16 pnl;
 	u32 pnh;
@@ -670,7 +670,7 @@ u32 r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe)
 				prwskey = &psecuritypriv->XGrpKey[
 					 ((idx >> 6) & 0x3) - 1].skey[0];
 				if (!psecuritypriv->binstallGrpkey)
-					return _FAIL;
+					return;
 			} else {
 				prwskey = &stainfo->x_UncstKey.skey[0];
 			}
@@ -686,16 +686,8 @@ u32 r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe)
 			arcfour_encrypt(&mycontext, payload, payload, length);
 			*((__le32 *)crc) = cpu_to_le32(getcrc32(payload,
 					length - 4));
-			if (crc[3] != payload[length - 1] ||
-			    crc[2] != payload[length - 2] ||
-			    crc[1] != payload[length - 3] ||
-			    crc[0] != payload[length - 4])
-				return _FAIL;
-		} else {
-			return _FAIL;
 		}
 	}
-	return _SUCCESS;
 }
 
 /* 3 =====AES related===== */
diff --git a/drivers/staging/rtl8712/rtl871x_security.h b/drivers/staging/rtl8712/rtl871x_security.h
index 25b4d379766d..25220afa61e9 100644
--- a/drivers/staging/rtl8712/rtl871x_security.h
+++ b/drivers/staging/rtl8712/rtl871x_security.h
@@ -210,7 +210,7 @@ u32 r8712_aes_encrypt(struct _adapter *padapter, u8 *pxmitframe);
 u32 r8712_tkip_encrypt(struct _adapter *padapter, u8 *pxmitframe);
 void r8712_wep_encrypt(struct _adapter *padapter, u8  *pxmitframe);
 u32 r8712_aes_decrypt(struct _adapter *padapter, u8  *precvframe);
-u32 r8712_tkip_decrypt(struct _adapter *padapter, u8  *precvframe);
+void r8712_tkip_decrypt(struct _adapter *padapter, u8  *precvframe);
 void r8712_wep_decrypt(struct _adapter *padapter, u8  *precvframe);
 void r8712_use_tkipkey_handler(struct timer_list *t);
 
-- 
2.19.1

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

* [PATCH 7/9] staging: rtl8712: aes_cipher(): Change return type
  2019-08-02  6:42 [PATCH 1/9] staging: rtl8712: r8712_os_recv_resource_alloc(): Change return type Nishka Dasgupta
                   ` (4 preceding siblings ...)
  2019-08-02  6:42 ` [PATCH 6/9] staging: rtl8712: r8712_tkip_decrypt(): " Nishka Dasgupta
@ 2019-08-02  6:42 ` Nishka Dasgupta
  2019-08-02  6:42 ` [PATCH 8/9] staging: rtl8712: aes_decipher(): " Nishka Dasgupta
  2019-08-02  6:42 ` [PATCH 9/9] staging: rtl8712: r8712_aes_decrypt(): " Nishka Dasgupta
  7 siblings, 0 replies; 9+ messages in thread
From: Nishka Dasgupta @ 2019-08-02  6:42 UTC (permalink / raw)


Change return type of aes_cipher from sint to void as it always returns
_SUCCESS and its return value is never used.

Signed-off-by: Nishka Dasgupta <nishkadg.linux at gmail.com>
---
 drivers/staging/rtl8712/rtl871x_security.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_security.c b/drivers/staging/rtl8712/rtl871x_security.c
index 66586a9d9f73..8f3781c5dd25 100644
--- a/drivers/staging/rtl8712/rtl871x_security.c
+++ b/drivers/staging/rtl8712/rtl871x_security.c
@@ -1011,8 +1011,8 @@ static void bitwise_xor(u8 *ina, u8 *inb, u8 *out)
 		out[i] = ina[i] ^ inb[i];
 }
 
-static sint aes_cipher(u8 *key, uint	hdrlen,
-			u8 *pframe, uint plen)
+static void aes_cipher(u8 *key, uint hdrlen,
+		       u8 *pframe, uint plen)
 {
 	uint qc_exists, a4_exists, i, j, payload_remainder;
 	uint num_blocks, payload_index;
@@ -1132,7 +1132,6 @@ static sint aes_cipher(u8 *key, uint	hdrlen,
 	bitwise_xor(aes_out, padded_buffer, chain_buffer);
 	for (j = 0; j < 8; j++)
 		pframe[payload_index++] = chain_buffer[j];
-	return _SUCCESS;
 }
 
 u32 r8712_aes_encrypt(struct _adapter *padapter, u8 *pxmitframe)
-- 
2.19.1

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

* [PATCH 8/9] staging: rtl8712: aes_decipher(): Change return type
  2019-08-02  6:42 [PATCH 1/9] staging: rtl8712: r8712_os_recv_resource_alloc(): Change return type Nishka Dasgupta
                   ` (5 preceding siblings ...)
  2019-08-02  6:42 ` [PATCH 7/9] staging: rtl8712: aes_cipher(): " Nishka Dasgupta
@ 2019-08-02  6:42 ` Nishka Dasgupta
  2019-08-02  6:42 ` [PATCH 9/9] staging: rtl8712: r8712_aes_decrypt(): " Nishka Dasgupta
  7 siblings, 0 replies; 9+ messages in thread
From: Nishka Dasgupta @ 2019-08-02  6:42 UTC (permalink / raw)


Change return type of aes_decipher from sint to void as it always
returns _SUCCESS and this value is never used.

Signed-off-by: Nishka Dasgupta <nishkadg.linux at gmail.com>
---
 drivers/staging/rtl8712/rtl871x_security.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_security.c b/drivers/staging/rtl8712/rtl871x_security.c
index 8f3781c5dd25..bf55a697dd5f 100644
--- a/drivers/staging/rtl8712/rtl871x_security.c
+++ b/drivers/staging/rtl8712/rtl871x_security.c
@@ -1184,8 +1184,8 @@ u32 r8712_aes_encrypt(struct _adapter *padapter, u8 *pxmitframe)
 	return res;
 }
 
-static sint aes_decipher(u8 *key, uint	hdrlen,
-			u8 *pframe, uint plen)
+static void aes_decipher(u8 *key, uint hdrlen,
+			 u8 *pframe, uint plen)
 {
 	static u8 message[MAX_MSG_SIZE];
 	uint qc_exists, a4_exists, i, j, payload_remainder;
@@ -1339,7 +1339,6 @@ static sint aes_decipher(u8 *key, uint	hdrlen,
 	for (j = 0; j < 8; j++)
 		message[payload_index++] = chain_buffer[j];
 	/* compare the mic */
-	return _SUCCESS;
 }
 
 u32 r8712_aes_decrypt(struct _adapter *padapter, u8 *precvframe)
-- 
2.19.1

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

* [PATCH 9/9] staging: rtl8712: r8712_aes_decrypt(): Change return type
  2019-08-02  6:42 [PATCH 1/9] staging: rtl8712: r8712_os_recv_resource_alloc(): Change return type Nishka Dasgupta
                   ` (6 preceding siblings ...)
  2019-08-02  6:42 ` [PATCH 8/9] staging: rtl8712: aes_decipher(): " Nishka Dasgupta
@ 2019-08-02  6:42 ` Nishka Dasgupta
  7 siblings, 0 replies; 9+ messages in thread
From: Nishka Dasgupta @ 2019-08-02  6:42 UTC (permalink / raw)


Change return type of r8712_aes_decrypt from u8 to void as its return
value is never checked. Modify return statements accordingly.

Signed-off-by: Nishka Dasgupta <nishkadg.linux at gmail.com>
---
 drivers/staging/rtl8712/rtl871x_security.c | 7 ++-----
 drivers/staging/rtl8712/rtl871x_security.h | 2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_security.c b/drivers/staging/rtl8712/rtl871x_security.c
index bf55a697dd5f..73e3d5ef3af2 100644
--- a/drivers/staging/rtl8712/rtl871x_security.c
+++ b/drivers/staging/rtl8712/rtl871x_security.c
@@ -1341,7 +1341,7 @@ static void aes_decipher(u8 *key, uint hdrlen,
 	/* compare the mic */
 }
 
-u32 r8712_aes_decrypt(struct _adapter *padapter, u8 *precvframe)
+void r8712_aes_decrypt(struct _adapter *padapter, u8 *precvframe)
 {	/* exclude ICV */
 	/* Intermediate Buffers */
 	sint		length;
@@ -1364,7 +1364,7 @@ u32 r8712_aes_decrypt(struct _adapter *padapter, u8 *precvframe)
 				prwskey = &psecuritypriv->XGrpKey[
 					  ((idx >> 6) & 0x3) - 1].skey[0];
 				if (!psecuritypriv->binstallGrpkey)
-					return _FAIL;
+					return;
 
 			} else {
 				prwskey = &stainfo->x_UncstKey.skey[0];
@@ -1374,11 +1374,8 @@ u32 r8712_aes_decrypt(struct _adapter *padapter, u8 *precvframe)
 				 prxattrib->iv_len;
 			aes_decipher(prwskey, prxattrib->hdrlen, pframe,
 				     length);
-		} else {
-			return _FAIL;
 		}
 	}
-	return _SUCCESS;
 }
 
 void r8712_use_tkipkey_handler(struct timer_list *t)
diff --git a/drivers/staging/rtl8712/rtl871x_security.h b/drivers/staging/rtl8712/rtl871x_security.h
index 25220afa61e9..b2dda16cbd0a 100644
--- a/drivers/staging/rtl8712/rtl871x_security.h
+++ b/drivers/staging/rtl8712/rtl871x_security.h
@@ -209,7 +209,7 @@ void r8712_secgetmic(struct mic_data *pmicdata, u8 *dst);
 u32 r8712_aes_encrypt(struct _adapter *padapter, u8 *pxmitframe);
 u32 r8712_tkip_encrypt(struct _adapter *padapter, u8 *pxmitframe);
 void r8712_wep_encrypt(struct _adapter *padapter, u8  *pxmitframe);
-u32 r8712_aes_decrypt(struct _adapter *padapter, u8  *precvframe);
+void r8712_aes_decrypt(struct _adapter *padapter, u8  *precvframe);
 void r8712_tkip_decrypt(struct _adapter *padapter, u8  *precvframe);
 void r8712_wep_decrypt(struct _adapter *padapter, u8  *precvframe);
 void r8712_use_tkipkey_handler(struct timer_list *t);
-- 
2.19.1

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

end of thread, other threads:[~2019-08-02  6:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-02  6:42 [PATCH 1/9] staging: rtl8712: r8712_os_recv_resource_alloc(): Change return type Nishka Dasgupta
2019-08-02  6:42 ` [PATCH 2/9] staging: rtl8712: _r8712_init_recv_priv(): " Nishka Dasgupta
2019-08-02  6:42 ` [PATCH 3/9] staging: rtl8712: r8712_init_recv_priv(): " Nishka Dasgupta
2019-08-02  6:42 ` [PATCH 4/9] staging: rtl8712: r8712_os_recvbuf_resource_alloc(): Change return values Nishka Dasgupta
2019-08-02  6:42 ` [PATCH 5/9] staging: rtl8712: r8712_os_recvbuf_resource_free(): Change return type Nishka Dasgupta
2019-08-02  6:42 ` [PATCH 6/9] staging: rtl8712: r8712_tkip_decrypt(): " Nishka Dasgupta
2019-08-02  6:42 ` [PATCH 7/9] staging: rtl8712: aes_cipher(): " Nishka Dasgupta
2019-08-02  6:42 ` [PATCH 8/9] staging: rtl8712: aes_decipher(): " Nishka Dasgupta
2019-08-02  6:42 ` [PATCH 9/9] staging: rtl8712: r8712_aes_decrypt(): " Nishka Dasgupta

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.