[bug report] cxl: Prevent adapter reset if an active context exists

2 messages, 2 authors, 2018-07-04 · open the first message on its own page

[bug report] cxl: Prevent adapter reset if an active context exists

From: Dan Carpenter <hidden>
Date: 2018-07-04 15:06:01

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

Re: [bug report] cxl: Prevent adapter reset if an active context exists

From: Vaibhav Jain <hidden>
Date: 2018-07-04 15:31:39

Dan Carpenter [off-list ref] writes:
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
Thanks for reporting this. I have sent out a patch to fix this at
http://patchwork.ozlabs.org/patch/939426/

-- 
Vaibhav Jain [off-list ref]
Linux Technology Center, IBM India Pvt. Ltd.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help