linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] staging:rtl8192u: Style and a question?
@ 2018-08-28 18:55 John Whitmore
  2018-08-28 18:55 ` [PATCH 1/4] staging:rtl8192u: Remove unused definitions - Style John Whitmore
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: John Whitmore @ 2018-08-28 18:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: devel, gregkh, John Whitmore

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


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

end of thread, other threads:[~2018-08-29 11:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-28 18:55 [PATCH 0/4] staging:rtl8192u: Style and a question? John Whitmore
2018-08-28 18:55 ` [PATCH 1/4] staging:rtl8192u: Remove unused definitions - Style John Whitmore
2018-08-28 18:55 ` [PATCH 2/4] staging:rtl8192u: Add required SPDX-License-Identifier " John Whitmore
2018-08-28 18:55 ` [PATCH 3/4] staging:rtl8192u: Refactor member variable enabled " John Whitmore
2018-08-29 11:20   ` Dan Carpenter
2018-08-29 11:30     ` John Whitmore
2018-08-28 18:55 ` [PATCH 4/4] staging:rtl8192u: Rename member pDot11dInfo " John Whitmore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).