All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shivani Bhardwaj <shivanib134@gmail.com>
To: outreachy-kernel@googlegroups.com
Subject: [PATCH] Staging: wilc1000: coreconfigurator: Drop unneeded wrapper functions
Date: Thu, 22 Oct 2015 15:41:58 +0530	[thread overview]
Message-ID: <20151022101158.GA17223@ubuntu> (raw)

Remove the wrapper functions get_address1, get_address2 and get_address3
as they are not required and replace their calls by suitable functions.
Semantic patch used:
@@
identifier f,g;
@@

*f(...) {
 g(...); }

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
 drivers/staging/wilc1000/coreconfigurator.c | 38 ++++++++++-------------------
 1 file changed, 13 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 427adfd..38bc2c4 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -171,38 +171,26 @@ static inline u8 get_from_ds(u8 *header)
 	return ((header[1] & 0x02) >> 1);
 }
 
-/* This function extracts the MAC Address in 'address1' field of the MAC     */
-/* header and updates the MAC Address in the allocated 'addr' variable.      */
-static inline void get_address1(u8 *pu8msa, u8 *addr)
-{
-	memcpy(addr, pu8msa + 4, 6);
-}
-
-/* This function extracts the MAC Address in 'address2' field of the MAC     */
-/* header and updates the MAC Address in the allocated 'addr' variable.      */
-static inline void get_address2(u8 *pu8msa, u8 *addr)
-{
-	memcpy(addr, pu8msa + 10, 6);
-}
-
-/* This function extracts the MAC Address in 'address3' field of the MAC     */
-/* header and updates the MAC Address in the allocated 'addr' variable.      */
-static inline void get_address3(u8 *pu8msa, u8 *addr)
-{
-	memcpy(addr, pu8msa + 16, 6);
-}
-
 /* This function extracts the BSSID from the incoming WLAN packet based on   */
-/* the 'from ds' bit, and updates the MAC Address in the allocated 'addr'    */
+/* the 'from ds' bit, and updates the MAC Address in the allocated 'data'    */
 /* variable.                                                                 */
 static inline void get_BSSID(u8 *data, u8 *bssid)
 {
 	if (get_from_ds(data) == 1)
-		get_address2(data, bssid);
+		/* Extract the MAC Address in 'address2' field of the MAC */
+		/* header and update the MAC Address in the allocated 'data'
+		 * variable. */
+		memcpy(data, bssid + 10, 6);
 	else if (get_to_ds(data) == 1)
-		get_address1(data, bssid);
+		/* Extract the MAC Address in 'address1' field of the MAC */
+		/* header and update the MAC Address in the allocated 'data'
+		 * variable. */
+		memcpy(data, bssid + 4, 6);
 	else
-		get_address3(data, bssid);
+		/* Extract the MAC Address in 'address3' field of the MAC */
+		/* header and update the MAC Address in the allocated 'data'
+		 * variable. */
+		memcpy(data, bssid + 16, 6);
 }
 
 /* This function extracts the SSID from a beacon/probe response frame        */
-- 
2.1.0



             reply	other threads:[~2015-10-22 10:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22 10:11 Shivani Bhardwaj [this message]
2015-10-22 10:34 ` [Outreachy kernel] [PATCH] Staging: wilc1000: coreconfigurator: Drop unneeded wrapper functions Julia Lawall
2015-10-22 11:01   ` Shivani Bhardwaj
2015-10-22 11:13     ` Julia Lawall
2015-10-22 11:28       ` Shivani Bhardwaj
2015-10-22 11:43         ` Julia Lawall
2015-10-22 12:26           ` Shivani Bhardwaj
2015-10-22 12:30             ` Julia Lawall
2015-10-22 12:33               ` Shivani Bhardwaj
2015-10-22 12:37                 ` Julia Lawall
2015-10-22 12:38                   ` Shivani Bhardwaj
  -- strict thread matches above, loose matches on Subject: below --
2015-10-22 12:53 Shivani Bhardwaj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151022101158.GA17223@ubuntu \
    --to=shivanib134@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.