lkml.org 
[lkml]   [2018]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 0/4] staging:rtl8192u: Style and a question?
Date
This short series of coding style changes clears the remaining checkpatch
issues in the files r8180_93cx6.h and dot11d.h. The file dot11d.h does
still contain lines over the 80 character limit, but most of these lines
are MACRO definitions, and I'm not sure splitting them will add anything
to the style and readability of the code.

My question is with respect to the member variable 'enabled' which has
been refactored in the third patch of the series. I've renamed the
variable to 'dot11d_enabled', (in addition to changing it's type as
suggested by checkpatch), so that it is easier to search for in code.
Now that it is easier to search for 'dot11d_enabled' and it's associated
macro IS_DOT11D_ENABLE(ieee) it becomes apparent that the variable is
initialised to FALSE, (and elsewhere '0'), but appears never to be set.

The function dot11d_update_country_ie(), in file dot11d.c, states in its
header block comment that it assumes that the value of dot11d_enabled is
true.

The dot11d_info structure is allocated:

ieee->dot11d_info = kzalloc(sizeof(struct rt_dot11d_info), GFP_KERNEL);

And dot11d_enabled could be set with a memcopy or a memset, but if it
is being set I've missed it completely. There may be a kernel specific
mechanism which I'm not yet familiar with?

In my ignorance I'd be tempted to remove all code which relies on the
variable being True, but then that function dot11d_update_country_ie()
specifically assumes it's true and is an exported symbol.

John Whitmore (4):
staging:rtl8192u: Remove unused definitions - Style
staging:rtl8192u: Add required SPDX-License-Identifier - Style
staging:rtl8192u: Refactor member variable enabled - Style
staging:rtl8192u: Rename member pDot11dInfo - Style

drivers/staging/rtl8192u/ieee80211/dot11d.c | 66 +++++++++----------
drivers/staging/rtl8192u/ieee80211/dot11d.h | 6 +-
.../staging/rtl8192u/ieee80211/ieee80211.h | 2 +-
.../rtl8192u/ieee80211/ieee80211_softmac.c | 8 +--
drivers/staging/rtl8192u/r8180_93cx6.h | 19 +-----
drivers/staging/rtl8192u/r8192U_core.c | 2 +-
6 files changed, 43 insertions(+), 60 deletions(-)

--
2.18.0

\
 
 \ /
  Last update: 2018-08-28 20:57    [W:0.135 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site