2016-03-15 19:25:11

by Claudiu Beznea

[permalink] [raw]
Subject: [PATCH 1/2] Staging: wlan-ng: removed prototype of p80211_stt_findproto() from this file.

This patch removes the prototype of p80211_stt_findproto()
from p80211conv.h since global scope is not necessary.

Signed-off-by: Claudiu Beznea <[email protected]>
---
drivers/staging/wlan-ng/p80211conv.h | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211conv.h b/drivers/staging/wlan-ng/p80211conv.h
index 8c10357..6caba9a 100644
--- a/drivers/staging/wlan-ng/p80211conv.h
+++ b/drivers/staging/wlan-ng/p80211conv.h
@@ -155,6 +155,4 @@ int skb_ether_to_p80211(struct wlandevice *wlandev, u32 ethconv,
struct sk_buff *skb, union p80211_hdr *p80211_hdr,
struct p80211_metawep *p80211_wep);

-int p80211_stt_findproto(u16 proto);
-
#endif
--
1.9.1


2016-03-15 19:25:20

by Claudiu Beznea

[permalink] [raw]
Subject: [PATCH 2/2] Staging: wlan-ng: convert p80211_stt_findproto() to static inline functions

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 <[email protected]>
---
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

2016-03-15 19:45:45

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 1/2] Staging: wlan-ng: removed prototype of p80211_stt_findproto() from this file.

Hi Claudiu,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.5 next-20160315]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url: https://github.com/0day-ci/linux/commits/Claudiu-Beznea/Staging-wlan-ng-removed-prototype-of-p80211_stt_findproto-from-this-file/20160316-032739
config: xtensa-allyesconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa

Note: the linux-review/Claudiu-Beznea/Staging-wlan-ng-removed-prototype-of-p80211_stt_findproto-from-this-file/20160316-032739 HEAD 5518803294d6e4fcd6c066edb94cc30d04949bdb builds fine.
It only hurts bisectibility.

All errors (new ones prefixed by >>):

drivers/staging/wlan-ng/p80211conv.c: In function 'skb_ether_to_p80211':
>> drivers/staging/wlan-ng/p80211conv.c:156:8: error: implicit declaration of function 'p80211_stt_findproto' [-Werror=implicit-function-declaration]
p80211_stt_findproto(proto)) {
^
drivers/staging/wlan-ng/p80211conv.c: At top level:
>> drivers/staging/wlan-ng/p80211conv.c:528:5: error: conflicting types for 'p80211_stt_findproto'
int p80211_stt_findproto(u16 proto)
^
drivers/staging/wlan-ng/p80211conv.c:529:1: note: an argument type that has a default promotion can't match an empty parameter name list declaration
{
^
drivers/staging/wlan-ng/p80211conv.c:156:8: note: previous implicit declaration of 'p80211_stt_findproto' was here
p80211_stt_findproto(proto)) {
^
cc1: some warnings being treated as errors

vim +/p80211_stt_findproto +156 drivers/staging/wlan-ng/p80211conv.c

00b3ed16 Greg Kroah-Hartman 2008-10-02 150 /* tack on SNAP */
82eaca7d Moritz Muehlenhoff 2009-02-08 151 e_snap =
4eb28f71 Johan Meiring 2010-11-06 152 (struct wlan_snap *)skb_push(skb,
4eb28f71 Johan Meiring 2010-11-06 153 sizeof(struct wlan_snap));
00b3ed16 Greg Kroah-Hartman 2008-10-02 154 e_snap->type = htons(proto);
25845388 Pranjal Bhor 2016-01-19 155 if (ethconv == WLAN_ETHCONV_8021h &&
25845388 Pranjal Bhor 2016-01-19 @156 p80211_stt_findproto(proto)) {
82eaca7d Moritz Muehlenhoff 2009-02-08 157 memcpy(e_snap->oui, oui_8021h,
82eaca7d Moritz Muehlenhoff 2009-02-08 158 WLAN_IEEE_OUI_LEN);
00b3ed16 Greg Kroah-Hartman 2008-10-02 159 } else {

:::::: The code at line 156 was first introduced by commit
:::::: 2584538807926344e713548e5210bded8ed22011 staging: wlan-ng: Logical continuation fixes

:::::: TO: Pranjal Bhor <[email protected]>
:::::: CC: Greg Kroah-Hartman <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (2.96 kB)
.config.gz (43.12 kB)
Download all attachments