LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: vaibhav@linux.vnet.ibm.com
Cc: linuxppc-dev@lists.ozlabs.org
Subject: [bug report] cxl: Prevent adapter reset if an active context exists
Date: Wed, 4 Jul 2018 17:40:50 +0300	[thread overview]
Message-ID: <20180704144050.mjex2gg7hsarhc6x@kili.mountain> (raw)

Hello Vaibhav Jain,

The patch 70b565bbdb91: "cxl: Prevent adapter reset if an active
context exists" from Oct 14, 2016, leads to the following static
checker warning:

	drivers/misc/cxl/main.c:290 cxl_adapter_context_get()
	warn: 'atomic_inc_unless_negative(&adapter->contexts_num)' is unsigned

drivers/misc/cxl/main.c
   285  int cxl_adapter_context_get(struct cxl *adapter)
   286  {
   287          int rc;
   288  
   289          rc = atomic_inc_unless_negative(&adapter->contexts_num);
   290          return rc >= 0 ? 0 : -EBUSY;

atomic_inc_unless_negative() returns bool so it's always >= 0.

   291  }

regards,
dan carpenter

             reply	other threads:[~2018-07-04 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-04 14:40 Dan Carpenter [this message]
2018-07-04 15:31 ` [bug report] cxl: Prevent adapter reset if an active context exists Vaibhav Jain

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=20180704144050.mjex2gg7hsarhc6x@kili.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=vaibhav@linux.vnet.ibm.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