public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [bug report] cxgb4: add common api support for configuring filters
Date: Thu, 24 Nov 2016 11:05:02 +0000	[thread overview]
Message-ID: <20161124110502.GD17225@mwanda> (raw)

Hello Rahul Lakkireddy,

The patch 578b46b9383c: "cxgb4: add common api support for
configuring filters" from Sep 20, 2016, leads to the following static
checker warning:

	drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c:537 __cxgb4_set_filter()
	warn: we tested 'f->valid' before and it was 'false'

drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
   512          /* Check to make sure that provided filter index is not
   513           * already in use by someone else
   514           */
   515          f = &adapter->tids.ftid_tab[filter_id];
   516          if (f->valid)
   517                  return -EBUSY;

If valid is set, then we return -EBUSY.

   518  
   519          fidx = filter_id + adapter->tids.ftid_base;
   520          ret = cxgb4_set_ftid(&adapter->tids, filter_id,
   521                               fs->type ? PF_INET6 : PF_INET);
   522          if (ret)
   523                  return ret;
   524  
   525          /* Check to make sure the filter requested is writable ... */
   526          ret = writable_filter(f);
   527          if (ret) {
   528                  /* Clear the bits we have set above */
   529                  cxgb4_clear_ftid(&adapter->tids, filter_id,
   530                                   fs->type ? PF_INET6 : PF_INET);
   531                  return ret;
   532          }
   533  
   534          /* Clear out any old resources being used by the filter before
   535           * we start constructing the new filter.
   536           */
   537          if (f->valid)
   538                  clear_filter(adapter, f);

So probably these lines can be removed?

   539  
   540          /* Convert the filter specification into our internal format.
   541           * We copy the PF/VF specification into the Outer VLAN field
   542           * here so the rest of the code -- including the interface to
   543           * the firmware -- doesn't have to constantly do these checks.
   544           */

regards,
dan carpenter

             reply	other threads:[~2016-11-24 11:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-24 11:05 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-03-01  9:52 [bug report] cxgb4: add common api support for configuring filters Dan Carpenter

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=20161124110502.GD17225@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@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