mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Whitmore <johnfwhitmore@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
	John Whitmore <johnfwhitmore@gmail.com>
Subject: [PATCH 0/4] staging:rtl8192u: Style and a question?
Date: Tue, 28 Aug 2018 19:55:31 +0100	[thread overview]
Message-ID: <20180828185535.28808-1-johnfwhitmore@gmail.com> (raw)

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


             reply	other threads:[~2018-08-28 18:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28 18:55 John Whitmore [this message]
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

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=20180828185535.28808-1-johnfwhitmore@gmail.com \
    --to=johnfwhitmore@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome