All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alison Schofield <amsfield22@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] staging: rtl8712: fix comparison test warnings
Date: Tue, 6 Oct 2015 10:32:08 -0700	[thread overview]
Message-ID: <20151006173208.GA2860@Ubuntu-D830> (raw)
In-Reply-To: <5250385.UVr7jy50Xn@wuerfel>

On Tue, Oct 06, 2015 at 09:53:46AM +0200, Arnd Bergmann wrote:
> On Monday 05 October 2015 11:39:35 Alison Schofield wrote:
> > --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
> > +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
> > @@ -140,7 +140,7 @@ static inline void handle_pairwise_key(struct sta_info *psta,
> >  static inline void handle_group_key(struct ieee_param *param,
> >                                     struct _adapter *padapter)
> >  {
> > -       if (0 < param->u.crypt.idx &&
> > +       if (param->u.crypt.idx > 0 &&
> >             param->u.crypt.idx < 3) {
> >                 /* group key idx is 1 or 2 */
> >                 memcpy(padapter->securitypriv.XGrpKey[param->u.crypt.
> 
> this part is good.
> 
> 
> > @@ -957,7 +957,7 @@ static int r871x_wx_set_priv(struct net_device *dev,
> >         if (IS_ERR(ext))
> >                 return PTR_ERR(ext);
> >  
> > -       if (0 == strcasecmp(ext, "RSSI")) {
> > +       if (strcasecmp(ext, "RSSI") == 0) {
> >                 /*Return received signal strength indicator in -db for */
> >                 /* current AP */
> >                 /*<ssid> Rssi xx */
> 
> while this and most of the other comparisons below can be further
> improved by removing the "== 0" part. You can write this as
> 
> 	if (!strcasecmp(ext, "RSSI")) {
> 
> 
> 	Arnd

Thanks & understood. v2 in the works with ! and commit msg changes.

alison



      reply	other threads:[~2015-10-06 17:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-05 18:39 [PATCH] staging: rtl8712: fix comparison test warnings Alison Schofield
2015-10-05 20:38 ` [Outreachy kernel] " Julia Lawall
2015-10-05 21:38   ` Alison Schofield
2015-10-06  4:27     ` Sudip Mukherjee
2015-10-06  4:28       ` Julia Lawall
2015-10-06  7:53 ` Arnd Bergmann
2015-10-06 17:32   ` Alison Schofield [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=20151006173208.GA2860@Ubuntu-D830 \
    --to=amsfield22@gmail.com \
    --cc=arnd@arndb.de \
    --cc=outreachy-kernel@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.