The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Joel Pelaez Jorge <joelpelaez@gmail.com>
Cc: devel@driverdev.osuosl.org, Silvan Jegen <s.jegen@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] Staging: rtl8192e: Fix sparse warning
Date: Sun, 6 Apr 2014 13:59:13 -0700	[thread overview]
Message-ID: <20140406205913.GA19577@kroah.com> (raw)
In-Reply-To: <5341BC7E.3060007@gmail.com>

On Sun, Apr 06, 2014 at 03:43:42PM -0500, Joel Pelaez Jorge wrote:
> El 06/04/14 15:26, Greg Kroah-Hartman escribió:
> > On Sun, Apr 06, 2014 at 02:12:44PM -0500, Joel Pelaez Jorge wrote:
> >> El 06/04/14 14:01, Greg Kroah-Hartman escribió:
> >>> On Sun, Apr 06, 2014 at 01:43:38PM -0500, Joel Pelaez Jorge wrote:
> >>>> Fix a sparse warning, non static symbol is no declared as such.
> >>>> And fix a conflict with static function declared extern to include
> >>>> rtl_wx.h header.
> >>>>
> >>>> drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning:
> >>>> symbol 'r8192_wx_handlers_def' was not declared. Should it be static?
> >>>>
> >>>> Signed-off-by: Joel Pelaez Jorge <joelpelaez@gmail.com>
> >>>> ---
> >>>>     drivers/staging/rtl8192e/rtl8192e/rtl_wx.c |    3 ++-
> >>>>     1 file changed, 2 insertions(+), 1 deletion(-)
> >>>>
> >>>> diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
> >>>> b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
> >>>> index 498995d..f17584d 100644
> >>>> --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
> >>>> +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
> >>>> @@ -19,6 +19,7 @@
> >>>>
> >>>>     #include <linux/string.h>
> >>>>     #include "rtl_core.h"
> >>>> +#include "rtl_wx.h"
> >>>
> >>> Why is this needed?
> >>>
> >>>>
> >>>>     #define RATE_COUNT 12
> >>>>     static u32 rtl8192_rates[] = {
> >>>> @@ -1293,7 +1294,7 @@ static iw_handler r8192_private_handler[] = {
> >>>>     	(iw_handler)r8192_wx_get_PromiscuousMode,
> >>>>     };
> >>>>
> >>>> -static struct iw_statistics *r8192_get_wireless_stats(struct net_device
> >>>> *dev)
> >>>> +struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)
> >>>
> >>> Why make this global?  This doesn't have anything to do with the warning
> >>> you are working on as described above.
> >>>
> >>> totally confused,
> >>>
> >>> greg k-h
> >>>
> >>   >
> >> In the "rtl_wx.h" header declare extern 'r8192_wx_handlers_def'
> >> but r8192_get_wireless_stats too.
> > 
> > I don't understand what this sentance means :(
> > 
> >> Because r8192_get_wireless_stats is used by rtl_core.h if WIRELESS_EXT
> >> is more that 12 but less that 17.
> > 
> > Will that value ever change?
> > 
> > thanks,
> > 
> > greg k-h
> > 
> The file: 'rtl_wx.h' is a header that defines some symbols uses
> externally by 'rtl_core.c', it declare:
> 
> extern struct iw_handler_def r8192_wx_handlers_def;
> struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev);
> 
> If this header is included in rtl_wx.c, fix the sparse warning, but
> cause conflict with the function declaration, because in 'rtl_wx.c'
> r8192_get_wireless_stats is defined as 'static'.
> 
> In the header is defined as 'extern' because is called by rtl_core.c
> if the WIRELESS_EXT certain values.

Ok, that makes more sense.  Can you put all of that in the changelog
entry and resend the patch?

> By the way, WIRELESS_EXT is a define constant that indicate the
> wireless extension version supported by the kernel it only up.
> The better solution is remove the code that called the function, remove
> the declaration and only keep 'r8192_wx_handlers_def'.

That would be best...

thanks,

greg k-h

      reply	other threads:[~2014-04-06 20:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-06 18:43 [PATCH v2] Staging: rtl8192e: Fix sparse warning Joel Pelaez Jorge
2014-04-06 18:49 ` Joe Perches
2014-04-06 19:00   ` Joel Pelaez Jorge
2014-04-06 19:02     ` Joe Perches
2014-04-06 19:01 ` Greg Kroah-Hartman
2014-04-06 19:12   ` Joel Pelaez Jorge
2014-04-06 20:26     ` Greg Kroah-Hartman
2014-04-06 20:43       ` Joel Pelaez Jorge
2014-04-06 20:59         ` Greg Kroah-Hartman [this message]

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=20140406205913.GA19577@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=joelpelaez@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.jegen@gmail.com \
    /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