Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965807AbcCOTZU (ORCPT ); Tue, 15 Mar 2016 15:25:20 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:33691 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932665AbcCOTZR (ORCPT ); Tue, 15 Mar 2016 15:25:17 -0400 From: Claudiu Beznea To: gregkh@linuxfoundation.org Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Claudiu Beznea Subject: [PATCH 2/2] Staging: wlan-ng: convert p80211_stt_findproto() to static inline functions Date: Tue, 15 Mar 2016 21:24:37 +0200 Message-Id: <1458069877-20354-2-git-send-email-claudiu.beznea@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1458069877-20354-1-git-send-email-claudiu.beznea@gmail.com> References: <1458069877-20354-1-git-send-email-claudiu.beznea@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3047 Lines: 95 This patch convert p80211_stt_findproto() to "static inline" since it is used only in p80211conv.c file and also has few instructins. After the scope was changed to static the function definition was moved at the beginning of the file to avoid undefined references. Signed-off-by: Claudiu Beznea --- drivers/staging/wlan-ng/p80211conv.c | 64 ++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c index 0a8f396..d3f62329 100644 --- a/drivers/staging/wlan-ng/p80211conv.c +++ b/drivers/staging/wlan-ng/p80211conv.c @@ -79,6 +79,38 @@ static u8 oui_rfc1042[] = { 0x00, 0x00, 0x00 }; static u8 oui_8021h[] = { 0x00, 0x00, 0xf8 }; /*---------------------------------------------------------------- +* p80211_stt_findproto +* +* Searches the 802.1h Selective Translation Table for a given +* protocol. +* +* Arguments: +* proto protocol number (in host order) to search for. +* +* Returns: +* 1 - if the table is empty or a match is found. +* 0 - if the table is non-empty and a match is not found. +* +* Call context: +* May be called in interrupt or non-interrupt context +*---------------------------------------------------------------- +*/ +static inline int p80211_stt_findproto(u16 proto) +{ + /* Always return found for now. This is the behavior used by the */ + /* Zoom Win95 driver when 802.1h mode is selected */ + /* TODO: If necessary, add an actual search we'll probably + * need this to match the CMAC's way of doing things. + * Need to do some testing to confirm. + */ + + if (proto == ETH_P_AARP) /* APPLETALK */ + return 1; + + return 0; +} + +/*---------------------------------------------------------------- * p80211pb_ether_to_80211 * * Uses the contents of the ether frame and the etherconv setting @@ -509,38 +541,6 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, } /*---------------------------------------------------------------- -* p80211_stt_findproto -* -* Searches the 802.1h Selective Translation Table for a given -* protocol. -* -* Arguments: -* proto protocol number (in host order) to search for. -* -* Returns: -* 1 - if the table is empty or a match is found. -* 0 - if the table is non-empty and a match is not found. -* -* Call context: -* May be called in interrupt or non-interrupt context -*---------------------------------------------------------------- -*/ -int p80211_stt_findproto(u16 proto) -{ - /* Always return found for now. This is the behavior used by the */ - /* Zoom Win95 driver when 802.1h mode is selected */ - /* TODO: If necessary, add an actual search we'll probably - * need this to match the CMAC's way of doing things. - * Need to do some testing to confirm. - */ - - if (proto == ETH_P_AARP) /* APPLETALK */ - return 1; - - return 0; -} - -/*---------------------------------------------------------------- * p80211skb_rxmeta_detach * * Disconnects the frmmeta and rxmeta from an skb. -- 1.9.1